Hi users and developers,
I am having a stringe result come from MPI_Allreduce subroutine in fortran. Here is the thing:
ALLOCATE(mesh%idx%lxyz_inv(nr(1, 1):nr(2, 1), nr(1, 2):nr(2, 2), nr(1, 3):nr(2, 3))) mesh%idx%lxyz_inv(:,:,:) = 0 !In a subroutine, An array was first allocated and initialized. nr(1, ?):nr(2, ?) are all -36:36 for the test run !... !... npoints = product(nr(2, 1:3) - nr(1, 1:3) + 1) call MPI_Allreduce(MPI_IN_PLACE, mesh%idx%lxyz_inv(nr(1, 1), nr(1, 2), nr(1, 3)), npoints, MPI_INTEGER, MPI_BOR, mpi_world%comm, mpi_err)
There were something wrong here at run time (I just ran it by typing a.exe. Not a parallel run). Before MPI_Allreduce, the first 48 elements of mesh%idx%lxyz_inv were all zero. But after the call was made, the first 48 elements of mesh%idx%lxyz_inv became:
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 1140850688 1 0
0 0 0 0 0 32768
64 4194304 64 896 384 0
-2 37010544 0 0 0 0
0 0 0 0 1078984704 0
0 1 0 1 0 3899248
And I noticed that the first strange number 1140850688 is the value of MPI_IN_PLACE defined in mpif.h. Other than that I have completely no clue of it.
I cannot simplify it to a small test program since when I test MPI_Allreduce with the same size array in a simple code, it works fine.
I am using intel Cluster studio 13 with everyting updated and intel MPI. I am trying to compile a 64 bit program so I used the header and libray in $(I_MPI_ROOT)em64t. I don't know whether that's the problem of this strange result. The compile is fine except a lot of "warning LNK4049: locally defined symbol mpifcmb5_ imported", "warning LNK4049: locally defined symbol mpipriv1_ imported", "warning LNK4049: locally defined symbol mpipriv2_ imported" and "warning LNK4049: locally defined symbol mpiprivc_ imported" when linking. OS is win 7 64bit.
Any comment will be appreciated! I can attach my project if it is necessary. Thanks.



