Skip to content

Commit

Permalink
TEST/PERF: convert stack allocation to heap
Browse files Browse the repository at this point in the history
  • Loading branch information
michal-shalev committed Jun 30, 2024
1 parent 0d09d45 commit 21e1828
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 6 deletions.
48 changes: 43 additions & 5 deletions src/tools/perf/lib/ucp_tests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1033,7 +1033,7 @@ class ucp_perf_test_runner {
#define TEST_CASE_ALL_AM(_perf, _case) \
TEST_CASE(_perf, UCS_PP_TUPLE_0 _case, UCS_PP_TUPLE_1 _case, 0, 0)

ucs_status_t ucp_perf_test_dispatch(ucx_perf_context_t *perf)
static ucs_status_t dispatch_osd(ucx_perf_context_t *perf)
{
UCS_PP_FOREACH(TEST_CASE_ALL_OSD, perf,
(UCX_PERF_CMD_PUT, UCX_PERF_TEST_TYPE_PINGPONG),
Expand All @@ -1044,24 +1044,62 @@ ucs_status_t ucp_perf_test_dispatch(ucx_perf_context_t *perf)
(UCX_PERF_CMD_FADD, UCX_PERF_TEST_TYPE_STREAM_UNI),
(UCX_PERF_CMD_SWAP, UCX_PERF_TEST_TYPE_STREAM_UNI),
(UCX_PERF_CMD_CSWAP, UCX_PERF_TEST_TYPE_STREAM_UNI)
);
);
return UCS_ERR_INVALID_PARAM;
}

static ucs_status_t dispatch_tag(ucx_perf_context_t *perf)
{
UCS_PP_FOREACH(TEST_CASE_ALL_TAG, perf,
(UCX_PERF_CMD_TAG, UCX_PERF_TEST_TYPE_PINGPONG),
(UCX_PERF_CMD_TAG, UCX_PERF_TEST_TYPE_STREAM_UNI),
(UCX_PERF_CMD_TAG_SYNC, UCX_PERF_TEST_TYPE_PINGPONG),
(UCX_PERF_CMD_TAG_SYNC, UCX_PERF_TEST_TYPE_STREAM_UNI)
);
);
return UCS_ERR_INVALID_PARAM;
}

static ucs_status_t dispatch_stream(ucx_perf_context_t *perf)
{
UCS_PP_FOREACH(TEST_CASE_ALL_STREAM, perf,
(UCX_PERF_CMD_STREAM, UCX_PERF_TEST_TYPE_STREAM_UNI),
(UCX_PERF_CMD_STREAM, UCX_PERF_TEST_TYPE_PINGPONG)
);
);
return UCS_ERR_INVALID_PARAM;
}

static ucs_status_t dispatch_am(ucx_perf_context_t *perf)
{
UCS_PP_FOREACH(TEST_CASE_ALL_AM, perf,
(UCX_PERF_CMD_AM, UCX_PERF_TEST_TYPE_PINGPONG),
(UCX_PERF_CMD_AM, UCX_PERF_TEST_TYPE_STREAM_UNI)
);
);
return UCS_ERR_INVALID_PARAM;
}

ucs_status_t ucp_perf_test_dispatch(ucx_perf_context_t *perf)
{
ucs_status_t status;

status = dispatch_osd(perf);
if (status != UCS_ERR_INVALID_PARAM) {
return status;
}

status = dispatch_tag(perf);
if (status != UCS_ERR_INVALID_PARAM) {
return status;
}

status = dispatch_stream(perf);
if (status != UCS_ERR_INVALID_PARAM) {
return status;
}

status = dispatch_am(perf);
if (status != UCS_ERR_INVALID_PARAM) {
return status;
}

ucs_error("Invalid test case: %d/%d/0x%x",
perf->params.command, perf->params.test_type,
Expand Down
2 changes: 1 addition & 1 deletion src/tools/perf/lib/uct_tests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ class uct_perf_test_runner {
TEST_CASE_ALL_OSD(_perf, _case, UCT_PERF_DATA_LAYOUT_BCOPY) \
TEST_CASE_ALL_OSD(_perf, _case, UCT_PERF_DATA_LAYOUT_ZCOPY)

ucs_status_t uct_perf_test_dispatch(ucx_perf_context_t *perf)
ucs_status_t __attribute__ ((optimize("O1"))) uct_perf_test_dispatch(ucx_perf_context_t *perf)
{
UCS_PP_FOREACH(TEST_CASE_ALL_DATA, perf,
(UCX_PERF_CMD_AM, UCX_PERF_TEST_TYPE_PINGPONG),
Expand Down

0 comments on commit 21e1828

Please sign in to comment.