[J3] Question about coarray implementations

Thomas König tk at tkoenig.net
Fri May 19 19:45:57 UTC 2023


On 19.05.23 17:33, Damian Rouson via J3 wrote:
> A student has also worked on a threads-based parallel runtime for 
> gfortran that was nearly complete a couple of years ago but never quite 
> made it into a release.

I was/am also involved in it, so I can relate a bit first-hand.

This implementation is process-based, using fork after setting up a
shared memory segment.  This decision was taken to avoid having to
do anything with the library, specifically I/O.  It was also felt that
using pthreads could introduce hard-to-trace and subtle bugs in
interaction with OpenMP and asynchronous I/O.

One of the issues we faced was that, while Linux allows growing a
shared memory segement, MacOS does not (and neither does Windows).
This means that one has to reserve a "big enough" memory chunk on
startup. Inelegant, but not fatal on a virtual memory system.

Another issue was the question if it was possible to pass a pointer
to an entity on another image to some unsuspecting code which knows
nothing about coarrays.  This would have made things extremely hairy
because it would have required a different ABI for coarray-aware code.
This problem more or less stopped development.

Now, it _seems_, after some internal discussions, that the limitations
on ultimate pointer components are designed to disallow this.
Therefore, a question to this list: Is that indeed the case?  The
language of the standard is opaque enough that I cannot really answer
that question.

And we haven't even started thinking about teams.

> There has been some renewed interest in 
> finishing it recently so possibly it will appear in gfortran 14 next year.

Right now, the stutent is busy working on his Master's, and work hasn't
started.

Best regards

	Thomas


More information about the J3 mailing list