[Patch, Fortran] Add CO_BROADCAST

Tobias Burnus burnus@net-b.de
Sat Sep 20 14:09:00 GMT 2014


This patch adds a CO_BROADCAST and prepares a bit for CO_REDUCE.

Both functions permit arguments with allocatable components 
(nonpolymophic or polymorphic), CO_BROADCAST also permits polymorphic 
arguments. This patch doesn't support allocatable/polymorphic arguments 
but otherwise CO_BROADCAST should work. For CO_REDUCE only some 
parsing/argument checking is done but no actual implementation.

The allocatables make life harder for general coarray communication, 
broadcast and reduction and have to be implemented at some point in a 
clever way. I am thinking of some call-back-able function - which could 
also be used for OpenMP 4.x/5.0 to handle copying to threadprivate 
variables and for copyin/out to accelerators; the current spec handles 
allocatable components by creating the copying code in the middle end, 
but that won't work for polymorphic allocatables.

For CO_REDUCE, it becomes even harder as currently any pure function 
works (elemental or not, passing arguments with array descriptor, as 
pointer or as value, having a hidden string length argument or [with C 
binding] not etc. Requiring packed array arguments or not, whether 
gfortran returns the result as value or as argument - and possibly 
more). There is some J3 discussion if one could narrow down the 
possibilities a bit. In any case, implementing co_reduce requires some 
thinking.

The attached patch was build and regtested on x86-64-gnu-linux.
OK for the trunk?

Tobias
-------------- next part --------------
A non-text attachment was scrubbed...
Name: coarray.diff
Type: text/x-patch
Size: 29185 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20140920/bda1cfd3/attachment.bin>


More information about the Gcc-patches mailing list