NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.

To learn about what's going on, see About the Archive Site.

[netcdfgroup] OpenMPI MPI_COMM_WORLD

Hi,

I am having a problem with OpenMPI and NetCDF4 Fortran 90 parallel IO.
I'm fairly certain the problem is with NetCDF and not HDF5 because 'make
check' for HDF5 tests the C AND Fortran 90 parallel IO and all tests
pass. I have traced this problem extensively in TotalView and it seems
to stem from the fact that MPI_COMM_WORLD is zero in the Fortran 90
interface for OpenMPI. In contrast, MPICH2 Fortran 90 interface sets
MPI_COMM_WORLD to 1140850688.

It errors on the first NetCDF function call, 'nf90_create_par'. The
error I get with OpenMPI is:

   bash-3.00$ mpirun -np 2 nf90_test
   [daggoo:12142] *** An error occurred in MPI_Comm_dup
   [daggoo:12142] *** on communicator MPI_COMM_WORLD
   [daggoo:12142] *** MPI_ERR_COMM: invalid communicator
   [daggoo:12142] *** MPI_ERRORS_ARE_FATAL (your MPI job will now abort)

     *** Writing output file :   nf90_test.nc

   ---------------------------------------------------------------------
   mpirun has exited due to process rank 0 with PID 12142 on
   node daggoo exiting without calling "finalize". This may
   have caused other processes in the application to be
   terminated by signals sent by mpirun (as reported here).
   ---------------------------------------------------------------------
   [daggoo:12141] 1 more process has sent help message
   help-mpi-errors.txt / mpi_errors_are_fatal
   [daggoo:12141] Set MCA parameter "orte_base_help_aggregate" to 0 to
   see all help / error messages
   bash-3.00$

If I compile and run the exact same program with MPICH2 I completes
successfully. There are several more NetCDF calls later in the program.
Of course, when using MPICH2 I use the HDF5 and NetCDF4 libraries
compiled with MPICH2.

Is there a workaround?

OpenMPI provides C functions to convert between C and Fortran values for
MPI_COMM_*:

   MPI_Comm MPI_Comm_f2c(MPI_Fint comm)

   &

   MPI_Fint MPI_Comm_c2f(MPI_Comm comm)

Reference:

http://www.mpi-forum.org/docs/mpi21-report-bw/node355.htm#Node355

I have attached a gzipped tar of the two source files and the Makefile.

Thanks,
David Robertson

Attachment: io_test.tar.gz
Description: GNU Zip compressed data

  • 2009 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: