Skip to content

Commit 8bda7db

Browse files
committed
fix scripts
1 parent 4bea910 commit 8bda7db

File tree

4 files changed

+21
-9
lines changed

4 files changed

+21
-9
lines changed

scripts/create_perf_table.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,10 @@
8383
continue
8484
par_time = result_tables[table_name][task_name][type_of_task]
8585
seq_time = result_tables[table_name][task_name]["seq"]
86-
speed_up = seq_time / par_time
86+
if par_time == 0:
87+
speed_up = -1
88+
else:
89+
speed_up = seq_time / par_time
8790
efficiency = speed_up / cpu_num
8891
worksheet.write(it_j, it_i, par_time)
8992
it_i += 1

scripts/run_perf_collector.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
if [[ -z "$ASAN_RUN" ]]; then
44
if [[ $OSTYPE == "linux-gnu" ]]; then
5-
mpirun --oversubscribe -np 4 ./build/bin/all_perf_tests
6-
mpirun --oversubscribe -np 4 ./build/bin/mpi_perf_tests
5+
mpirun -np 4 ./build/bin/all_perf_tests --gtest_color=no
6+
mpirun -np 4 ./build/bin/mpi_perf_tests --gtest_color=no
77
elif [[ $OSTYPE == "darwin"* ]]; then
8-
mpirun -np 2 ./build/bin/all_perf_tests
9-
mpirun -np 2 ./build/bin/mpi_perf_tests
8+
mpirun -np 2 ./build/bin/all_perf_tests --gtest_color=no
9+
mpirun -np 2 ./build/bin/mpi_perf_tests --gtest_color=no
1010
fi
1111
fi
1212
./build/bin/omp_perf_tests

tasks/all/example/perf_tests/perf_omp.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include <gtest/gtest.h>
22
#include <omp.h>
33

4+
#include <boost/mpi/communicator.hpp>
45
#include <vector>
56

67
#include "core/perf/include/perf.hpp"
@@ -34,6 +35,10 @@ TEST(all_example_perf_test, test_pipeline_run) {
3435
// Create Perf analyzer
3536
auto perf_analyzer = std::make_shared<ppc::core::Perf>(test_task_omp);
3637
perf_analyzer->PipelineRun(perf_attr, perf_results);
37-
ppc::core::Perf::PrintPerfStatistic(perf_results);
38-
ASSERT_EQ(count + 1, out[0]);
38+
39+
boost::mpi::communicator world;
40+
if (world.rank() == 0) {
41+
ppc::core::Perf::PrintPerfStatistic(perf_results);
42+
ASSERT_EQ(count + 1, out[0]);
43+
}
3944
}

tasks/all/example/perf_tests/perf_tbb.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include <gtest/gtest.h>
22
#include <oneapi/tbb.h>
33

4+
#include <boost/mpi/communicator.hpp>
45
#include <vector>
56

67
#include "core/perf/include/perf.hpp"
@@ -35,6 +36,9 @@ TEST(all_example_perf_test, test_task_run) {
3536
// Create Perf analyzer
3637
auto perf_analyzer = std::make_shared<ppc::core::Perf>(test_task_tbb);
3738
perf_analyzer->TaskRun(perf_attr, perf_results);
38-
ppc::core::Perf::PrintPerfStatistic(perf_results);
39-
ASSERT_EQ(count + 1, out[0]);
39+
boost::mpi::communicator world;
40+
if (world.rank() == 0) {
41+
ppc::core::Perf::PrintPerfStatistic(perf_results);
42+
ASSERT_EQ(count + 1, out[0]);
43+
}
4044
}

0 commit comments

Comments
 (0)