Skip to content

Commit

Permalink
merged changes from master
Browse files Browse the repository at this point in the history
  • Loading branch information
edhartnett committed Aug 23, 2019
2 parents b18bd12 + 6c24f63 commit 63adee9
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 15 deletions.
13 changes: 3 additions & 10 deletions src/clib/pio_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,16 +159,9 @@ PIOc_createfile(int iosysid, int *ncidp, int *iotype, const char *filename,
if ((ret = PIOc_createfile_int(iosysid, ncidp, iotype, filename, mode, 0)))
return pio_err(ios, NULL, ret, __FILE__, __LINE__);

/* Run this on all tasks if async is not in use, but only on
* non-IO tasks if async is in use. (Because otherwise, in async
* mode, set_fill would be called twice by each IO task, since
* PIOc_createfile() will already be called on each IO task.) */
if (!ios->async || !ios->ioproc)
{
/* Set the fill mode to NOFILL. */
if ((ret = PIOc_set_fill(*ncidp, NC_NOFILL, NULL)))
return ret;
}
/* Set the fill mode to NOFILL. */
if ((ret = PIOc_set_fill(*ncidp, NC_NOFILL, NULL)))
return ret;

return ret;
}
Expand Down
16 changes: 13 additions & 3 deletions src/clib/pio_msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,19 @@ int set_fill_handler(iosystem_desc_t *ios)
*/
int create_file_handler(iosystem_desc_t *ios)
{
<<<<<<< HEAD
=======
int ncid = 0;
>>>>>>> master
int len;
int iotype;
int mode;
int use_ext_ncid;
char ncidp_present;
<<<<<<< HEAD
int *ncidp = NULL;
=======
>>>>>>> master
int mpierr;

PLOG((1, "create_file_handler comproot = %d", ios->comproot));
Expand All @@ -197,12 +204,15 @@ int create_file_handler(iosystem_desc_t *ios)
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__);
if (ncidp_present)
if ((mpierr = MPI_Bcast(&ncid, 1, MPI_INT, 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 ncidp_present %d", len, filename, iotype, mode,
use_ext_ncid, ncidp_present));
"use_ext_ncid %d ncidp_present %d ncid %d", len, filename, iotype, mode,
use_ext_ncid, ncidp_present, ncid));

/* Call the create file function. */
PIOc_createfile_int(ios->iosysid, ncidp, &iotype, filename, mode,
PIOc_createfile_int(ios->iosysid, &ncid, &iotype, filename, mode,
use_ext_ncid);

PLOG((1, "create_file_handler succeeded!"));
Expand Down
9 changes: 7 additions & 2 deletions src/clib/pioc_support.c
Original file line number Diff line number Diff line change
Expand Up @@ -2003,6 +2003,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);
char ncidp_present = ncidp ? 1 : 0;

Expand All @@ -2024,8 +2025,12 @@ PIOc_createfile_int(int iosysid, int *ncidp, int *iotype, const char *filename,
mpierr = MPI_Bcast(&use_ext_ncid, 1, MPI_INT, ios->compmaster, ios->intercomm);
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));
if (ncidp_present)
if (!mpierr)
mpierr = MPI_Bcast(ncidp, 1, MPI_INT, 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 63adee9

Please sign in to comment.