DFS: allow multiple IO phases when ior_run() is called

- init/fini can be made multiple times
- reset tunables on fini so they can change on a re-init

Signed-off-by: Mohamad Chaarawi <mohamad.chaarawi@intel.com>
master
Mohamad Chaarawi 2020-05-31 16:20:58 +00:00
parent 2de4210311
commit 3623f3b8bd
3 changed files with 28 additions and 7 deletions

View File

@ -216,10 +216,8 @@ DAOS_Init()
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);

View File

@ -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;
@ -386,8 +387,16 @@ static void
DFS_Init() {
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);
@ -401,9 +410,6 @@ DFS_Init() {
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");
@ -457,6 +463,7 @@ DFS_Init() {
rc = dfs_set_prefix(dfs, o.prefix);
DCHECK(rc, "Failed to set DFS Prefix");
}
dfs_init = true;
}
static void
@ -510,6 +517,20 @@ DFS_Finalize()
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;
}
/*

View File

@ -1625,6 +1625,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)