-
Notifications
You must be signed in to change notification settings - Fork 11
Add team features to native-multi-image.F90 app #269
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -34,11 +34,15 @@ program native_multi_image | |||||||||||||||||
| #endif | ||||||||||||||||||
| #ifndef HAVE_CO_BROADCAST | ||||||||||||||||||
| #define HAVE_CO_BROADCAST HAVE_COLLECTIVES | ||||||||||||||||||
| #endif | ||||||||||||||||||
| #ifndef HAVE_TEAM | ||||||||||||||||||
| #define HAVE_TEAM 1 | ||||||||||||||||||
bonachea marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||
| #endif | ||||||||||||||||||
|
|
||||||||||||||||||
| USE, INTRINSIC :: ISO_FORTRAN_ENV | ||||||||||||||||||
| integer :: me, ni, peer, tmp | ||||||||||||||||||
| integer :: me, ni, peer, tmp, team_id | ||||||||||||||||||
| character(len=5) :: c | ||||||||||||||||||
| type(team_type) :: subteam, res | ||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This declaration should be conditional on |
||||||||||||||||||
|
|
||||||||||||||||||
| me = THIS_IMAGE() | ||||||||||||||||||
| ni = NUM_IMAGES() | ||||||||||||||||||
|
|
@@ -91,6 +95,27 @@ program native_multi_image | |||||||||||||||||
| call CO_BROADCAST(c,1) | ||||||||||||||||||
| # endif | ||||||||||||||||||
|
|
||||||||||||||||||
| #if HAVE_TEAM | ||||||||||||||||||
| call status("Testing TEAMS...") | ||||||||||||||||||
| res = get_team(CURRENT_TEAM) | ||||||||||||||||||
| res = get_team(INITIAL_TEAM) | ||||||||||||||||||
| res = get_team() | ||||||||||||||||||
| write(*,'(A,I3)') "Initial team number is ", team_number() | ||||||||||||||||||
|
Comment on lines
+100
to
+103
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please preserve the convention used in this file of upper-case for intrinsics (to help them stand-out relative to lower-case variable/procedure names defined in the program)
Suggested change
and similarly below |
||||||||||||||||||
|
|
||||||||||||||||||
| if (ni < 2) then | ||||||||||||||||||
| if (me == 1) write(*,'(A)') "Please run program again with at least 2 images to test more TEAM features." | ||||||||||||||||||
| else | ||||||||||||||||||
|
Comment on lines
+105
to
+107
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are we excluding single-image execution here? By my reading the code below should still be fully correct (and hence testable) with a single image. It's obviously less interesting with only one image, but I don't see a reason to prohibit execution. |
||||||||||||||||||
| team_id = merge(1, 2, me <= ni/2) | ||||||||||||||||||
| form team(team_id, subteam) | ||||||||||||||||||
| sync team(subteam) | ||||||||||||||||||
| change team(subteam) | ||||||||||||||||||
| write(*,'(A,I3,A,I3,A,I3)') 'Inside CHANGE TEAM construct: ', this_image(), ' of ', num_images(), ' in team number ', team_number() | ||||||||||||||||||
| end team | ||||||||||||||||||
| call sync_all | ||||||||||||||||||
| write(*,'(A,I3)') "After END TEAM statement, TEAM_NUMBER() is ", team_number() | ||||||||||||||||||
| end if | ||||||||||||||||||
| #endif | ||||||||||||||||||
|
|
||||||||||||||||||
| call sync_all | ||||||||||||||||||
| write(*,'(A,I1,A,I1,A)') "Goodbye from image ", me, " of ", ni, " images" | ||||||||||||||||||
|
|
||||||||||||||||||
|
|
||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.
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 flang-latest runs of the test in this PR are now throwing the non-fatal exit-time warning:
This is effectively a regression of #259 and probably due to something along the new team-support code paths exercised in libcaffeine. We should either track down which piece of team support code is signalling an exception and fix it, or enter a new release-blocker issue to ensure this regression doesn't get forgotten.
If/when we do fix the problem, we should instrument the
native multi-image teststep in CI to detect future regressions.