[Patch, Fortran] Add coarray communication support to the trunk (coindex variables)
Tobias Burnus
burnus@net-b.de
Tue Jun 17 06:29:00 GMT 2014
This patch add the first coarray communication support to the trunk
(ignoring the co_sum/co_min/co_max support, which was recently merged).
[Note: In terms of the library this is still libcaf_single, but see below.]
The patch is based on my work on the fortran-caf branch, but has a
slightly modified ABI. The patch should support most communications, but
it is not complete. I intent to submit soon a patch which irons some
wrinkles.
In particular, this patch adds three library calls to handle coindexed
communication: Assignment to a coindex variable (caf_send), a coindexed
expression (caf_expression) and assigning a coindexed variable to a
coindexed variable (caf_sendget). The coarray is identified by a token
(opaque object provided by the coarray library), an offset to that base
address, an image index and an array descriptor for the coarray, which
is also used for scalars â and which has the value of the whole array
for vector subscripts. Additionally, one passes a "kind" variable as
extra argument as the current array descriptor cannot destinguish a
len=1 kind=4 from a len=4 kind=1 character string. And for vector
subscripts, the subscripts are passed as additional argument.
For assignments, the library is supposed to handle padding/trimming of
strings and type conversion (e.g. "cmplx_caf(:)[i] = int_array") as well
as "array = scalar" assignments.
The following is left to be done as follow up:
* Support of vector subscripts with assumed-size variables: To be
tested; might need the new array descriptor or some similar work around
â or just a test case.
* The library libcaf_single supports padding/trimming of strings but
still lacks the support for type conversion and vector subscripts.
* Adding an ABI documentation
* There are still some issues with regards to polymorphic coarrays, in
particular with passing them as dummy arguments and in ASSOCIATE/SELECT
TYPE, but presumably also with using them in coindexed expressions.
And as bigger item: Allocatable components of coarrays are not supported
â not is the access to pointer or allocatable components (part refs);
currently, there is no compile time diagnostic for it.
Additionally, I have remove the vector subscript preparations from the
co_sum/min/max as it does not make much sense for those. And I added a
collective test case, which I found on my hard disk.
Build and regtested. OK for the trunk?
Tobias
PS: Additional missing bits, not listed above: Locking and CRITICAL and
atomics for Fortran 2008. And for TS18508 co_broadcast and co_reduce,
the atomics extensions, teams, events and error recovery.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: caf.diff
Type: text/x-patch
Size: 80422 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20140617/4d4390d8/attachment.bin>
More information about the Fortran
mailing list