[Fortran, Patch] Coarray: libcaf patch for _gfortran_caf_deregister

Tobias Burnus burnus@net-b.de
Fri Aug 26 06:51:00 GMT 2011


Allocatable coarrays are freed and deregistered via the libcaf function 
_gfortran_caf_deregister. Currently, the front end does not generate 
calls to the that function, however, this patch already implements the 
function.

See http://gcc.gnu.org/wiki/CoarrayLib and 
http://gcc.gnu.org/ml/fortran/2010-04/msg00168.html for details.

The function is called with the coarray token as argument. The token 
identifies the coarray in a way defined by the library. In case of 
single.c, it just contains the address of the allocated memory of the 
coarray. In case of mpi.c, it is an array of memory addresses on all 
images such that token[this_image()-1] is the memory location of the 
current image.

The patch also adds stat= and errmsg= diagnostic.

TODO: Adding calls to the function in code generated by the compiler - 
and testing the function.


Tested by compiling with mpicc and gcc with "-Wall -Wextra -std=c99".
OK for the trunk?

Tobias
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libcaf_dealloc.diff
Type: text/x-patch
Size: 2822 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20110826/6989c618/attachment.bin>


More information about the Fortran mailing list