Skip to content

Commit

Permalink
engines/dfs: add support for 1.3 DAOS API
Browse files Browse the repository at this point in the history
A few changes were done to the pool connect and container open API
in DAOS 1.3+. UUID string or label are now passed via the API
instead of uuid_t structures. Change the dfs engine accordingly.

Signed-off-by: Johann Lombardi <[email protected]>
  • Loading branch information
Johann Lombardi committed Aug 10, 2021
1 parent faff87e commit 2819492
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
4 changes: 2 additions & 2 deletions HOWTO
Original file line number Diff line number Diff line change
Expand Up @@ -2561,11 +2561,11 @@ with the caveat that when used on the command line, they must come after the

.. option:: pool=str : [dfs]

Specify the UUID of the DAOS pool to connect to.
Specify the label or UUID of the DAOS pool to connect to.

.. option:: cont=str : [dfs]

Specify the UUID of the DAOS container to open.
Specify the label or UUID of the DAOS container to open.

.. option:: chunk_size=int : [dfs]

Expand Down
24 changes: 18 additions & 6 deletions engines/dfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,19 @@ struct daos_fio_options {
static struct fio_option options[] = {
{
.name = "pool",
.lname = "pool uuid",
.lname = "pool uuid or label",
.type = FIO_OPT_STR_STORE,
.off1 = offsetof(struct daos_fio_options, pool),
.help = "DAOS pool uuid",
.help = "DAOS pool uuid or label",
.category = FIO_OPT_C_ENGINE,
.group = FIO_OPT_G_DFS,
},
{
.name = "cont",
.lname = "container uuid",
.lname = "container uuid or label",
.type = FIO_OPT_STR_STORE,
.off1 = offsetof(struct daos_fio_options, cont),
.help = "DAOS container uuid",
.help = "DAOS container uuid or label",
.category = FIO_OPT_C_ENGINE,
.group = FIO_OPT_G_DFS,
},
Expand Down Expand Up @@ -103,7 +103,6 @@ static struct fio_option options[] = {
static int daos_fio_global_init(struct thread_data *td)
{
struct daos_fio_options *eo = td->eo;
uuid_t pool_uuid, co_uuid;
daos_pool_info_t pool_info;
daos_cont_info_t co_info;
int rc = 0;
Expand All @@ -124,6 +123,10 @@ static int daos_fio_global_init(struct thread_data *td)
return rc;
}

#if !defined(DAOS_API_VERSION_MAJOR) || \
(DAOS_API_VERSION_MAJOR == 1 && DAOS_API_VERSION_MINOR < 3)
uuid_t pool_uuid, co_uuid;

rc = uuid_parse(eo->pool, pool_uuid);
if (rc) {
log_err("Failed to parse 'Pool uuid': %s\n", eo->pool);
Expand All @@ -137,6 +140,7 @@ static int daos_fio_global_init(struct thread_data *td)
td_verror(td, EINVAL, "uuid_parse(eo->cont)");
return EINVAL;
}
#endif

/* Connect to the DAOS pool */
#if !defined(DAOS_API_VERSION_MAJOR) || DAOS_API_VERSION_MAJOR < 1
Expand All @@ -152,9 +156,12 @@ static int daos_fio_global_init(struct thread_data *td)
rc = daos_pool_connect(pool_uuid, NULL, svcl, DAOS_PC_RW,
&poh, &pool_info, NULL);
d_rank_list_free(svcl);
#else
#elif (DAOS_API_VERSION_MAJOR == 1 && DAOS_API_VERSION_MINOR < 3)
rc = daos_pool_connect(pool_uuid, NULL, DAOS_PC_RW, &poh, &pool_info,
NULL);
#else
rc = daos_pool_connect(eo->pool, NULL, DAOS_PC_RW, &poh, &pool_info,
NULL);
#endif
if (rc) {
log_err("Failed to connect to pool %d\n", rc);
Expand All @@ -163,7 +170,12 @@ static int daos_fio_global_init(struct thread_data *td)
}

/* Open the DAOS container */
#if !defined(DAOS_API_VERSION_MAJOR) || \
(DAOS_API_VERSION_MAJOR == 1 && DAOS_API_VERSION_MINOR < 3)
rc = daos_cont_open(poh, co_uuid, DAOS_COO_RW, &coh, &co_info, NULL);
#else
rc = daos_cont_open(poh, eo->cont, DAOS_COO_RW, &coh, &co_info, NULL);
#endif
if (rc) {
log_err("Failed to open container: %d\n", rc);
td_verror(td, rc, "daos_cont_open");
Expand Down
4 changes: 2 additions & 2 deletions fio.1
Original file line number Diff line number Diff line change
Expand Up @@ -2326,10 +2326,10 @@ the use of cudaMemcpy.
.RE
.TP
.BI (dfs)pool
Specify the UUID of the DAOS pool to connect to.
Specify the label or UUID of the DAOS pool to connect to.
.TP
.BI (dfs)cont
Specify the UUID of the DAOS DAOS container to open.
Specify the label or UUID of the DAOS container to open.
.TP
.BI (dfs)chunk_size
Specificy a different chunk size (in bytes) for the dfs file.
Expand Down

0 comments on commit 2819492

Please sign in to comment.