On 10/18/26 3:10 AM, Mikael Morin wrote:
Le 18/10/2026 à 00:41, Jerry D a écrit :
On 10/13/26 12:03 PM, Jerry DeLisle wrote:
See attached patch. FORM TEAM looked up a team's shared data by an id
built from the team number and a static count of FORM TEAM statements
per image. Two different teams could get the same id (for example team
2 of one statement and team 1 of the next), and images that had formed
a different number of teams computed different ids for the same team,
so a team could pick up another team's image map. The fix gives each
team a unique id from a counter in the supervisor. Since all images of
a new team have to agree on it, the first image of a FORM TEAM
statement that asks for team number N takes the next id and records it
in a small table in the parent team's shared data; the other images
asking for N read it from there.

Start with new_team_id in shmem.c and the new fields it uses:
teams_formed in struct caf_shmem_team (counts the statements, so the
table is reset once per statement), and id, new_teams and
new_teams_gen in struct shmem_image_info in teams_mgmt.h. Then
_gfortran_caf_form_team, which calls it under the allocator lock it
already held, and _gfortran_caf_change_team, where the coarray ids of
the team are now derived from the team's id. supervisor.h and
supervisor.c add and initialize next_team_id. The test form_team_ids_1
covers both collisions.

This applies on top of the PR127751 patch.

Regression tested on x86_64.

OK for mainline?

Regards,

Jerry

Ping, attached is a v2 of the patch. The only change from the previous version is I reduced the commit message and edited the changes in supervisor.c to be more readable. The indentations looked off to me.

Regression tested on x86_64

After this one goes in I will commit the fix for PR127973 when approved.

OK?

-- Jerry

OK.  Sorry for the delay; at some point I lost track of the patches waiting for review.

Thanks Mikael,

The master branch has been updated by Jerry DeLisle <[email protected]>:

https://gcc.gnu.org/g:89058eb24376fe0d25ed586fab86b691672eb45d

commit r17-5300-g89058eb24376fe0d25ed586fab86b691672eb45d

Reply via email to