This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
> > Hi Ed, > > it works with Open MPI, configure correctly sets HAVE_MPI_COMM_F2C to 1 > and I could run my program without any trouble. > > But... I wonder if the code in libsrc4/nc4file.c works correctly with an MPI > without MPI_Comm_f2c: nc_create_par is called with comm_c=0 and info_c=0. > But it should pass the Fortran versions of the communicator and info object > (as done in NetCDF 4.0.1): > > int > nc_create_par_fortran(const char *path, int cmode, int comm, > int info, int *ncidp) > { > MPI_Comm comm_c = 0; > MPI_Info info_c = 0; > #ifdef USE_PARALLEL > #ifdef HAVE_MPI_COMM_F2C > comm_c = MPI_Comm_f2c(comm); > info_c = MPI_Info_f2c(info); > #else > comm_c = (MPI_Comm)comm; > info_c = (MPI_Info)info; > #endif > #endif > return nc_create_par(path, cmode, comm_c, info_c, ncidp); > } > > > and the same changes for nc_open_par_fortran: > > int > nc_open_par_fortran(const char *path, int mode, int comm, > int info, int *ncidp) > { > MPI_Comm comm_c = 0; > MPI_Info info_c = 0; > #ifdef USE_PARALLEL > #ifdef HAVE_MPI_COMM_F2C > comm_c = MPI_Comm_f2c(comm); > info_c = MPI_Info_f2c(info); > #else > comm_c = (MPI_Comm)comm; > info_c = (MPI_Info)info; > #endif > #endif > return nc_open_par(path, mode, comm_c, info_c, ncidp); > } > > > > > matthias > Howdy Matthias! Thanks for pointing that out. Parallel test runs will happen tonight with the full nightly test build, and presumably that bug would have shown up then. But I have fixed it as you suggest, and released a new snapshot if you want to take a look. Thanks for all the help! NetCDF is a community-supported free software package, and we depend on the efforts of knowledgeable and helpful users like yourself! Thanks, Ed Ticket Details =================== Ticket ID: QOI-309912 Department: Support netCDF Priority: Critical Status: Closed