-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test with Julienne #169
base: main
Are you sure you want to change the base?
Test with Julienne #169
Conversation
189c949
to
886233a
Compare
Test coverage: * prif_init * prif_allocate, prif_deallocate, prif_allocate_coarray, prif_deallocate_coarray * prif_co_broadcast, prif_co_max, prif_co_min, prif_co_sum, prif_co_reduce * prif_image_index, prif_num_images, prif_this_image_no_coarray * prif_put, prif_get * prif_sync_all * prif_team_type, prif_form_team, prif_change_team, prif_end_team
This commit replaces veggies and iso_varying_string in the fpm manifest with julienne and assert.
git mv main.{f,F}90
This commit fixes a problem that caused seg faults when running subsets of tests. Previously, if the subset didn't include the prif_init test, then prif_init was never called. This commit calls prif_init in test/main.F90 before running the tests. Consequently, the test for normal execution of prif_init now happens via an assertion rather than in a unit test.
As suggested in the following comment, this commit defines a separate project for testing program termination: #133 (comment)
This commit removes code that was temporarily inserted when diagnosing a flang bug and uncomments the correct code.
886233a
to
435d148
Compare
This commit defines a new prif_test_t type that extends Julienne's test_t type in ordero to override test_t's "report" type-bound procedure in order to replace parallel Fortran featuers with PRIF calls.
This eliminates a do loop in prif_test_t's "report" tybe-bound procedure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't reviewed the changes the tests yet, but I have a few higher level comments so far.
- You need to add an
fpm.toml
file in thetest-termination
folder. At present the instructions in thetest-termination/README.md
do not work. Thefpm.toml
I created is listed below. - It is unclear from the output whether the tests pass or fail. I would recommend putting together some sort of script that checks the output of each individual test rather than have users try to inspect the outputs and determine pass/fail manually. This should make getting the CI to work easier as well.
- I would have made the switch to Julienne a separate PR, as the stop tests don't really depend on the test framework and vice-versa.
- I think on balance the switch to Julienne might be the right move, but I think it's worth pointing out some of the important differences:
- You get less detailed output from running the test suite. i.e. it doesn't report how many or what values are being compared. This could make debugging failing tests (or erroneously passing tests) more difficult.
- The framework is simpler, and it is one you control.
- I think you could adapt
veggies
in a similar way as you did withjulienne
, so if you're curious to try it, I could point you at the few things you'd want/need to overload.
example fpm.toml
file
name = "test-termination"
version = "0.4.1"
license = "BSD"
author = ["Damian Rouson", "Brad Richardson", "Katherine Rasmussen", "Dan Bonachea"]
maintainer = "[email protected]"
copyright = "2021-2024 UC Regents"
[dependencies]
caffeine = {path = ".."}
[build]
link = ["gasnet-smp-seq", "gcc", "m"]
The new text at the bottom of the test-termination/README.md specifies the environment variable definitions used in running the termination tests.
@everythingfunctional thanks for the quick review!
Good catch. I just pushed my
That's the plan. I'm hoping @ktras can work on this.
I agree. If we decide against the switch to Julienne, I'll create a separate PR to replace the old program termination tests with the new ones.
This morning's release of Julienne 1.6.0 adds this information in diagnostic output. This issue has been bugging me for a while, but it took some focused time over the break to think of how to add such diagnostic output in backwards-compatible way. Of course, there aren't many projects using Julienne yet (two-ish) but it would be nice to not have to rewrite multiple projects' test suites all at once. Fortunately I finally figured out a backwards-compatible path and that's in Julienne 1.6.0.
Very cool. It would probably be useful info for learning purposes either way so pointers are welcome. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made some initial observations based on a quick skim of the high-level changes.
I have not yet dived into review of the test code.
manifest/fpm.toml.template
Outdated
veggies = {git = "https://gitlab.com/everythingfunctional/veggies", tag = "v1.1.3"} | ||
iso_varying_string = {git = "https://gitlab.com/everythingfunctional/iso_varying_string.git", tag = "v3.0.4"} | ||
julienne = {git = "https://github.com/berkeleylab/julienne.git", tag = "1.5.3"} | ||
assert = {git = "https://github.com/berkeleylab/assert.git", tag = "2.0.0"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are adding a project dependence on berkeleylab/assert (which I DO support), then we should also excise the current caffeine_assert_s
module which was added as a temporary workaround for a lack of a real assertion library.
However this change is also orthogonal to the Julienne transition and feels like it belongs in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As agreed in our meeting, I'll be working on this upgrade as a separate PR
test-termination/fpm.toml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not yet convinced that the proposed change fully resolves all six of the problems outlined in issue #137 that this PR claims to solve. However it might be a step in the right direction?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree we shouldn't hold up this PR waiting for a complete solution to #137. I've changed the PR description to stop claiming a complete fix to that issue, so that GitHub hopefully won't automatically close it.
I'm not yet prepared to approve a merge of this PR as-is, let's plan to discuss on Wednesday.
This commit appends `_c_bool` to the `quiet` argument of `prif_co_reduce` and removes the `pure` attribue from the encompassing procedure.
As of commit fcf2fa8, this PR now adds the capability for diagnostic output in the event of a test failure for all tests except those in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made some additional observations.
Right now my biggest concern with this PR is that it updates an (old?) snapshot of of the test suite, which is continuing to evolve in several other in-flight PRs. I don't want this PR to become a blocker for merging PRs that add Caffeine features (with corresponding test code that naturally will semantically conflict with this PR).
Given a choice between reaching PRIF 0.5 compliance (a client-facing feature goal) and replacing an internal test harness, I'd currently lean towards prioritizing the former. Does the proposed switch from Veggies to Julienne provide any direct benefit to library clients, or is this purely a maintainability upgrade that mostly benefits Caffeine developers?
Let's plan to discuss this further in our meeting this week.
|
||
impure elemental subroutine co_all(boolean) | ||
logical(c_bool), intent(inout) :: boolean | ||
call prif_co_reduce(boolean, c_funloc(both)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is using the PRIF 0.4 version of prif_co_reduce
, and will break when we upgrade the implementation to PRIF 0.5, which significantly complicates the code needed to invoke prif_co_reduce
(see PR #158).
Moreover there's no semantic reason to use a custom reduction function here. Please convert the boolean to an integer and use prif_co_sum
or prif_co_max
instead, to avoid the mess mentioned above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes in this file massively conflict with the complete rewrite in-progress in PR #158 to accommodate the PRIF 0.5 changes to collectives.
test/prif_co_max_test_m.F90
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes in this file will conflict with the changes in-progress in PR #158 to accommodate the PRIF 0.5 changes to collectives.
test/prif_co_min_test_m.F90
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes in this file will conflict with the changes in-progress in PR #158 to accommodate the PRIF 0.5 changes to collectives.
test/prif_co_sum_test_m.F90
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes in this file will conflict with the changes in-progress in PR #158 to accommodate the PRIF 0.5 changes to collectives.
test/prif_teams_test_m.F90
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes in this file massively conflict with the changes in-progress in PR #171, where this test was greatly expanded to complete coverage for the PRIF 0.5 implementation of teams.
The simple file renames for This PR will eventually need a rebase to resolve that conflict and also semantic conflicts with PR #171 and #175 that have also been merged. However as discussed work on this PR should probably be deferred until after PR #158 is completed and the test suite reaches a point of stability with PRIF 0.5, to avoid another redundant round of conflict resolution. |
This PR replaces PR #133 and accomplishes the following:
prif_stop
andprif_error_stop
make fragile non-portable assumptions #137 by moving the termination tests to a separatefpm
project in the newtest-termination/
subdirectory as suggested in comment r1761996357.prif_test_t
type that extends Julienne'stest_t
type and overridetest_t
'sreport
type-bound procedure, replacing parallel Fortran features with PRIF calls.The primary motivation for the switch to Julienne is complexity reduction: the Julienne software stack contains 3850 lines of code versus 30513 in Veggies as determined by executing following command on the current main branch of both repositories:
As a consequence, the test suite runs much faster even after accounting for some possible reduction in test coverage because this test suite was originally developed in 3-4 months ago so any tests added to the Veggies-based test suite since then are not represented here. Determining whether and to what extent the test coverage is actually diminished is on the To Do list below.
To Do
test-termination
subdirectory.test/
andtest-termination/
subdirectories to match the test coverage of the previous Veggies-based tests.