Skip to content

Commit

Permalink
added ncidp_present to the parameters sent when a file is created in …
Browse files Browse the repository at this point in the history
…async mode
  • Loading branch information
edhartnett committed Aug 23, 2019
1 parent d077e48 commit ba2bb47
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/clib/pio_msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ int create_file_handler(iosystem_desc_t *ios)
int iotype;
int mode;
int use_ext_ncid;
char ncidp_present;
int mpierr;

PLOG((1, "create_file_handler comproot = %d", ios->comproot));
Expand All @@ -194,8 +195,11 @@ int create_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__);
if ((mpierr = MPI_Bcast(&ncidp_present, 1, MPI_CHAR, 0, ios->intercomm)))
return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__);
PLOG((1, "create_file_handler len %d filename %s iotype %d mode %d "
"use_ext_ncid %d", len, filename, iotype, mode, use_ext_ncid));
"use_ext_ncid %d ncidp_present", len, filename, iotype, mode,
use_ext_ncid, ncidp_present));

/* Call the create file function. */
PIOc_createfile(ios->iosysid, &ncid, &iotype, filename, mode);
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 @@ -1998,6 +1998,7 @@ PIOc_createfile_int(int iosysid, int *ncidp, int *iotype, const char *filename,
if (!ios->ioproc)
{
int msg = PIO_MSG_CREATE_FILE;
char ncidp_present = ncidp ? 1 : 0;
size_t len = strlen(filename);

/* Send the message to the message handler. */
Expand All @@ -2016,8 +2017,11 @@ PIOc_createfile_int(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);
PLOG((2, "len %d filename %s iotype %d mode %d use_ext_ncid %d",
len, filename, file->iotype, mode, use_ext_ncid));
if (!mpierr)
mpierr = MPI_Bcast(&ncidp_present, 1, MPI_CHAR, ios->compmaster, ios->intercomm);
PLOG((2, "len %d filename %s iotype %d mode %d use_ext_ncid %d "
"ncidp_present %d", len, filename, file->iotype, mode,
use_ext_ncid, ncidp_present));
}

/* Handle MPI errors. */
Expand Down

0 comments on commit ba2bb47

Please sign in to comment.