From f8d952f9233b3eb8231460dbd2a8b2212d8e3899 Mon Sep 17 00:00:00 2001 From: Neil Fortner Date: Wed, 15 Mar 2017 10:27:10 -0500 Subject: Modify H5VL_daosm_init to simply return success if it has already been called, allowing it to be called multiple times without side effects. --- src/H5VLdaosm.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/H5VLdaosm.c b/src/H5VLdaosm.c index a7343b8..b11e49a 100644 --- a/src/H5VLdaosm.c +++ b/src/H5VLdaosm.c @@ -310,13 +310,13 @@ H5VLdaosm_init(MPI_Comm pool_comm, uuid_t pool_uuid, char *pool_grp) FUNC_ENTER_API(FAIL) + /* Check if already initialized */ + if(H5VL_DAOSM_g >= 0) + HGOTO_DONE(SUCCEED) + /* Initialize daos */ (void)daos_init(); - /* Register the DAOS-M VOL, if it isn't already */ - if(H5VL_daosm_init() < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, FAIL, "unable to initialize FF DAOS-M VOL plugin") - /* Obtain the process rank and size from the communicator attached to the * fapl ID */ MPI_Comm_rank(pool_comm, &pool_rank); @@ -416,6 +416,10 @@ H5VLdaosm_init(MPI_Comm pool_comm, uuid_t pool_uuid, char *pool_grp) HGOTO_ERROR(H5E_VOL, H5E_CANTOPENOBJ, FAIL, "can't get local pool handle: %d", ret) } /* end else */ + /* Register the DAOS-M VOL, if it isn't already */ + if(H5VL_daosm_init() < 0) + HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, FAIL, "unable to initialize FF DAOS-M VOL plugin") + done: H5MM_xfree(gh_buf_dyn); -- cgit v0.12