MPI uses void** arguments to pass pointer by reference so it can be updated. In 
Fortran, you always pass by reference so you don't need this. Just pass your 
Fortran pointer argument.

There are MPI-3 shared memory examples in Fortran somewhere. Try Using Advanced 
MPI (latest edition) or MPI Trac (search for Rolf).

I apologize for commenting without reading your code, but I can't open tarballs 
on my phone.

Jeff 

Sent from my iPhone

> On Apr 18, 2016, at 4:15 PM, Tom Rosmond <rosm...@reachone.com> wrote:
> 
> Hello,
> 
> I am trying to port a simple halo exchange program from C to fortran.  It is 
> designed to demonstrate the shared memory features of MPI-3.  The original C 
> program was download from an Intel site, and I have modified it to simplify 
> the port.  A tarfile of a directory with each program and example outputs is 
> attached.  To test use Open-MPI 1.10.3rc1 (which supports MPI-3), and do :
> 
> mpicc testmpi3.c
> mpif90 -np 8 a.out | sort > outc
> 
> and
> 
> mpif90 testmpi3.f90
> mpif90 -np 8 a.out | sort > outf
> 
> Comparing outc and outf,  you can see that 'testmpi3.c' runs correctly, 
> loading variable values from on-node processors as well as from off-node.  
> 'testmpi3.f90' does not work correctly, as it cannot mimic the inter-node C 
> pointers.  'testmpi3.c' correctly loads variable values from addresses, while 
> 'testmpi3.f90' just loads the addresses.  Line 141 in 'testmpi3.c' and line 
> 94 in 'testmpi3.f90' are the companion lines of interest.  I am not a C 
> programmer, but as I understand it, the ** syntax of line 28 defines the 
> variable 'shar_pntr' as a 'pointer to a pointer'.  This seems to be the 
> secret, but unfortunately I haven't found a way to do the same in fortran.  
> Does anyone have a suggestion?  Is this a case where a C function must be 
> called from fortran to perform this kind of operation?
> 
> T. Rosmond
> 
> PS: Running gcc version 4.4.7 20120313 (Red Hat 4.4.7-16), IFORT 12.0.3.174, 
> and Open-MPI 1.10.3rc1
> 
> 
> <testmpi3.tar>
> _______________________________________________
> users mailing list
> us...@open-mpi.org
> Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/users
> Link to this post: 
> http://www.open-mpi.org/community/lists/users/2016/04/28960.php

Reply via email to