Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion app/native-multi-image.F90
Copy link
Member

@bonachea bonachea Nov 19, 2025

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:

IEEE arithmetic exceptions signaled: INEXACT

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 test step in CI to detect future regressions.

Original file line number Diff line number Diff line change
Expand Up @@ -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
#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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This declaration should be conditional on HAVE_TEAM


me = THIS_IMAGE()
ni = NUM_IMAGES()
Expand Down Expand Up @@ -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
Copy link
Member

Choose a reason for hiding this comment

The 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
res = get_team(CURRENT_TEAM)
res = get_team(INITIAL_TEAM)
res = get_team()
write(*,'(A,I3)') "Initial team number is ", team_number()
res = GET_TEAM(CURRENT_TEAM)
res = GET_TEAM(INITIAL_TEAM)
res = GET_TEAM()
write(*,'(A,I3)') "Initial team number is ", TEAM_NUMBER()

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
Copy link
Member

Choose a reason for hiding this comment

The 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"

Expand Down
Loading