diff --git a/Testing/perf/na/na_bw_get.c b/Testing/perf/na/na_bw_get.c index 5e7612ab..0eb4444b 100644 --- a/Testing/perf/na/na_bw_get.c +++ b/Testing/perf/na/na_bw_get.c @@ -35,9 +35,6 @@ na_perf_run(struct na_perf_info *info, size_t buf_size, size_t skip) na_return_t ret; size_t i, j; - if (info->na_test_info.mpi_comm_size > 1) - NA_Test_barrier(&info->na_test_info); - /* Actual benchmark */ for (i = 0; i < skip + (size_t) info->na_test_info.loop; i++) { struct na_perf_rma_info rma_info = {.request = info->request, @@ -96,13 +93,9 @@ na_perf_run(struct na_perf_info *info, size_t buf_size, size_t skip) } } - if (info->na_test_info.mpi_comm_size > 1) - NA_Test_barrier(&info->na_test_info); - hg_time_get_current(&t2); - if (info->na_test_info.mpi_comm_rank == 0) - na_perf_print_bw(info, buf_size, hg_time_subtract(t2, t1)); + na_perf_print_bw(info, buf_size, hg_time_subtract(t2, t1)); return NA_SUCCESS; @@ -129,8 +122,7 @@ main(int argc, char *argv[]) "na_perf_mem_handle_recv() failed (%s)", NA_Error_to_string(na_ret)); /* Header info */ - if (info.na_test_info.mpi_comm_rank == 0) - na_perf_print_header_bw(&info, BENCHMARK_NAME); + na_perf_print_header_bw(&info, BENCHMARK_NAME); /* Msg with different sizes */ for (size = info.rma_size_min; size <= info.rma_size_max; size *= 2) { @@ -142,8 +134,7 @@ main(int argc, char *argv[]) } /* Finalize interface */ - if (info.na_test_info.mpi_comm_rank == 0) - na_perf_send_finalize(&info); + na_perf_send_finalize(&info); na_perf_cleanup(&info); diff --git a/Testing/perf/na/na_bw_put.c b/Testing/perf/na/na_bw_put.c index 7507dd41..479c4a71 100644 --- a/Testing/perf/na/na_bw_put.c +++ b/Testing/perf/na/na_bw_put.c @@ -35,9 +35,6 @@ na_perf_run(struct na_perf_info *info, size_t buf_size, size_t skip) na_return_t ret; size_t i, j; - if (info->na_test_info.mpi_comm_size > 1) - NA_Test_barrier(&info->na_test_info); - /* Actual benchmark */ for (i = 0; i < skip + (size_t) info->na_test_info.loop; i++) { struct na_perf_rma_info rma_info = {.request = info->request, @@ -112,13 +109,9 @@ na_perf_run(struct na_perf_info *info, size_t buf_size, size_t skip) } } - if (info->na_test_info.mpi_comm_size > 1) - NA_Test_barrier(&info->na_test_info); - hg_time_get_current(&t2); - if (info->na_test_info.mpi_comm_rank == 0) - na_perf_print_bw(info, buf_size, hg_time_subtract(t2, t1)); + na_perf_print_bw(info, buf_size, hg_time_subtract(t2, t1)); return NA_SUCCESS; @@ -150,8 +143,7 @@ main(int argc, char *argv[]) "na_perf_mem_handle_recv() failed (%s)", NA_Error_to_string(na_ret)); /* Header info */ - if (info.na_test_info.mpi_comm_rank == 0) - na_perf_print_header_bw(&info, BENCHMARK_NAME); + na_perf_print_header_bw(&info, BENCHMARK_NAME); /* Msg with different sizes */ for (size = info.rma_size_min; size <= info.rma_size_max; size *= 2) { @@ -163,8 +155,7 @@ main(int argc, char *argv[]) } /* Finalize interface */ - if (info.na_test_info.mpi_comm_rank == 0) - na_perf_send_finalize(&info); + na_perf_send_finalize(&info); na_perf_cleanup(&info); diff --git a/Testing/perf/na/na_lat.c b/Testing/perf/na/na_lat.c index 4569064c..b24f1c33 100644 --- a/Testing/perf/na/na_lat.c +++ b/Testing/perf/na/na_lat.c @@ -62,11 +62,8 @@ na_perf_run(struct na_perf_info *info, size_t buf_size, size_t skip) /* Actual benchmark */ for (i = 0; i < skip + (size_t) info->na_test_info.loop; i++) { - if (i == skip) { - if (info->na_test_info.mpi_comm_size > 1) - NA_Test_barrier(&info->na_test_info); + if (i == skip) hg_time_get_current(&t1); - } hg_request_reset(info->request); @@ -105,13 +102,9 @@ na_perf_run(struct na_perf_info *info, size_t buf_size, size_t skip) } } - if (info->na_test_info.mpi_comm_size > 1) - NA_Test_barrier(&info->na_test_info); - hg_time_get_current(&t2); - if (info->na_test_info.mpi_comm_rank == 0) - na_perf_print_lat(info, buf_size, hg_time_subtract(t2, t1)); + na_perf_print_lat(info, buf_size, hg_time_subtract(t2, t1)); return NA_SUCCESS; @@ -135,15 +128,13 @@ main(int argc, char *argv[]) /* Init data */ na_perf_init_data(info.msg_unexp_buf, info.msg_unexp_size_max, info.msg_unexp_header_size); - if (info.na_test_info.mpi_comm_rank == 0) - na_perf_send_init(&info); + na_perf_send_init(&info); min_size = (info.msg_unexp_header_size > 0) ? info.msg_unexp_header_size : 1; /* Header info */ - if (info.na_test_info.mpi_comm_rank == 0) - na_perf_print_header_lat(&info, BENCHMARK_NAME, min_size); + na_perf_print_header_lat(&info, BENCHMARK_NAME, min_size); /* Msg with different sizes */ for (size = min_size; size <= info.msg_unexp_size_max; size *= 2) { @@ -155,8 +146,7 @@ main(int argc, char *argv[]) } /* Finalize interface */ - if (info.na_test_info.mpi_comm_rank == 0) - na_perf_send_finalize(&info); + na_perf_send_finalize(&info); na_perf_cleanup(&info); diff --git a/Testing/perf/na/na_perf.c b/Testing/perf/na/na_perf.c index a27586f9..faf2633f 100644 --- a/Testing/perf/na/na_perf.c +++ b/Testing/perf/na/na_perf.c @@ -130,6 +130,10 @@ na_perf_init(int argc, char *argv[], bool listen, struct na_perf_info *info) error, ret, "NA_Test_init() failed (%s)", NA_Error_to_string(ret)); info->na_class = info->na_test_info.na_class; + /* Parallel is not supported */ + NA_TEST_CHECK_ERROR(info->na_test_info.mpi_comm_size > 1, error, ret, + NA_OPNOTSUPPORTED, "Not a parallel test"); + /* Multi-recv */ multi_recv = (listen && NA_Has_opt_feature(info->na_class, NA_OPT_MULTI_RECV) && @@ -398,10 +402,9 @@ void na_perf_print_lat(const struct na_perf_info *info, size_t buf_size, hg_time_t t) { double msg_lat; - size_t loop = (size_t) info->na_test_info.loop, - mpi_comm_size = (size_t) info->na_test_info.mpi_comm_size; + size_t loop = (size_t) info->na_test_info.loop; - msg_lat = hg_time_to_double(t) * 1e6 / (double) (loop * 2 * mpi_comm_size); + msg_lat = hg_time_to_double(t) * 1e6 / (double) (loop * 2); printf("%-*zu%*.*f\n", 10, buf_size, NWIDTH, NDIGITS, msg_lat); } @@ -432,14 +435,11 @@ void na_perf_print_bw(const struct na_perf_info *info, size_t buf_size, hg_time_t t) { size_t loop = (size_t) info->na_test_info.loop, - mpi_comm_size = (size_t) info->na_test_info.mpi_comm_size, buf_count = (size_t) info->rma_count; double avg_time, avg_bw; - avg_time = hg_time_to_double(t) * 1e6 / - (double) (loop * mpi_comm_size * buf_count); - avg_bw = (double) (buf_size * loop * mpi_comm_size * buf_count) / - hg_time_to_double(t); + avg_time = hg_time_to_double(t) * 1e6 / (double) (loop * buf_count); + avg_bw = (double) (buf_size * loop * buf_count) / hg_time_to_double(t); if (info->na_test_info.mbps) avg_bw /= 1e6; /* MB/s, matches OSU benchmarks */