Re: [OMPI users] Fortran and MPI-3 shared memory

2016-10-28 Thread Tom Rosmond
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

Re: [OMPI users] Fortran and MPI-3 shared memory

2016-10-27 Thread Gilles Gouaillardet
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 Ope

Re: [OMPI users] OMPI users] Fortran and MPI-3 shared memory

2016-10-27 Thread Jeff Hammond
Yes, I tried -O0 and -O3. But VOLATILE is going to thwart a wide range of optimizations that would break this code. Jeff On Thu, Oct 27, 2016 at 2:19 AM, Gilles Gouaillardet < gilles.gouaillar...@gmail.com> wrote: > Jeff, > > Out of curiosity, did you compile the Fortran test program with -O0 ?

Re: [OMPI users] OMPI users] Fortran and MPI-3 shared memory

2016-10-27 Thread Gilles Gouaillardet
Jeff, Out of curiosity, did you compile the Fortran test program with -O0 ? Cheers, Gilles Tom Rosmond wrote: >Jeff, > >Thanks for looking at this.  I know it isn't specific to Open-MPI, but it is a >frustrating issue vis-a-vis MPI and Fortran.  There are many very large MPI >applications ar

Re: [OMPI users] Fortran and MPI-3 shared memory

2016-10-27 Thread Bader, Reinhold
> 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

Re: [OMPI users] Fortran and MPI-3 shared memory

2016-10-27 Thread Gilles Gouaillardet
From the MPI 3.1 standard (page 338) 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

Re: [OMPI users] Fortran and MPI-3 shared memory

2016-10-27 Thread Bader, Reinhold
I've had a look at the OpenMPI 1.10.3 sources, and the trouble appears to me to be that the MPI wrappers declare the argument TYPE(C_PTR), INTENT(OUT) :: baseptr inside the BIND(C) interface on the Fortran side (for OpenMPI this would, for example be ompi_win_allocate_f), and the C implement

Re: [OMPI users] Fortran and MPI-3 shared memory

2016-10-25 Thread Tom Rosmond
Jeff, Thanks for looking at this. I know it isn't specific to Open-MPI, but it is a frustrating issue vis-a-vis MPI and Fortran. There are many very large MPI applications around the world written in Fortran that could benefit greatly from this MPI-3 capability. My own background is in num

Re: [OMPI users] Fortran and MPI-3 shared memory

2016-10-25 Thread Jeff Hammond
I can reproduce this with Intel 17 and MPICH on Mac OSX so it's not an Open-MPI issue. I added VOLATILE to the shared memory objects to prevent Fortran compiler optimizations as well as a bunch of MPI_Win_sync calls (after replacing fence with lock_all/unlock_all), but neither changed the outcome.

[OMPI users] Fortran and MPI-3 shared memory

2016-10-25 Thread Tom Rosmond
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