(j3.2006) Are functions in intrinsic modules "intrinsic"?

Damian Rouson damian
Mon Nov 16 23:25:10 EST 2015


> On Nov 16, 2015, at 9:52 PM, Malcolm Cohen <malcolm at nag-j.co.jp> wrote:
> 
> If the user actually wants the "sizeof" an element of an assumed-rank array, 
> this is available via
>  STORAGE_SIZE(assumed-rank-dummy)/STORAGE_SIZE(C_CHAR_'x')
> indeed that formulation also works for assumed-size arrays not just 
> assumed-rank!

Thanks for this!  I don?t recognize the C_CHAR_?x? syntax so it would be great to hear further explanation.

I think I was the user Bill cited.  OpenCoarrays uses C_SIZE_OF(assumed-rank-dummy) and I recently had to add a C-preprocessor directive to work around the lack of the feature in compilers other than GCC.  See line 473 at  https://github.com/sourceryinstitute/opencoarrays/blob/master/src/extensions/opencoarrays.F90, which reads

#if defined(COMPILER_LACKS_C_SIZEOF_ASSUMED_RANK)

In case it?s of interest, the above URL points to a file that was inspired by a user who wanted to build OpenCoarrays with the Intel compiler in order to access the OpenCoarrays collective subroutines. The above file is the API that I developed for users of non-CAF compilers to access ?CAF? features that their compiler doesn?t yet support.  I put ?CAF? in quotes because the features currently supported don?t involve any actual coarrays, but they are parallel programming features that came into the language with coarrays.  Although there is no fundamental reason we couldn?t support actual coarrays the same way, I came across four applications in the span of four months wherein access to this_image(), num_images(), sync all, sync images, error termination, and collective subroutines covers the applications' entire parallel algorithmic needs.  In such cases, it turned out to be incredibly simple to write a compiler wrapper that makes very simplistic (brain-dead) substitutions in the code before passing the code to the compiler. This already works with GCC 4.9 (which was the last version released prior to gfortran wrapping OpenCoarrays) and I?m working on getting it to work with other compilers.  The Fortran wrappers in the above module need to tell the OpenCoarrays C procedures the size (element byte size * number of elements) of the data being passed. 

Damian



More information about the J3 mailing list