From 2469a2b30ff098c0d8eeb8b64c7a697cc6729a39 Mon Sep 17 00:00:00 2001 From: Ed Hartnett Date: Fri, 12 Jul 2019 05:42:12 -0600 Subject: [PATCH] better handling of netcdf integration in C lirbary --- src/clib/pioc.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/clib/pioc.c b/src/clib/pioc.c index 1f0c1ab2ff8..1c5dd32bd63 100644 --- a/src/clib/pioc.c +++ b/src/clib/pioc.c @@ -9,12 +9,20 @@ #include #include #include +#ifdef NETCDF_INTEGRATION +#include "ncintdispatch.h" +#endif /* NETCDF_INTEGRATION */ #ifdef USE_MPE /* The event numbers for MPE logging. */ extern int event_num[2][NUM_EVENTS]; #endif /* USE_MPE */ +#ifdef NETCDF_INTEGRATION +/* Have we initialized? */ +extern int ncint_initialized; +#endif /* NETCDF_INTEGRATION */ + /** * @defgroup PIO_init_c Initialize the IO System * Initialize the IOSystem, including specifying number of IO and @@ -934,6 +942,13 @@ PIOc_Init_Intracomm(MPI_Comm comp_comm, int num_iotasks, int stride, int base, if ((ret = pio_init_logging())) return pio_err(NULL, NULL, ret, __FILE__, __LINE__); +#ifdef NETCDF_INTEGRATION + PLOG((1, "Initializing netcdf integration")); + /* Initialize netCDF integration layer if we need to. */ + if (!ncint_initialized) + PIO_NCINT_initialize(); +#endif /* NETCDF_INTEGRATION */ + #ifdef USE_MPE pio_start_mpe_log(INIT); #endif /* USE_MPE */