Skip to content

Commit

Permalink
only send iosysid for create/open when netcdf integration is in use
Browse files Browse the repository at this point in the history
  • Loading branch information
edhartnett committed Sep 9, 2019
1 parent 0d6cbc7 commit a8b8a42
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/clib/pio_msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ int create_file_handler(iosystem_desc_t *ios)
int mode;
int use_ext_ncid;
char ncidp_present;
int iosysid;
int iosysid = 0;
int mpierr;

PLOG((1, "create_file_handler comproot = %d", ios->comproot));
Expand All @@ -201,8 +201,10 @@ int create_file_handler(iosystem_desc_t *ios)
if (ncidp_present)
if ((mpierr = MPI_Bcast(&ncid, 1, MPI_INT, 0, ios->intercomm)))
return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__);
#ifdef NETCDF_INTEGRATION
if ((mpierr = MPI_Bcast(&iosysid, 1, MPI_INT, 0, ios->intercomm)))
return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__);
#endif /* NETCDF_INTEGRATION */
PLOG((1, "create_file_handler len %d filename %s iotype %d mode %d "
"use_ext_ncid %d ncidp_present %d ncid %d iosysid %d", len,
filename, iotype, mode, use_ext_ncid, ncidp_present, ncid,
Expand Down Expand Up @@ -1977,7 +1979,7 @@ int open_file_handler(iosystem_desc_t *ios)
int iotype;
int mode;
int use_ext_ncid;
int iosysid;
int iosysid = 0;
int mpierr;

PLOG((1, "open_file_handler comproot = %d", ios->comproot));
Expand All @@ -2000,8 +2002,10 @@ int open_file_handler(iosystem_desc_t *ios)
return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__);
if ((mpierr = MPI_Bcast(&use_ext_ncid, 1, MPI_INT, 0, ios->intercomm)))
return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__);
#ifdef NETCDF_INTEGRATION
if ((mpierr = MPI_Bcast(&iosysid, 1, MPI_INT, 0, ios->intercomm)))
return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__);
#endif /* NETCDF_INTEGRATION */

PLOG((2, "len %d filename %s iotype %d mode %d use_ext_ncid %d iosysid %d",
len, filename, iotype, mode, use_ext_ncid, iosysid));
Expand Down
8 changes: 6 additions & 2 deletions src/clib/pioc_support.c
Original file line number Diff line number Diff line change
Expand Up @@ -2039,11 +2039,13 @@ PIOc_createfile_int(int iosysid, int *ncidp, int *iotype, const char *filename,
if (ncidp_present)
if (!mpierr)
mpierr = MPI_Bcast(ncidp, 1, MPI_INT, ios->compmaster, ios->intercomm);
#ifdef NETCDF_INTEGRATION
if (!mpierr)
mpierr = MPI_Bcast(&diosysid, 1, MPI_INT, ios->compmaster, ios->intercomm);
#endif /* NETCDF_INTEGRATION */
PLOG((2, "len %d filename %s iotype %d mode %d use_ext_ncid %d "
"ncidp_present %d diosysid %d", len, filename, file->iotype, mode,
use_ext_ncid, ncidp_present, diosysid));
"ncidp_present %d", len, filename, file->iotype, mode,
use_ext_ncid, ncidp_present));
}

/* Handle MPI errors. */
Expand Down Expand Up @@ -2598,8 +2600,10 @@ PIOc_openfile_retry(int iosysid, int *ncidp, int *iotype, const char *filename,
mpierr = MPI_Bcast(&mode, 1, MPI_INT, ios->compmaster, ios->intercomm);
if (!mpierr)
mpierr = MPI_Bcast(&use_ext_ncid, 1, MPI_INT, ios->compmaster, ios->intercomm);
#ifdef NETCDF_INTEGRATION
if (!mpierr)
mpierr = MPI_Bcast(&diosysid, 1, MPI_INT, ios->compmaster, ios->intercomm);
#endif /* NETCDF_INTEGRATION */
}

/* Handle MPI errors. */
Expand Down

0 comments on commit a8b8a42

Please sign in to comment.