@@ -13,28 +13,31 @@ struct Tester {
1313 explicit Tester () {
1414 int rank;
1515 MPI_Comm_rank (MPI_COMM_WORLD, &rank);
16- // The threshold for filtering out lines from the stack is 0.1% of the total runtime.
17- // Do a 1s sleep on all ranks, then a 1.5 ms sleep on only rank 1. If the threshold
18- // is applied based on the average time across ranks the second region will be filtered out,
19- // but if it is based on the max time then it will be included (which is the desired behavior
20- // so that we see things which are slow only on a subset of ranks in cases like a coarse solve
21- // in a multigrid method that only runs on a subset of the ranks).
16+ // The threshold for filtering out lines from the stack is 0.1% of the total
17+ // runtime. Do a 1s sleep on all ranks, then a 1.5 ms sleep on only rank 1.
18+ // If the threshold is applied based on the average time across ranks the
19+ // second region will be filtered out, but if it is based on the max time
20+ // then it will be included (which is the desired behavior so that we see
21+ // things which are slow only on a subset of ranks in cases like a coarse
22+ // solve in a multigrid method that only runs on a subset of the ranks).
2223 {
2324 Kokkos::Profiling::ScopedRegion all_ranks_region (" all_ranks_region" );
2425 std::this_thread::sleep_for (std::chrono::seconds (1 ));
2526 }
2627 {
2728 Kokkos::Profiling::ScopedRegion rank_1_region (" rank_1_region" );
28- if (rank == 1 ) {
29+ if (rank == 1 ) {
2930 std::this_thread::sleep_for (std::chrono::microseconds (1500 ));
3031 }
3132 }
3233 }
3334};
3435
3536static const std::vector<std::string> matchers{
36- " [0-9.e]+ sec [0-9.]+% [0-9.]+% 0.[0-9]+% 100.0% 0.00e\\ +00 1 all_ranks_region \\ [region\\ ]" ,
37- " [0-9.e]+ sec [0-9.]+% [0-9.]+% [1-9][0-9.]+% 100.0% 0.00e\\ +00 1 rank_1_region \\ [region\\ ]" ,
37+ " [0-9.e]+ sec [0-9.]+% [0-9.]+% 0.[0-9]+% 100.0% 0.00e\\ +00 1 "
38+ " all_ranks_region \\ [region\\ ]" ,
39+ " [0-9.e]+ sec [0-9.]+% [0-9.]+% [1-9][0-9.]+% 100.0% 0.00e\\ +00 1 "
40+ " rank_1_region \\ [region\\ ]" ,
3841};
3942
4043/* *
@@ -68,7 +71,7 @@ TEST(SpaceTimeStackTest, threshold_with_imbalance) {
6871 int rank;
6972 MPI_Comm_rank (MPI_COMM_WORLD, &rank);
7073 // ! Analyze test output.
71- if (rank == 0 ) {
74+ if (rank == 0 ) {
7275 for (const auto & matcher : matchers) {
7376 EXPECT_THAT (output.str (), ::testing::ContainsRegex (matcher));
7477 }
0 commit comments