Having trouble running an application using MPI_IN_PLACE. Am using PGI 15.1 and HPC Pack 2012 R2 MS-MPI via Cygwin. My code is as follows:
$ more simple_test.f
program main
implicit none
integer:: my_proc,ncells,ierr
include 'mpif.h'
call mpi_init(ierr)
call mpi_comm_rank(mpi_comm_world, my_proc, ierr)
ncells=(my_proc+1)*3
call mpi_allreduce(mpi_in_place, ncells, 1, mpi_integer,
& mpi_sum, mpi_comm_world, ierr)
print *,'num cells', ncells,my_proc
call flush(6)
call mpi_barrier(mpi_comm_world,ierr)
call mpi_finalize(ierr)
stop
end program
My compile script (shows where is placed MS-MPI directory) …
#!/bin/sh
MPIW=`cygpath -w "/usr/local/MS-MPI"`
Libs="-L $MPIW/Lib/amd64 msmpi.lib msmpifec.lib"
echo " Libs=" $Libs
IncFlags="-I $MPIW/Inc -I$MPIW/Inc/amd64"
pgf90 -Mextend $IncFlags -o test-pgi.exe simple_test.f $Libs
When running I am getting incorrect results as if MPI_IN_PLACE is
being treated as local variable with initial value of zero instead.
$ /usr/local/MS-MPI/Bin/mpiexec.exe -n 4 ./test-pgi.exe
num cells 0 0
num cells 0 1
num cells 0 2
num cells 0 3Is there a fix to this?