Skip to content

Commit 2604844

Browse files
committed
Replace fmt with std::format and std::cerr, adjust test suite instantiations with _NOLINT, and correct performance metric computation.
1 parent d9a890f commit 2604844

5 files changed

Lines changed: 7 additions & 9 deletions

File tree

modules/core/perf/include/perf.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class Perf {
102102
pipeline();
103103
}
104104
auto end = perf_attr.current_timer();
105-
perf_results.time_sec = (end - begin) / perf_attr.num_running;
105+
perf_results.time_sec = (end - begin) / static_cast<double>(perf_attr.num_running);
106106
}
107107
};
108108

tasks/common/runners/functional.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
#include <fmt/core.h>
21
#include <gtest/gtest.h>
32
#include <mpi.h>
43
#include <omp.h>
54

65
#include <cstdio>
6+
#include <cstdlib>
77
#include <format>
88
#include <iostream>
99
#include <memory>
@@ -67,7 +67,7 @@ class WorkerTestFailurePrinter : public ::testing::EmptyTestEventListener {
6767
static void PrintProcessRank() {
6868
int rank = -1;
6969
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
70-
fmt::print(" [ PROCESS {} ] ", rank);
70+
std::cerr << std::format(" [ PROCESS {} ] ", rank);
7171
}
7272

7373
std::shared_ptr<::testing::TestEventListener> base_;

tasks/common/runners/performance.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
#include <fmt/core.h>
21
#include <gtest/gtest.h>
32
#include <mpi.h>
43
#include <omp.h>
54

65
#include <cstdio>
6+
#include <cstdlib>
77
#include <format>
88
#include <iostream>
99
#include <memory>
@@ -67,7 +67,7 @@ class WorkerTestFailurePrinter : public ::testing::EmptyTestEventListener {
6767
static void PrintProcessRank() {
6868
int rank = -1;
6969
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
70-
fmt::print(" [ PROCESS {} ] ", rank);
70+
std::cerr << std::format(" [ PROCESS {} ] ", rank);
7171
}
7272

7373
std::shared_ptr<::testing::TestEventListener> base_;

tasks/example_processes/tests/performance/main.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#include <gtest/gtest.h>
22

3-
#include <tuple>
4-
53
#include "core/util/include/perf_test_util.hpp"
64
#include "example_processes/common/include/common.hpp"
75
#include "example_processes/mpi/include/ops_mpi.hpp"
@@ -29,6 +27,6 @@ const auto kGtestValues = ppc::util::TupleToGTestValues(kAllPerfTasks);
2927

3028
const auto kPerfTestName = ExampleRunPerfTestProcesses::CustomPerfTestName;
3129

32-
INSTANTIATE_TEST_SUITE_P(RunModeTests, ExampleRunPerfTestProcesses, kGtestValues, kPerfTestName);
30+
INSTANTIATE_TEST_SUITE_P_NOLINT(RunModeTests, ExampleRunPerfTestProcesses, kGtestValues, kPerfTestName);
3331

3432
} // namespace nesterov_a_test_task_processes

tasks/example_threads/tests/performance/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ const auto kGtestValues = ppc::util::TupleToGTestValues(kAllPerfTasks);
3131

3232
const auto kPerfTestName = ExampleRunPerfTestThreads::CustomPerfTestName;
3333

34-
INSTANTIATE_TEST_SUITE_P(RunModeTests, ExampleRunPerfTestThreads, kGtestValues, kPerfTestName);
34+
INSTANTIATE_TEST_SUITE_P_NOLINT(RunModeTests, ExampleRunPerfTestThreads, kGtestValues, kPerfTestName);
3535

3636
} // namespace nesterov_a_test_task_threads

0 commit comments

Comments
 (0)