Skip to content

Commit

Permalink
HG test: add -u option to control number of multi-recv ops
Browse files Browse the repository at this point in the history
Add -i option to control number of handles posted
  • Loading branch information
soumagne committed Jun 20, 2024
1 parent fc94e91 commit fd74d44
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
14 changes: 14 additions & 0 deletions Testing/common/mercury_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ hg_test_usage(const char *execname)
printf(" -m, --memory Use shared-memory with local targets\n");
printf(" -t, --threads Number of server threads\n");
printf(" -B, --bidirectional Bidirectional communication\n");
printf(" -u, --mrecv-ops Number of multi-recv ops (server only)\n");
printf(" -i, --post-init Number of handles posted (server only)\n");
}

/*---------------------------------------------------------------------------*/
Expand Down Expand Up @@ -100,6 +102,14 @@ hg_test_parse_options(int argc, char *argv[], struct hg_test_info *hg_test_info)
case 'B': /* bidirectional */
hg_test_info->bidirectional = HG_TRUE;
break;
case 'u': /* multi_recv_op_max */
hg_test_info->multi_recv_op_max =
(unsigned int) atoi(na_test_opt_arg_g);
break;
case 'i': /* request_post_init */
hg_test_info->request_post_init =
(unsigned int) atoi(na_test_opt_arg_g);
break;
default:
break;
}
Expand Down Expand Up @@ -214,6 +224,10 @@ HG_Test_init(int argc, char *argv[], struct hg_test_info *hg_test_info)

/* Multi-recv */
hg_init_info.no_multi_recv = hg_test_info->na_test_info.no_multi_recv;
hg_init_info.multi_recv_op_max = hg_test_info->multi_recv_op_max;

/* Post init */
hg_init_info.request_post_init = hg_test_info->request_post_init;

/* Init HG with init options */
hg_test_info->hg_classes[i] =
Expand Down
2 changes: 2 additions & 0 deletions Testing/common/mercury_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ struct hg_test_info {
hg_class_t **hg_classes; /* Array of HG classes */
unsigned int handle_max; /* Max number of handles in-flight */
unsigned int thread_count; /* Max number of threads */
unsigned int multi_recv_op_max; /* Max number of multi-recv ops */
unsigned int request_post_init; /* Init number of posted handles */
hg_bool_t auto_sm; /* Use shared-memory */
hg_bool_t bidirectional; /* Bidirectional tests */
};
Expand Down
4 changes: 3 additions & 1 deletion Testing/common/na_test_getopt.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
int na_test_opt_ind_g = 1; /* token pointer */
const char *na_test_opt_arg_g = NULL; /* flag argument (or value) */
const char *na_test_short_opt_g =
"hc:d:p:H:P:sSk:l:bC:X:VZ:y:z:w:x:mt:BRvMUf:T:";
"hc:d:p:H:P:sSk:l:bC:X:VZ:y:z:w:x:mt:BRvMUf:T:u:i:";
/* clang-format off */
const struct na_test_opt na_test_opt_g[] = {
{"help", no_arg, 'h'},
Expand Down Expand Up @@ -46,6 +46,8 @@ const struct na_test_opt na_test_opt_g[] = {
{"no-multi-recv", no_arg, 'U'},
{"hostfile", require_arg, 'f'},
{"tclass", require_arg, 'T'},
{"mrecv-ops", require_arg, 'u'},
{"post-init", require_arg, 'i'},
{NULL, 0, '\0'} /* Must add this at the end */
};
/* clang-format on */
Expand Down

0 comments on commit fd74d44

Please sign in to comment.