[accaf, fortran, 2/4] Allocatable components support in derived typed coarrays

Andre Vehreschild vehre@gmx.de
Tue Aug 30 15:50:00 GMT 2016


Hi all,

this part of the patchset does the significant changes in the front end
to support allocatable components in derived typed coarrays.

Besides replacing a call to malloc for the allocatable component with a
call to caf_register (1) (and to caf_deregister() for the free()) the
most other significant change (2) is the setup of the _caf_OP_by_ref ()
calls. 

(1) To allocate components of derived type coarrays the caf_register()
function is modified to take an array descriptor and return the memory
allocated in the data-field of the array descriptor. This change is
mandated by the need for allocating arrays of which the mpi instance of
the caf-library needs to know the array descriptor. During evaluation
of a reference chain of an expression the mpi-implementation needs to
fetch the remote array descriptor to figure the bounds. For this the
descriptor needs to be known by the mpi-implementation.

(2) The evaluation of a chain of references of allocatable components
needs the array descriptors of the remote image. Those array's bounds
can be different from the current image's array (as implemented by
Cray's fortran compiler). This patch therefore delegates the evaluation
of the references requested to the runtime. For this three new
runtime-function _caf_get_by_ref(), _caf_send_by_ref() and
_caf_sendget_by_ref() are implemented and the calls are setup by this
patch's code. Note that these functions have no direct reference to the
local object that represents the coarray on the current image. The
only connection to the coarray object is the token.

All of these routines furthermore have the ability to reallocate the
destination memory, when this is allowed (by a parameter of the
function call). Before these functions are called the chain of
references is assembled on the stack.

Nearly all refing modes are generated by the drivers for the new
_by_ref function calls. Only for descriptor-less arrays, that are to be
indexed by a vector, no support is currently implemented for rank > 1
(It is not checked, but wrong code will be generated).

This is the major part of the patch and it needs part 1 to compile. 

Comments welcome.

Regards,
	Andre
-- 
Andre Vehreschild * Email: vehre ad gmx dot de 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: accaf_2.patch
Type: text/x-patch
Size: 86483 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20160830/36adb7b1/attachment.bin>


More information about the Fortran mailing list