[accaf, fortran, 3/4] Allocatable components support in derived typed coarrays
Andre Vehreschild
vehre@gmx.de
Tue Aug 30 15:50:00 GMT 2016
Hi all,
this is the runtime part of the patch set for allocatable components of
derived type coarrays. The patch changes the signature of the
caf_register() function to take an array descriptor and to no longer
return the memory allocated as return value. The memory allocated is
supplied in the array descriptor's data field. The function now truely
does as it is named: It may register already allocated memory, which
can be supplied in the data field of the array descriptor (gfortran
does not yet make use of it, but I see use cases to come).
Furthermore implements this patch the get_by_ref and send_by_ref
functions (sendget_by_ref is implemented by calling the first two).
Both get/send_by_ref functions at first analyze the chain of references
supplied to figure whether the memory described by the destination is
sufficient. When that is not the case and reallocation of the
destination is allowed, than this is done, else the evaluation is
terminated by a runtime error.
The next step of the get/send_by_ref routines is to recursively
evaluate the references given. At the moment component refs (both
allocatable and non-allocatable), array refs to descriptor arrays (both
allocatable and non-allocatable) and array refs to descriptor-less
arrays are fully supported.
This patch also provides the changes to the gfortran.texi documentation
giving the changes to the _caf_register() function and the new _by_ref
function while also documenting caf_reference_t.
Comments welcome.
Regards,
Andre
--
Andre Vehreschild * Email: vehre ad gmx dot de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: accaf_3.patch
Type: text/x-patch
Size: 89915 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20160830/5f66eaee/attachment.bin>
More information about the Fortran
mailing list