-
-
Notifications
You must be signed in to change notification settings - Fork 55
Improve teams implementation #794
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
base: main
Are you sure you want to change the base?
Conversation
CMakeLists.txt
Outdated
add_caf_test(teams_this_image 8 teams_this_image) | ||
add_caf_test(teams_num_images 8 teams_num_images) | ||
else() | ||
add_caf_test(team_number_pre15 8 team_number_pre15) |
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.
The tests for team_number
are essentially the same, just with an additional assert that was commented out included. I do not like the idea of maintaining two separate files with practically the exact same content, nor do I like having to include this else
clause in the CMake file. @vehre would you be able to just give the test file a capital .F90
file extension and use a preprocessor macro to conditionally include the assertion in the test?
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.
Did that. Sorry, for messing that up. On gfortran the policy is to create a new test. So I did it here, too. I've now added the preprocessor directives.
src/tests/unit/teams/sync-team.f90
Outdated
@@ -24,6 +25,7 @@ program main | |||
end if |
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 test isn't really actually testing the functionality of form team and sync team, it's more of a smoke test. It would be nice to add some assertions using get_team and team_number to verify this is functioning as expected.
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.
Also, some check on the synchornization. I also do not understand the point of the second set of calls to:
sync team(team(CHILD_TEAM))
sync team(team(CURRENT_TEAM))
Shouldn't calling each one once be sufficient?
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.
Well, I don't know what the initial author had in mind with that. I can only speculate, that he encountered some deadlocks when waiting for different teams.
I have reverted my changes to the sync_team.f90 and added two new tests with hopefully more "beef". Thank you for making me do this, because test_teams_1.f90 had me fix some errors in gfortran and in OpenCoarrays. Therefore there is a longer commit list now.
if (j2 /= num / 2) stop 2 | ||
|
||
j3 = num_images(MOD(me, 2) + 1) | ||
if (j3 /= num / 2) stop 3 |
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 can follow this, but a comment describing what each test is actually testing would help clarify things.
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.
Done.
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.
@vehre in general this looks good. Please address or respond to individual comments. Also, in the tests there are a lot of somewhat complicated integer arithmetic expressions. Often these are for determining the team. They seem like magic numbers unless you really take the time to go through them. It would be helpful to include a comment describing how you arrived at the expression (or more details on what the expression is).
ae7d58c
to
8fe8625
Compare
Er, most of the computations are about doing odd-even team splits or the like. Can you point me to a specific one? |
Improve the implementation of team's functions to adhere to the Fortran 2018 standard and gfortran from 16 on.
Issuing this error was a misinterpretation of the standard.
Revert changes to CAF_COMM_WORLD and introduce CAF_COMM_TEAM. Let all communication happen on CAF_COMM_WORLD and map the image indexes accordingly. Use CAF_COMM_TEAM for all collective ops.
Add tests that really make use of teams and not only a smoke test.
f3018bb
to
5661643
Compare
@zbeekman I had to adapt the teams for gcc-16, because the merge reQuest on gfortran did not make it in time for the gcc-15 release. I.e. improved teams support will now be on gcc-16 only, if no one reQuests a backport. |
Improve the implemenation of team's functions to adhere to the Fortran 2018 standard and gfortran from 15 on.
Summary of changes
Summarize what you changed
Rationale for changes
OpenCoarrays was not implementing teams support correctly. This pull request adds the missing pieces and reworks non-standard complying parts. It also fixes the coarrays allocated in a teams block need to be freeed on exit issue.
Fixes #779
Fixes #545
Additional info and certifications
This pull request (PR) is a:
I certify that
OpenCoarrays developer a chance to review my proposed code
be introduced)
Code coverage data