Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DAOS-16935 cart: add D_MEM_DEVICE and cio_mem_device init option #15937

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/cart/README.env
Original file line number Diff line number Diff line change
Expand Up @@ -217,3 +217,8 @@ This file lists the environment variables used in CaRT.
D_PROGRESS_BUSY
Force busy polling when progressing, preventing from sleeping when waiting for
new messages.

D_MEM_DEVICE
Enable detection and use of memory devices (GPU, etc) to perform RMA transfers to/from.
Be wary of potential performance impacts if this variable is set and memory devices
are not used.
1 change: 1 addition & 0 deletions src/cart/crt_hg.c
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,7 @@ crt_hg_class_init(crt_provider_t provider, int ctx_idx, bool primary, int iface_
init_info.traffic_class = (enum na_traffic_class)crt_gdata.cg_swim_tc;
if (thread_mode_single)
init_info.na_init_info.thread_mode = NA_THREAD_MODE_SINGLE;
init_info.na_init_info.request_mem_device = prov_data->cpg_mem_device;
retry:
hg_class = HG_Init_opt2(info_string, crt_is_service(), HG_VERSION(2, 4), &init_info);
if (hg_class == NULL) {
Expand Down
10 changes: 10 additions & 0 deletions src/cart/crt_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ dump_opt(crt_init_options_t *opt)
D_INFO("thread mode single is set\n");
if (opt->cio_progress_busy)
D_INFO("progress busy mode is set\n");
if (opt->cio_mem_device)
D_INFO("memory device mode is set\n");
Comment on lines 96 to +100
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those should be probably printed on line 88. we print auth key separately due to security concerns

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was trying to understand what you were asking but I still don't get it, can you please look at it again ? I don't think that makes any sense...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see above, we print all other boolean flags as: fi: %d, use_credits: %d, use_esnsors: %d\n", opt->cio_fault_inject,
opt->cio_use_credits, opt->cio_use_sensors);

'auth_key' is really the only one that is supposed to be handled differently, but for some reason we started printing all flags after that similar to auth-key

}

static int
Expand Down Expand Up @@ -209,6 +211,14 @@ prov_data_init(struct crt_prov_gdata *prov_data, crt_provider_t provider, bool p
prov_data->cpg_progress_busy = progress_busy;
}

if (opt && opt->cio_mem_device) {
prov_data->cpg_mem_device = opt->cio_mem_device;
} else {
bool mem_device = false;
crt_env_get(D_MEM_DEVICE, &mem_device);
prov_data->cpg_mem_device = mem_device;
}

for (i = 0; i < CRT_SRV_CONTEXT_NUM; i++)
prov_data->cpg_used_idx[i] = false;

Expand Down
2 changes: 2 additions & 0 deletions src/cart/crt_internal_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ struct crt_prov_gdata {
bool cpg_contig_ports;
bool cpg_inited;
bool cpg_progress_busy;
bool cpg_mem_device;

/** Mutext to protect fields above */
pthread_mutex_t cpg_mutex;
Expand Down Expand Up @@ -227,6 +228,7 @@ struct crt_event_cb_priv {
ENV(D_PORT_AUTO_ADJUST) \
ENV(D_THREAD_MODE_SINGLE) \
ENV(D_PROGRESS_BUSY) \
ENV(D_MEM_DEVICE) \
ENV(D_POST_INCR) \
ENV(D_POST_INIT) \
ENV(D_MRECV_BUF) \
Expand Down
3 changes: 3 additions & 0 deletions src/include/cart/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ typedef struct crt_init_options {

/** force busy wait (testing only, not in production) */
bool cio_progress_busy;

/** use memory device */
bool cio_mem_device;
} crt_init_options_t;

typedef int crt_status_t;
Expand Down
Loading