Skip to content

Commit

Permalink
Merge pull request #226 from mchaarawi/master
Browse files Browse the repository at this point in the history
DFS: allow multiple IO phases when ior_run() is called
  • Loading branch information
JulianKunkel committed Jun 1, 2020
2 parents 2de4210 + 3623f3b commit a369d94
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 7 deletions.
4 changes: 1 addition & 3 deletions src/aiori-DAOS.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
29 changes: 25 additions & 4 deletions src/aiori-DFS.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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");

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
}

/*
Expand Down
2 changes: 2 additions & 0 deletions src/ior.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a369d94

Please sign in to comment.