[Patch, Fortran] Add CO_BROADCAST
Thu Sep 25 16:46:00 GMT 2014
Hi, I'm implementing the co_broadcast on libcafmpi right now.
2014-09-25 8:08 GMT+02:00 Tobias Burnus <email@example.com>:
> Hi Paul,
> Paul Richard Thomas wrote:
>> In the check.c error messages, you use 'A argument'. Should you not
>> use 'SOURCE argument', following CO BROADCAST (SOURCE, SOURCE IMAGE [,
>> STAT, ERRMSG]) ? I am looking at WG5/N1983 - is there some more recent
> Looking at N2027, I see "A, SOURCE_IMAGE [, STAT, ERRMSG]". It might be that
> J3/WG5 decided that SOURCE= is a bad name on all but one image as it would
> for all other images a DESTINATION.
> Regarding the references: I try to keep
> https://gcc.gnu.org/wiki/GFortranStandards up to date; I think the latest
> draft is N2027:
> Thanks for cross checking!
>> When do you intend to implement a _gfortran_caf_co_broadcast that does
> Well, the current libgfortran/caf/single.c is fully compliant - for a single
> image. (Ignoring allocatable components and the lacking finalization.)
> I intend to leave the MPI and GASNet implementation to Alessandro, unless I
> feel really tempted to do it.
>> Anway, the patch is OK for trunk.
> Thanks for the review! I committed the unmodified patch as Rev. 215579.
>> On 20 September 2014 16:09, Tobias Burnus <firstname.lastname@example.org> wrote:
>>> This patch adds a CO_BROADCAST and prepares a bit for CO_REDUCE.
>>> Both functions permit arguments with allocatable components
>>> or polymorphic), CO_BROADCAST also permits polymorphic arguments. This
>>> doesn't support allocatable/polymorphic arguments but otherwise
>>> should work. For CO_REDUCE only some parsing/argument checking is done
>>> 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
>>> 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
>>> copyin/out to accelerators; the current spec handles allocatable
>>> 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
>>> (elemental or not, passing arguments with array descriptor, as pointer or
>>> value, having a hidden string length argument or [with C binding] not
>>> Requiring packed array arguments or not, whether gfortran returns the
>>> as value or as argument - and possibly more). There is some J3 discussion
>>> 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?
More information about the Gcc-patches