diff --git a/src/aiori-DAOS.c b/src/aiori-DAOS.c index c453b2e..969507c 100644 --- a/src/aiori-DAOS.c +++ b/src/aiori-DAOS.c @@ -243,10 +243,8 @@ DAOS_Init(aiori_mod_opt_t * options) if (daos_initialized) return; - if (o->pool == NULL || o->svcl == NULL || o->cont == NULL) { - GERR("Invalid DAOS pool/cont\n"); + if (o->pool == NULL || o->svcl == NULL || o->cont == NULL) return; - } if (o->oclass) { objectClass = daos_oclass_name2id(o->oclass); diff --git a/src/aiori-DFS.c b/src/aiori-DFS.c index 7f8ab7a..86f014c 100755 --- a/src/aiori-DFS.c +++ b/src/aiori-DFS.c @@ -42,6 +42,7 @@ static daos_handle_t poh, coh; static daos_oclass_id_t objectClass = OC_SX; static daos_oclass_id_t dir_oclass = OC_SX; static struct d_hash_table *dir_hash; +static bool dfs_init; struct aiori_dir_hdl { d_list_t entry; @@ -412,8 +413,16 @@ DFS_Init(aiori_mod_opt_t * options) DFS_options_t *o = (DFS_options_t *)options; int rc; + /** in case we are already initialized, return */ + if (dfs_init) + return; + + /** shouldn't be fatal since it can be called with POSIX backend selection */ if (o->pool == NULL || o->svcl == NULL || o->cont == NULL) - ERR("Invalid pool or container options\n"); + return; + + rc = daos_init(); + DCHECK(rc, "Failed to initialize daos"); if (o->oclass) { objectClass = daos_oclass_name2id(o->oclass); @@ -427,9 +436,6 @@ DFS_Init(aiori_mod_opt_t * options) GERR("Invalid DAOS directory object class %s\n", o->dir_oclass); } - rc = daos_init(); - DCHECK(rc, "Failed to initialize daos"); - rc = d_hash_table_create(0, 16, NULL, &hdl_hash_ops, &dir_hash); DCHECK(rc, "Failed to initialize dir hashtable"); @@ -483,6 +489,7 @@ DFS_Init(aiori_mod_opt_t * options) rc = dfs_set_prefix(dfs, o->prefix); DCHECK(rc, "Failed to set DFS Prefix"); } + dfs_init = true; } static void @@ -537,6 +544,20 @@ DFS_Finalize(aiori_mod_opt_t *options) rc = daos_fini(); DCHECK(rc, "Failed to finalize DAOS"); + + /** reset tunables */ + o->pool = NULL; + o->svcl = NULL; + o->group = NULL; + o->cont = NULL; + o->chunk_size = 1048576; + o->oclass = NULL; + o->dir_oclass = NULL; + o->prefix = NULL; + o->destroy = 0; + objectClass = OC_SX; + dir_oclass = OC_SX; + dfs_init = false; } /* diff --git a/src/ior.c b/src/ior.c index 0199f3f..612d602 100755 --- a/src/ior.c +++ b/src/ior.c @@ -1637,6 +1637,8 @@ static void ValidateTests(IOR_param_t * test) && (strcasecmp(test->api, "MPIIO") != 0) && (strcasecmp(test->api, "MMAP") != 0) && (strcasecmp(test->api, "HDFS") != 0) + && (strcasecmp(test->api, "DFS") != 0) + && (strcasecmp(test->api, "DAOS") != 0) && (strcasecmp(test->api, "Gfarm") != 0) && (strcasecmp(test->api, "RADOS") != 0) && (strcasecmp(test->api, "CEPHFS") != 0)) && test->fsync) diff --git a/src/mdtest.c b/src/mdtest.c index 3152f33..5488834 100644 --- a/src/mdtest.c +++ b/src/mdtest.c @@ -627,8 +627,8 @@ void mdtest_read(int random, int dirs, const long dir_iter, char *path) { /* allocate read buffer */ if (read_bytes > 0) { - read_buffer = (char *)malloc(read_bytes); - if (read_buffer == NULL) { + int alloc_res = posix_memalign((void**)&read_buffer, sysconf(_SC_PAGESIZE), read_bytes); + if (alloc_res) { FAIL("out of memory"); } @@ -2125,8 +2125,8 @@ mdtest_results_t * mdtest_run(int argc, char **argv, MPI_Comm world_com, FILE * /* allocate and initialize write buffer with # */ if (write_bytes > 0) { - write_buffer = (char *)malloc(write_bytes); - if (write_buffer == NULL) { + int alloc_res = posix_memalign((void**)&write_buffer, sysconf(_SC_PAGESIZE), write_bytes); + if (alloc_res) { FAIL("out of memory"); } generate_memory_pattern(write_buffer, write_bytes);