Hello,

I'm having a problem with MPI_COMM_WORLD in Fortran 90. I have tried with OpenMPI versions 1.2.6 and 1.2.8. Both versions are compiled with the PGI 8.0-2 suite. I've run the program in a debugger and MPI_COMM_WORLD is always 0, MPI_COMM_SELF is giving me a non-zero value though. The MPI functions don't seem to be affected by the fact that MPI_COMM_WORLD is 0. For example, the following works just fine:

        CALL mpi_init (MyError)
        CALL mpi_comm_rank (MPI_COMM_WORLD, MyRank, MyError)
        CALL mpi_comm_size (MPI_COMM_WORLD, Nnodes, MyError)

even though, in the debugger, MPI_COMM_WORLD is zero every step of the way. However, when I try to us MPI_COMM_WORLD in a non MPI standard function (Netcdf-4 in this case):

        status=nf90_create_par(TRIM(ncname),                           &
     &                         OR(nf90_clobber, nf90_netcdf4),         &
     &                         MPI_COMM_WORLD, info, ncid)


 I get the following error:

[daggoo:07640] *** An error occurred in MPI_Comm_dup
[daggoo:07640] *** on communicator MPI_COMM_WORLD
[daggoo:07640] *** MPI_ERR_COMM: invalid communicator
[daggoo:07640] *** MPI_ERRORS_ARE_FATAL (goodbye)


I have tried the exact same code compiled and run with MPICH2 (also PGI 8.0-2) and the problem does not occur. Also, with MPICH2 in the debugger MPI_COMM_WORLD is non-zero immediately after the mpi_init call and remains the same throughout execution. Is MPI_COMM_WORLD "private" in OpenMPI? If it is, is there a reason MPI_COMM_SELF does not behave the same way? Is there a way to access MPI_COMM_WORLD's value?

If I have forgotten any details needed to debug this issue, please let me know.

Thanks,
David Robertson

Reply via email to