Skip to content

Commit 88f23cd

Browse files
aobolenskallnes
andauthored
Apply fixes for test scripts (#420)
Backport necessary commits from ppc-2025-threads repo --------- Co-authored-by: Nesterov Alexander <[email protected]>
1 parent 17d14a7 commit 88f23cd

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,6 +1021,9 @@ jobs:
10211021
- name: Run perf count checker
10221022
run: |
10231023
python3 scripts/run_perf_counter.py --required-tests-number=2
1024+
env:
1025+
OMP_NUM_THREADS: 2
1026+
PROC_COUNT: 2
10241027
- name: Run perf tests
10251028
run: |
10261029
bash -e scripts/generate_perf_results.sh

scripts/create_perf_table.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import os
33
import re
44
import xlsxwriter
5-
import multiprocessing
65

76
parser = argparse.ArgumentParser()
87
parser.add_argument('-i', '--input', help='Input file path (logs of perf tests, .txt)', required=True)
@@ -50,7 +49,10 @@
5049
worksheet.set_column('A:Z', 23)
5150
right_bold_border = workbook.add_format({'bold': True, 'right': 2, 'bottom': 2})
5251
bottom_bold_border = workbook.add_format({'bold': True, 'bottom': 2})
53-
cpu_num = multiprocessing.cpu_count()
52+
cpu_num = os.environ.get("PROC_COUNT")
53+
if cpu_num is None:
54+
raise EnvironmentError("Required environment variable 'PROC_COUNT' is not set.")
55+
cpu_num = int(cpu_num)
5456
worksheet.write(0, 0, "cpu_num = " + str(cpu_num), right_bold_border)
5557

5658
it = 1

scripts/run_tests.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,10 @@ def run_processes(self, additional_mpi_args):
8787

8888
def run_performance(self):
8989
if not os.environ.get("ASAN_RUN"):
90-
mpi_running = ""
91-
if platform.system() in ("Linux", "Windows"):
92-
mpi_running = f"{self.mpi_exec} -np 4"
93-
elif platform.system() == "Darwin":
94-
mpi_running = f"{self.mpi_exec} -np 2"
90+
proc_count = os.environ.get("PROC_COUNT")
91+
if proc_count is None:
92+
raise EnvironmentError("Required environment variable 'PROC_COUNT' is not set.")
93+
mpi_running = f"{self.mpi_exec} -np {proc_count}"
9594
self.__run_exec(f"{mpi_running} {self.work_dir / 'all_perf_tests'} {self.__get_gtest_settings(1)}")
9695
self.__run_exec(f"{mpi_running} {self.work_dir / 'mpi_perf_tests'} {self.__get_gtest_settings(1)}")
9796

0 commit comments

Comments
 (0)