Gilles,
Thanks! With my very rudimentary understanding of C pointers and C
programming in general I missed that translation subtly. The revised
program runs fine with a variety of optimizations and debug options on
my test system.
Tom R.
On 10/27/2016 10:23 PM, Gilles Gouaillardet wrote:
Tom,
regardless the (lack of) memory model in Fortran, there is an error in
testmpi3.f90
shar_mem is declared as an integer, and hence is not in the shared memory.
i attached my version of testmpi3.f90, which behaves just like the C
version,
at least when compiled with -g -O0 and with Open MPI master
/* i replaced shar_mem with fptr_mem */
Cheers,
Gilles
On 10/26/2016 3:29 AM, Tom Rosmond wrote:
All:
I am trying to understand the use of the shared memory features of
MPI-3 that allow direct sharing of the memory space of on-node
processes. Attached are 2 small test programs, one written in C
(testmpi3.c), the other F95 (testmpi3.f90) . They are solving the
identical 'halo' exchange problem. 'testmpi3.c' is a simplified
version of an example program from a presentation by Mark Lubin of
Intel. I wrote 'testmpi3.f90' to mimic the C version.
Also attached are 2 text files of the compile, execution, and output
of the respective programs:
CC_testmpi3.txt
F95_testmpi3.txt
Note: All 4 files are contained in the attached 'testmpi3.tar.gz'.
Comparing the outputs of each version, it is clear that the shared
memory copies in 'testmpi3.c' are working correctly, but not in
'testmpi3.f90'. As far as I can tell, the 2 programs are equivalent
up to line 134 of 'testmpi3.c' and lines 97-101 of 'testmpi3.f90'. I
thought the calls to 'c_f_pointer' would produce Fortran pointers
that would access the correct shared memory addresses as the
C-pointers do in 'testmpi3.c', but clearly that isn't happening. Can
anyone explain why not, and what is needed to make this happen. Any
suggestions are welcome.
My environment:
Scientific Linux 6.8
INTEL FORTRAN and ICC version 15.0.2.164
OPEN-MPI 2.0.1
T. Rosmond
_______________________________________________
users mailing list
users@lists.open-mpi.org
https://rfd.newmexicoconsortium.org/mailman/listinfo/users
_______________________________________________
users mailing list
users@lists.open-mpi.org
https://rfd.newmexicoconsortium.org/mailman/listinfo/users
_______________________________________________
users mailing list
users@lists.open-mpi.org
https://rfd.newmexicoconsortium.org/mailman/listinfo/users