Fwd: [PATCH] libgfortran: [PR127702] caf_shmem: do not take the size of a, team from its barrier

Jerry D jvdelisle2@gmail.com
Fri Oct 2 16:57:53 GMT 2026


I forgot to include gcc-patches.


-------- Forwarded Message --------
Subject: [PATCH] libgfortran: [PR127702] caf_shmem: do not take the size of a, 
team from its barrier
Date: Fri, 2 Oct 2026 09:56:20 -0700
From: Jerry D <jvdelisle2@gmail.com>
To: gfortran <fortran@gcc.gnu.org>

I have attached two patches. These must be applied in order.

The first one is a cleanup I found while testing the fixes for PR127347.

It is simple and I plan to push shortly.

The second is a fixup that I renamed to PR127702 which Mikael reported.

For information, after these two go in, I have a fix for PR127684 which I also 
discovered during testing. I will post that a little later.

Regression tested on x86_64.

OK for mainline?

Regards,

Jerry

---

libgfortran: [PR127702] caf_shmem: do not take the size of a
   team from its barrier

A team's image_count is the barrier its images synchronize in, and its
count drops as images of the team terminate.  It was also used as the
number of images of the team, so NUM_IMAGES shrank once an image had
stopped, IMAGE_STATUS reported an active image as stopped, and FORM
TEAM and the collectives laid themselves out over too few images.

Use the size of the team's image map, which does not change.

Assisted-by: Claude Opus 5

	PR libfortran/127702

libgfortran/ChangeLog:

	* caf/shmem.c (_gfortran_caf_num_images, _gfortran_caf_image_status)
	(_gfortran_caf_form_team): Take the size of a team from its image
	map.
	* caf/shmem/collective_subroutine.c (collsub_reduce_array):
	Likewise.

gcc/testsuite/ChangeLog:

	* gfortran.dg/coarray/num_images_stopped_1.f90: New test.
---
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PR127347-caf-shmem-coarray-part-per-image.patch
Type: text/x-patch
Size: 3458 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20261002/ff66f063/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PR127702-caf-shmem-team-size-from-image-map.patch
Type: text/x-patch
Size: 6955 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20261002/ff66f063/attachment-0001.bin>


More information about the Gcc-patches mailing list