Skip to content

Commit

Permalink
functional/multi_recv: add opts.min_multi_recv_size to set opt before…
Browse files Browse the repository at this point in the history
… enable

fi_setopt has to be called before enabling an endpoint. This adds an opt arg
to allow setting this option in the common code like the other EP options.

Signed-off-by: Alexia Ingerson <[email protected]>
  • Loading branch information
aingerson committed Dec 10, 2024
1 parent 90563bd commit cd281a1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
12 changes: 11 additions & 1 deletion fabtests/common/shared.c
Original file line number Diff line number Diff line change
Expand Up @@ -1463,7 +1463,8 @@ int ft_enable_ep(struct fid_ep *bind_ep, struct fid_eq *bind_eq, struct fid_av *
}

if (opts.max_msg_size) {
ret = fi_setopt(&bind_ep->fid, FI_OPT_ENDPOINT, FI_OPT_MAX_MSG_SIZE, &opts.max_msg_size, sizeof opts.max_msg_size);
ret = fi_setopt(&bind_ep->fid, FI_OPT_ENDPOINT, FI_OPT_MAX_MSG_SIZE,
&opts.max_msg_size, sizeof opts.max_msg_size);
if (ret && ret != -FI_EOPNOTSUPP) {
FT_PRINTERR("fi_setopt(FI_OPT_MAX_MSG_SIZE)", ret);
return ret;
Expand All @@ -1485,6 +1486,15 @@ int ft_enable_ep(struct fid_ep *bind_ep, struct fid_eq *bind_eq, struct fid_av *
}
}

if (opts.min_multi_recv_size) {
ret = fi_setopt(&bind_ep->fid, FI_OPT_ENDPOINT, FI_OPT_MIN_MULTI_RECV,
&opts.min_multi_recv_size, sizeof opts.min_multi_recv_size);
if (ret && ret != -FI_EOPNOTSUPP) {
FT_PRINTERR("fi_setopt(FI_OPT_MIN_MULTI_RECV_SIZE)", ret);
return ret;
}
}

ret = fi_enable(bind_ep);
if (ret) {
FT_PRINTERR("fi_enable", ret);
Expand Down
6 changes: 1 addition & 5 deletions fabtests/functional/multi_recv.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,11 +263,6 @@ static int run(void)
if (ret)
return ret;

ret = fi_setopt(&ep->fid, FI_OPT_ENDPOINT, FI_OPT_MIN_MULTI_RECV,
&tx_size, sizeof(tx_size));
if (ret)
return ret;

ret = post_multi_recv_buffer();
if (ret)
return ret;
Expand Down Expand Up @@ -327,6 +322,7 @@ int main(int argc, char **argv)
return EIO;
}

opts.min_multi_recv_size = opts.transfer_size;
hints->caps = FI_MSG | FI_MULTI_RECV;
hints->mode = FI_CONTEXT;
hints->domain_attr->mr_mode = opts.mr_mode;
Expand Down
1 change: 1 addition & 0 deletions fabtests/include/shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ struct ft_opts {
size_t transfer_size;
size_t max_msg_size;
size_t inject_size;
size_t min_multi_recv_size;
int window_size;
int av_size;
int verbose;
Expand Down

0 comments on commit cd281a1

Please sign in to comment.