diff --git a/src/ncint/ncint_pio.c b/src/ncint/ncint_pio.c index f750e0f79e8..0c9b3a16c4a 100644 --- a/src/ncint/ncint_pio.c +++ b/src/ncint/ncint_pio.c @@ -27,10 +27,6 @@ nc_init_intracomm(MPI_Comm comp_comm, int num_iotasks, int stride, int base, int { int ret; - /* Initialize if we need to. */ - if (!ncint_initialized) - PIO_NCINT_initialize(); - /* Call the PIOc_ function to initialize the intracomm. */ if ((ret = PIOc_Init_Intracomm(comp_comm, num_iotasks, stride, base, rearr, iosysidp))) @@ -42,6 +38,20 @@ nc_init_intracomm(MPI_Comm comp_comm, int num_iotasks, int stride, int base, int return PIO_NOERR; } +/** + * Set the default iosystemID. + * + * @author Ed Hartnett + */ +int +nc_set_iosystem(int iosysid) +{ + /* Remember the io system id. */ + diosysid = iosysid; + + return PIO_NOERR; +} + /** * Same as PIOc_free_iosystem(). * diff --git a/src/ncint/ncintdispatch.c b/src/ncint/ncintdispatch.c index b4d7d4a4026..e5075b61e2e 100644 --- a/src/ncint/ncintdispatch.c +++ b/src/ncint/ncintdispatch.c @@ -128,6 +128,8 @@ PIO_NCINT_initialize(void) NCINT_dispatch_table = &NCINT_dispatcher; + PLOG((1, "Adding user-defined format for netCDF PIO integration")); + /* Add our user defined format. */ if ((ret = nc_def_user_format(NC_UDF0, &NCINT_dispatcher, NULL))) return ret; @@ -148,8 +150,13 @@ PIO_NCINT_finalize(void) return NC_NOERR; } +/** + * Create a file using PIO via netCDF's nc_create(). + * + * @author Ed Hartnett + */ int -PIO_NCINT_create(const char* path, int cmode, size_t initialsz, int basepe, +PIO_NCINT_create(const char *path, int cmode, size_t initialsz, int basepe, size_t *chunksizehintp, void *parameters, const NC_Dispatch *dispatch, NC *nc_file) { @@ -157,7 +164,7 @@ PIO_NCINT_create(const char* path, int cmode, size_t initialsz, int basepe, iosystem_desc_t *ios; /* Pointer to io system information. */ int ret; - LOG((1, "PIO_NCINT_create path = %s mode = %x", path, mode)); + PLOG((1, "PIO_NCINT_create path = %s mode = %x", path, cmode)); /* Get the IO system info from the id. */ if (!(ios = pio_get_iosystem_from_id(diosysid))) @@ -191,7 +198,7 @@ PIO_NCINT_open(const char *path, int mode, int basepe, size_t *chunksizehintp, iosystem_desc_t *ios; /* Pointer to io system information. */ int ret; - LOG((1, "PIO_NCINT_open path = %s mode = %x", path, mode)); + PLOG((1, "PIO_NCINT_open path = %s mode = %x", path, mode)); /* Get the IO system info from the id. */ if (!(ios = pio_get_iosystem_from_id(diosysid))) diff --git a/tests/ncint/Makefile.am b/tests/ncint/Makefile.am index e5d41d2f2b1..03ebdc02ef6 100644 --- a/tests/ncint/Makefile.am +++ b/tests/ncint/Makefile.am @@ -24,4 +24,4 @@ endif # RUN_TESTS EXTRA_DIST = run_tests.sh # Clean up files produced during testing. -#CLEANFILES = *.nc *.log +CLEANFILES = *.nc *.log diff --git a/tests/ncint/tst_pio_udf.c b/tests/ncint/tst_pio_udf.c index 4a6c7fb1be6..dda4cdf55af 100644 --- a/tests/ncint/tst_pio_udf.c +++ b/tests/ncint/tst_pio_udf.c @@ -51,7 +51,7 @@ main(int argc, char **argv) int i; /* Turn on logging for PIO library. */ - PIOc_set_log_level(3); + /* PIOc_set_log_level(3); */ /* Initialize the intracomm. */ if (nc_init_intracomm(MPI_COMM_WORLD, 1, 1, 0, 0, &iosysid)) ERR;