Coarray shared memory testing
Andre Vehreschild
vehre@gmx.de
Wed Oct 1 13:52:54 GMT 2025
Hi all,
attached series of patches adds more stable support for running shared
memory multi process Fortran programs on MacOS. The only new part is the last
(the pr88076_v4_9.patch). Changes in the former files are only results of
rebasing.
On MacOS shared memory coarrays face the issue of having to have the shared
memory segment at the same (virtual) base address in all processes/images, but
the OS not always complying to our wish. The supervisor of the coarray program
therefore now is able to restart an image, when the OS is not complying to put
the shared memory segment where we need to have it. The shared memory segment
needs to be at the same address in all images, because else shared mutexes tend
malfunction. I haven't found any documentation from Apple or the
MachOS kernel why this is that way, but it unfortunately is. The number of
restarts of images is limited. I.e. this is not going on forever, but one can
either set a (documented) environment variable, or got with the default of
4000 at the moment. The count on restarts is total on all images and not per
image.
It took me quite some time to figure what was going on and I had to fix
libsanitizer on macOS for newer OS releases, which being unfamiliar took me
even longer. There might be other issues fixed unintentionally by these
patches. So feel free to test.
Regtested ok on x86_64-pc-linux-gnu / F41, x86_64-w64-win32 / MSYS2 / UCRT64 and
x86_64-apple-darwin24.something. (Testing on MSYS2/UCRT64 gives tons of fails
of 'excess output' tests, which stem from gfortran emitting some escape code,
which doesn't even print, and expect picking it up.)
Regards,
Andre
On Wed, 10 Sep 2025 13:31:01 -0700
Jerry D <jvdelisle2@gmail.com> wrote:
> On 9/2/25 2:51 AM, Andre Vehreschild wrote:
> > Hi all,
> >
> > attached series of patches updates the coarray shmem gfortran series of
> > patches. It now has support for building on Window's Cygwin and Window's
> > MSYS2/UCRT64. Building on the latter is quite tricky. When you want to do
> > that, I recommend getting the source package for gcc-15 from the msys
> > website and adapting it. Nevertheless it is very fiddly to get it to build.
> > Most of the regression test on MSYS2/UCRT64 report "Excess errors" on the
> > compile step, which is due to gfortran emitting some escape codes, that do
> > not print, but "expect" regards them as output.
> >
> > I have deliberately (rebased and) updated the gfortran-test branch also, so
> > that you can get the newest version from there, too.
> >
> > Regtests ok on x86_64-pc-linux / F41 and x86_64-pc-cygwin / Win10.
> >
> > After hopefully having Windows wrestled down now, I will tackle MacOS not
> > having a sane process parallel mutex.
> >
> > Have fun testing.
> >
> > Regards,
> > Andre
>
> Hi all,
>
> Pinging here as a reminder. I have managed to apply the new patches but I
> have not had time to test. I also found a Cygwin installation on one of my
> computers here but have not tried anything there yet.
>
> Andre,, this is going to take some time and I hope to get to this.
>
> Regards,
>
> Jerry
--
Andre Vehreschild * Email: vehre ad gmx dot de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr88076_v4_1.patch
Type: text/x-patch
Size: 3186 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/fortran/attachments/20251001/7ceef30a/attachment-0009.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr88076_v4_2.patch
Type: text/x-patch
Size: 4414 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/fortran/attachments/20251001/7ceef30a/attachment-0010.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr88076_v4_3.patch
Type: text/x-patch
Size: 5103 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/fortran/attachments/20251001/7ceef30a/attachment-0011.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr88076_v4_4.patch
Type: text/x-patch
Size: 2305 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/fortran/attachments/20251001/7ceef30a/attachment-0012.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr88076_v4_5.patch
Type: text/x-patch
Size: 176878 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/fortran/attachments/20251001/7ceef30a/attachment-0013.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr88076_v4_6.patch
Type: text/x-patch
Size: 50246 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/fortran/attachments/20251001/7ceef30a/attachment-0014.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr88076_v4_7.patch
Type: text/x-patch
Size: 7468 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/fortran/attachments/20251001/7ceef30a/attachment-0015.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr88076_v4_8.patch
Type: text/x-patch
Size: 57328 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/fortran/attachments/20251001/7ceef30a/attachment-0016.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr88076_v4_9.patch
Type: text/x-patch
Size: 15427 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/fortran/attachments/20251001/7ceef30a/attachment-0017.bin>
More information about the Fortran
mailing list