> Rationale. The C bindings of MPI_ALLOC_MEM and MPI_FREE_MEM are similar
> to the bindings for the malloc and free C library calls: a call to
> MPI_Alloc_mem(: : :, &base) should be paired with a call to 
> MPI_Free_mem(base) (one
> less level of indirection). Both arguments are declared to be of same type
> void* so as to facilitate type casting. The Fortran binding is consistent 
> with the C bindings: the Fortran MPI_ALLOC_MEM call returns in baseptr the
> TYPE(C_PTR) pointer or the (integer valued) address of the allocated memory. 
> The base argument of MPI_FREE_MEM is a choice argument, which passes (a 
> reference
> to) the variable
> stored at that location. (End of rationale.)


Understood - this makes clear the MPI interface convention for the C side. 
However, the wording for the Fortran bindings is at best misleading.
If full consistency with the C interface were desired, the baseptr argument 
would need to be declared

TYPE(C_PTR), VALUE :: baseptr

and then users would be required to call the procedure via

CALL MPI_XXX( ..., c_loc(baseptr), ...)

With the signatures as currently defined, I stand by my opinion that the 
internal wrappers need to resolve the * vs ** issue.
See Fortran 2008, 15.3.7 para 2, item (5) (semantics of a dummy argument 
*without* the VALUE attribute).


> at first glance, i also thought type should have been char ** instead of char 
> *, but it is not a typo nor a mistake


> Cheers,


> Gilles


--
Dr. Reinhold Bader
Leibniz Supercomputing Centre (http://www.lrz.de) / HPC Systems and Services
Tel.: 0049 89 35831 8825  Fax: 8625

_______________________________________________
users mailing list
users@lists.open-mpi.org
https://rfd.newmexicoconsortium.org/mailman/listinfo/users

Reply via email to