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-13883 cart: control request_post_init/incr through env vars #12565

Merged
merged 6 commits into from
Nov 30, 2023
Merged
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
3 changes: 3 additions & 0 deletions src/cart/crt_hg.c
Original file line number Diff line number Diff line change
Expand Up @@ -885,6 +885,9 @@ crt_hg_class_init(int provider, int idx, bool primary, hg_class_t **ret_hg_class
if (prov_data->cpg_max_unexp_size > 0)
init_info.na_init_info.max_unexpected_size = prov_data->cpg_max_unexp_size;

init_info.request_post_init = crt_gdata.cg_post_init;
init_info.request_post_incr = crt_gdata.cg_post_incr;

hg_class = HG_Init_opt(info_string, crt_is_service(), &init_info);
if (hg_class == NULL) {
D_ERROR("Could not initialize HG class.\n");
Expand Down
4 changes: 4 additions & 0 deletions src/cart/crt_hg.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
/** number of prepost HG handles when enable pool */
#define CRT_HG_POOL_PREPOST_NUM (16)

/** default values for init / incr to prepost handles */
#define CRT_HG_POST_INIT (512)
#define CRT_HG_POST_INCR (512)

struct crt_rpc_priv;
struct crt_common_hdr;
struct crt_corpc_hdr;
Expand Down
15 changes: 10 additions & 5 deletions src/cart/crt_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ dump_envariables(void)
"D_PORT_AUTO_ADJUST",
"D_POLL_TIMEOUT",
"D_LOG_FILE_APPEND_RANK",
"D_POST_INIT",
"D_POST_INCR",
"DAOS_SIGNAL_REGISTER"};

D_INFO("-- ENVARS: --\n");
Expand Down Expand Up @@ -258,12 +260,13 @@ prov_data_init(struct crt_prov_gdata *prov_data, crt_provider_t provider,
/* first step init - for initializing crt_gdata */
static int data_init(int server, crt_init_options_t *opt)
{
uint32_t timeout;
uint32_t timeout = 0;
uint32_t credits;
uint32_t fi_univ_size = 0;
uint32_t mem_pin_enable = 0;
uint32_t is_secondary;
char ucx_ib_fork_init = 0;
uint32_t post_init = CRT_HG_POST_INIT, post_incr = CRT_HG_POST_INCR;
int rc = 0;

D_DEBUG(DB_ALL, "initializing crt_gdata...\n");
Expand All @@ -273,6 +276,12 @@ static int data_init(int server, crt_init_options_t *opt)
D_DEBUG(DB_ALL, "Starting RPCID %#lx. Num cores: %ld\n",
crt_gdata.cg_rpcid, crt_gdata.cg_num_cores);

/* Set context post init / post incr to tune number of pre-posted recvs */
d_getenv_int("D_POST_INIT", &post_init);
crt_gdata.cg_post_init = post_init;
d_getenv_int("D_POST_INCR", &post_incr);
crt_gdata.cg_post_incr = post_incr;

liw marked this conversation as resolved.
Show resolved Hide resolved
soumagne marked this conversation as resolved.
Show resolved Hide resolved
is_secondary = 0;
/* Apply CART-890 workaround for server side only */
if (server) {
Expand All @@ -285,13 +294,9 @@ static int data_init(int server, crt_init_options_t *opt)
* is running using a secondary provider
*/
d_getenv_int("CRT_SECONDARY_PROVIDER", &is_secondary);

}

crt_gdata.cg_provider_is_primary = (is_secondary) ? 0 : 1;

timeout = 0;

if (opt && opt->cio_crt_timeout != 0)
timeout = opt->cio_crt_timeout;
else
Expand Down
4 changes: 4 additions & 0 deletions src/cart/crt_internal_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ struct crt_gdata {
/** */
struct crt_prov_gdata *cg_prov_gdata_secondary;

/** Hints to mercury for request post init (ignored for clients) */
uint32_t cg_post_init;
uint32_t cg_post_incr;

/** global timeout value (second) for all RPCs */
uint32_t cg_timeout;

Expand Down