Skip to content

Commit

Permalink
now netcdf integration works with multiple computational components w…
Browse files Browse the repository at this point in the history
…ith async
  • Loading branch information
edhartnett committed Sep 9, 2019
1 parent f195435 commit 0d6cbc7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
15 changes: 11 additions & 4 deletions src/clib/pio_msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ int create_file_handler(iosystem_desc_t *ios)
/* Set the IO system ID. */
nc_set_iosystem(iosysid);

PLOG((2, "about to call nc_create() have set iosysid to %d", iosysid));
PLOG((2, "about to call nc_create() having set iosysid to %d", iosysid));
nc_create(filename, mode|NC_UDF0, &ncid);
#endif /* NETCDF_INTEGRATION */
}
Expand Down Expand Up @@ -1977,6 +1977,7 @@ int open_file_handler(iosystem_desc_t *ios)
int iotype;
int mode;
int use_ext_ncid;
int iosysid;
int mpierr;

PLOG((1, "open_file_handler comproot = %d", ios->comproot));
Expand All @@ -1999,16 +2000,22 @@ 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__);
if ((mpierr = MPI_Bcast(&iosysid, 1, MPI_INT, 0, ios->intercomm)))
return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__);

PLOG((2, "len %d filename %s iotype %d mode %d use_ext_ncid %d",
len, filename, iotype, mode, use_ext_ncid));
PLOG((2, "len %d filename %s iotype %d mode %d use_ext_ncid %d iosysid %d",
len, filename, iotype, mode, use_ext_ncid, iosysid));

/* Call the open file function. Errors are handled within
* function, so return code can be ignored. */
if (use_ext_ncid)
{
#ifdef NETCDF_INTEGRATION
PLOG((2, "about to call nc_create()"));
/* Set the IO system ID. */
nc_set_iosystem(iosysid);

PLOG((2, "about to call nc_create() having set iosysid to %d",
iosysid));
nc_open(filename, mode|NC_UDF0, &ncid);
#endif /* NETCDF_INTEGRATION */
}
Expand Down
2 changes: 2 additions & 0 deletions src/clib/pioc_support.c
Original file line number Diff line number Diff line change
Expand Up @@ -2598,6 +2598,8 @@ 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);
if (!mpierr)
mpierr = MPI_Bcast(&diosysid, 1, MPI_INT, ios->compmaster, ios->intercomm);
}

/* Handle MPI errors. */
Expand Down
6 changes: 3 additions & 3 deletions tests/ncint/tst_async_multi.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ main(int argc, char **argv)
int num_io_procs = 1;

/* Turn on logging for PIO library. */
PIOc_set_log_level(4);
if (!my_rank)
nc_set_log_level(3);
/* PIOc_set_log_level(4); */
/* if (!my_rank) */
/* nc_set_log_level(3); */

/* Initialize the intracomm. The IO task will not return from
* this call until the PIOc_finalize() is called by the
Expand Down

0 comments on commit 0d6cbc7

Please sign in to comment.