Skip to content

Commit

Permalink
fabtests: remove deprecated MR modes
Browse files Browse the repository at this point in the history
FI_MR_BASIC, FI_MR_SCALABLE, and FI_LOCAL_MR are deprecated in 2.0

Remove references to and tests targeting deprecated MR modes
Add OFI_MR_DEPRECATED to resolve some compile warnings

Signed-off-by: Alexia Ingerson <alexia.ingerson@intel.com>
  • Loading branch information
aingerson authored and j-xiong committed Sep 13, 2024
1 parent 513dba0 commit c3a2c67
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 89 deletions.
2 changes: 1 addition & 1 deletion fabtests/common/check_hmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ int main(int argc, char** argv)
return EXIT_FAILURE;
hints->mode = ~0;
hints->domain_attr->mode = ~0;
hints->domain_attr->mr_mode = ~(FI_MR_BASIC | FI_MR_SCALABLE);
hints->domain_attr->mr_mode = ~OFI_MR_DEPRECATED;
while ((op = getopt(argc, argv, "p:h")) != -1) {
switch (op) {
case 'p':
Expand Down
16 changes: 3 additions & 13 deletions fabtests/common/shared.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,16 +276,10 @@ static inline int ft_rma_write_target_allowed(uint64_t caps)
return 0;
}

static inline int ft_check_mr_local_flag(struct fi_info *info)
{
return ((info->mode & FI_LOCAL_MR) ||
(info->domain_attr->mr_mode & FI_MR_LOCAL));
}

uint64_t ft_info_to_mr_access(struct fi_info *info)
{
uint64_t mr_access = 0;
if (ft_check_mr_local_flag(info)) {
if (info->domain_attr->mr_mode & FI_MR_LOCAL) {
if (info->caps & (FI_MSG | FI_TAGGED)) {
if (info->caps & FT_MSG_MR_ACCESS) {
mr_access |= info->caps & FT_MSG_MR_ACCESS;
Expand Down Expand Up @@ -1734,12 +1728,8 @@ int ft_exchange_keys(struct fi_rma_iov *peer_iov)
len = sizeof(*rma_iov);
}

if ((fi->domain_attr->mr_mode == FI_MR_BASIC) ||
(fi->domain_attr->mr_mode & FI_MR_VIRT_ADDR)) {
rma_iov->addr = (uintptr_t) rx_buf + ft_rx_prefix_size();
} else {
rma_iov->addr = 0;
}
rma_iov->addr = fi->domain_attr->mr_mode & FI_MR_VIRT_ADDR ?
(uintptr_t) rx_buf + ft_rx_prefix_size() : 0;

if (fi->domain_attr->mr_mode & FI_MR_RAW) {
ret = fi_mr_raw_attr(mr, &addr, (uint8_t *) &rma_iov->key,
Expand Down
4 changes: 1 addition & 3 deletions fabtests/functional/rdm_atomic.c
Original file line number Diff line number Diff line change
Expand Up @@ -376,9 +376,7 @@ static uint64_t get_mr_key()
{
static uint64_t user_key = FT_MR_KEY + 1;

return ((fi->domain_attr->mr_mode == FI_MR_BASIC) ||
(fi->domain_attr->mr_mode & FI_MR_PROV_KEY)) ?
0 : user_key++;
return fi->domain_attr->mr_mode & FI_MR_PROV_KEY ? 0 : user_key++;
}

static int alloc_ep_res(struct fi_info *fi)
Expand Down
5 changes: 5 additions & 0 deletions fabtests/include/shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ extern "C" {
((type *) ((char *)ptr - offsetof(type, field)))
#endif

/*
* Internal version of deprecated APIs.
* These are used internally to avoid compiler warnings.
*/
#define OFI_MR_DEPRECATED (0x3) /* FI_MR_BASIC | FI_MR_SCALABLE */
#define OFI_MR_BASIC_MAP (FI_MR_ALLOCATED | FI_MR_PROV_KEY | FI_MR_VIRT_ADDR)

/* exit codes must be 0-255 */
Expand Down
2 changes: 1 addition & 1 deletion fabtests/unit/av_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ int main(int argc, char **argv)

hints->mode = ~0;
hints->domain_attr->mode = ~0;
hints->domain_attr->mr_mode = ~(FI_MR_BASIC | FI_MR_SCALABLE);
hints->domain_attr->mr_mode = ~OFI_MR_DEPRECATED;
hints->addr_format = FI_SOCKADDR;

ret = fi_getinfo(FT_FIVERSION, opts.src_addr, 0, FI_SOURCE, hints, &fi);
Expand Down
2 changes: 1 addition & 1 deletion fabtests/unit/cntr_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ int main(int argc, char **argv)

hints->mode = ~0;
hints->domain_attr->mode = ~0;
hints->domain_attr->mr_mode = ~(FI_MR_BASIC | FI_MR_SCALABLE);
hints->domain_attr->mr_mode = ~OFI_MR_DEPRECATED;

ret = fi_getinfo(FT_FIVERSION, NULL, 0, 0, hints, &fi);
if (ret) {
Expand Down
2 changes: 1 addition & 1 deletion fabtests/unit/cq_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ int main(int argc, char **argv)

hints->mode = ~0;
hints->domain_attr->mode = ~0;
hints->domain_attr->mr_mode = ~(FI_MR_BASIC | FI_MR_SCALABLE);
hints->domain_attr->mr_mode = ~OFI_MR_DEPRECATED;

ret = fi_getinfo(FT_FIVERSION, NULL, 0, 0, hints, &fi);
if (ret) {
Expand Down
2 changes: 1 addition & 1 deletion fabtests/unit/dom_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ int main(int argc, char **argv)

hints->mode = ~0;
hints->domain_attr->mode = ~0;
hints->domain_attr->mr_mode = ~(FI_MR_BASIC | FI_MR_SCALABLE);
hints->domain_attr->mr_mode = ~OFI_MR_DEPRECATED;

ret = fi_getinfo(FT_FIVERSION, NULL, 0, 0, hints, &fi);
if (ret) {
Expand Down
2 changes: 1 addition & 1 deletion fabtests/unit/eq_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ int main(int argc, char **argv)

hints->mode = FI_CONTEXT | FI_CONTEXT2 | FI_MSG_PREFIX | FI_ASYNC_IOV |
FI_RX_CQ_DATA;
hints->domain_attr->mr_mode = ~(FI_MR_BASIC | FI_MR_SCALABLE);
hints->domain_attr->mr_mode = ~OFI_MR_DEPRECATED;

ret = fi_getinfo(FT_FIVERSION, NULL, 0, 0, hints, &fi);
if (ret) {
Expand Down
65 changes: 1 addition & 64 deletions fabtests/unit/getinfo_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -538,53 +538,6 @@ static int init_invalid_rma_WAW_ordering_size(struct fi_info *hints)
/*
* MR mode checks
*/
static int init_mr_basic(struct fi_info *hints)
{
hints->caps |= FI_RMA;
hints->domain_attr->mr_mode = FI_MR_BASIC;
return 0;
}

static int check_mr_basic(struct fi_info *info)
{
return (info->domain_attr->mr_mode != FI_MR_BASIC) ?
EXIT_FAILURE : 0;
}

static int init_mr_scalable(struct fi_info *hints)
{
hints->caps |= FI_RMA;
hints->domain_attr->mr_mode = FI_MR_SCALABLE;
return 0;
}

static int check_mr_scalable(struct fi_info *info)
{
return (info->domain_attr->mr_mode != FI_MR_SCALABLE) ?
EXIT_FAILURE : 0;
}

static int init_mr_unspec(struct fi_info *hints)
{
hints->caps |= FI_RMA;
hints->domain_attr->mr_mode = FI_MR_UNSPEC;
return 0;
}

static int test_mr_v1_0(char *node, char *service, uint64_t flags,
struct fi_info *test_hints, struct fi_info **info)
{
return fi_getinfo(FI_VERSION(1, 0), node, service, flags,
test_hints, info);
}

static int check_mr_unspec(struct fi_info *info)
{
return (info->domain_attr->mr_mode != FI_MR_BASIC &&
info->domain_attr->mr_mode != FI_MR_SCALABLE) ?
EXIT_FAILURE : 0;
}

static int init_mr_mode(struct fi_info *hints, uint64_t mode)
{
hints->domain_attr->mr_mode = (uint32_t) mode;
Expand Down Expand Up @@ -906,18 +859,7 @@ getinfo_test(bad_waw_ordering, 1, "Test invalid rma WAW ordering size",
NULL, NULL, -FI_ENODATA)

/* MR mode tests */
getinfo_test(mr_mode, 1, "Test FI_MR_BASIC", NULL, NULL, 0,
hints, init_mr_basic, NULL, check_mr_basic, -FI_ENODATA)
getinfo_test(mr_mode, 2, "Test FI_MR_SCALABLE", NULL, NULL, 0,
hints, init_mr_scalable, NULL, check_mr_scalable, -FI_ENODATA)
getinfo_test(mr_mode, 3, "Test FI_MR_UNSPEC (v1.0)", NULL, NULL, 0,
hints, init_mr_unspec, test_mr_v1_0, check_mr_unspec, -FI_ENODATA)
getinfo_test(mr_mode, 4, "Test FI_MR_BASIC (v1.0)", NULL, NULL, 0,
hints, init_mr_basic, test_mr_v1_0, check_mr_basic, -FI_ENODATA)
getinfo_test(mr_mode, 5, "Test FI_MR_SCALABLE (v1.0)", NULL, NULL, 0,
hints, init_mr_scalable, test_mr_v1_0, check_mr_scalable,
-FI_ENODATA)
getinfo_test(mr_mode, 6, "Test mr_mode bits", NULL, NULL, 0,
getinfo_test(mr_mode, 1, "Test mr_mode bits", NULL, NULL, 0,
hints, NULL, validate_mr_modes, NULL, 0)

/* Progress tests */
Expand Down Expand Up @@ -1008,11 +950,6 @@ int main(int argc, char **argv)
TEST_ENTRY_GETINFO(bad_waw_ordering1),
TEST_ENTRY_GETINFO(neg1),
TEST_ENTRY_GETINFO(mr_mode1),
TEST_ENTRY_GETINFO(mr_mode2),
TEST_ENTRY_GETINFO(mr_mode3),
TEST_ENTRY_GETINFO(mr_mode4),
TEST_ENTRY_GETINFO(mr_mode5),
TEST_ENTRY_GETINFO(mr_mode6),
TEST_ENTRY_GETINFO(progress1),
TEST_ENTRY_GETINFO(progress2),
TEST_ENTRY_GETINFO(caps1),
Expand Down
2 changes: 1 addition & 1 deletion fabtests/unit/mr_cache_evict.c
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ int main(int argc, char **argv)

hints->mode = ~0;
hints->domain_attr->mode = ~0;
hints->domain_attr->mr_mode = ~(FI_MR_BASIC | FI_MR_SCALABLE);
hints->domain_attr->mr_mode = ~OFI_MR_DEPRECATED;
hints->caps |= FI_MSG | FI_RMA;

if (opts.options & FT_OPT_ENABLE_HMEM)
Expand Down
2 changes: 1 addition & 1 deletion fabtests/unit/mr_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ int main(int argc, char **argv)

hints->mode = ~0;
hints->domain_attr->mode = ~0;
hints->domain_attr->mr_mode = ~(FI_MR_BASIC | FI_MR_SCALABLE | FI_MR_LOCAL);
hints->domain_attr->mr_mode = ~OFI_MR_DEPRECATED;

hints->caps |= FI_MSG | FI_RMA;
if (opts.options & FT_OPT_ENABLE_HMEM)
Expand Down
2 changes: 1 addition & 1 deletion fabtests/unit/setopt_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ int main(int argc, char **argv)

hints->mode = ~0;
hints->domain_attr->mode = ~0;
hints->domain_attr->mr_mode = ~(FI_MR_BASIC | FI_MR_SCALABLE);
hints->domain_attr->mr_mode = ~OFI_MR_DEPRECATED;
hints->caps |= FI_MSG;

failed = run_tests(test_array, err_buf);
Expand Down

0 comments on commit c3a2c67

Please sign in to comment.