Skip to content

Commit

Permalink
move UDF initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
edhartnett committed Jul 6, 2019
1 parent 974ed66 commit 8cd22e5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/ncint/ncintdispatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,8 @@ nc_init_intracomm(MPI_Comm comp_comm, int num_iotasks, int stride, int base, int
{
int ret;

/* Add our user defined format, if necessary. */
if (!ncint_initialized)
{
if ((ret = nc_def_user_format(NC_UDF0, &NCINT_dispatcher, NULL)))
return ret;
ncint_initialized++;
}
NC_NCINT_initialize();

if ((ret = PIOc_Init_Intracomm(comp_comm, num_iotasks, stride, base, rearr,
iosysidp)))
Expand All @@ -151,7 +146,15 @@ nc_init_intracomm(MPI_Comm comp_comm, int num_iotasks, int stride, int base, int
int
NC_NCINT_initialize(void)
{
int ret;

NCINT_dispatch_table = &NCINT_dispatcher;

/* Add our user defined format. */
if ((ret = nc_def_user_format(NC_UDF0, &NCINT_dispatcher, NULL)))
return ret;
ncint_initialized++;

return NC_NOERR;
}

Expand Down
3 changes: 3 additions & 0 deletions src/ncint/ncintdispatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ typedef struct NC_HDF4_FILE_INFO
extern "C" {
#endif

extern int
NC_NCINT_initialize(void);

extern int
NC_NCINT_open(const char *path, int mode, int basepe, size_t *chunksizehintp,
void *parameters, const NC_Dispatch *, NC *);
Expand Down

0 comments on commit 8cd22e5

Please sign in to comment.