From 9cbb95625ef24f578ffe4491b120ba96b8cde956 Mon Sep 17 00:00:00 2001 From: Nesterov Alexander Date: Wed, 7 May 2025 07:37:03 +0200 Subject: [PATCH 1/3] Update perf counters (#660) Co-authored-by: Arseniy Obolenskiy --- scripts/create_perf_table.py | 5 +++-- scripts/run_tests.py | 9 ++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/create_perf_table.py b/scripts/create_perf_table.py index 627f2a8fb..d42f04231 100644 --- a/scripts/create_perf_table.py +++ b/scripts/create_perf_table.py @@ -2,7 +2,6 @@ import os import re import xlsxwriter -import multiprocessing parser = argparse.ArgumentParser() parser.add_argument('-i', '--input', help='Input file path (logs of perf tests, .txt)', required=True) @@ -50,7 +49,9 @@ worksheet.set_column('A:Z', 23) right_bold_border = workbook.add_format({'bold': True, 'right': 2, 'bottom': 2}) bottom_bold_border = workbook.add_format({'bold': True, 'bottom': 2}) - cpu_num = multiprocessing.cpu_count() + cpu_num = os.environ.get("PROC_COUNT") + if cpu_num is None: + raise EnvironmentError("Required environment variable 'PROC_COUNT' is not set.") worksheet.write(0, 0, "cpu_num = " + str(cpu_num), right_bold_border) it = 1 diff --git a/scripts/run_tests.py b/scripts/run_tests.py index 443eb3db7..a65d2a923 100644 --- a/scripts/run_tests.py +++ b/scripts/run_tests.py @@ -87,11 +87,10 @@ def run_processes(self, additional_mpi_args): def run_performance(self): if not os.environ.get("ASAN_RUN"): - mpi_running = "" - if platform.system() in ("Linux", "Windows"): - mpi_running = f"{self.mpi_exec} -np 4" - elif platform.system() == "Darwin": - mpi_running = f"{self.mpi_exec} -np 2" + proc_count = os.environ.get("PROC_COUNT") + if proc_count is None: + raise EnvironmentError("Required environment variable 'PROC_COUNT' is not set.") + mpi_running = f"{self.mpi_exec} -np {proc_count}" self.__run_exec(f"{mpi_running} {self.work_dir / 'all_perf_tests'} {self.__get_gtest_settings(1)}") self.__run_exec(f"{mpi_running} {self.work_dir / 'mpi_perf_tests'} {self.__get_gtest_settings(1)}") From f5c272a6db3ad293f6f1bc5b910c4521cf85a9a8 Mon Sep 17 00:00:00 2001 From: Arseniy Obolenskiy Date: Wed, 9 Apr 2025 14:12:35 +0200 Subject: [PATCH 2/3] [CI] Fix perf tests run (#398) - Set missing OMP_NUM_THREADS env variable --- .github/workflows/main.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index aaa12efb8..eb65a8838 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1020,6 +1020,9 @@ jobs: - name: Run perf count checker run: | python3 scripts/run_perf_counter.py --required-tests-number=2 + env: + OMP_NUM_THREADS: 2 + PROC_COUNT: 2 - name: Run perf tests run: | bash -e scripts/generate_perf_results.sh From 45834f3a6ae7381ce33eebd84f89643bcff5fe43 Mon Sep 17 00:00:00 2001 From: Arseniy Obolenskiy Date: Thu, 8 May 2025 02:46:56 +0200 Subject: [PATCH 3/3] Hotfix for scripts/create_perf_table.py (#673) --- scripts/create_perf_table.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/create_perf_table.py b/scripts/create_perf_table.py index d42f04231..b59d78621 100644 --- a/scripts/create_perf_table.py +++ b/scripts/create_perf_table.py @@ -52,6 +52,7 @@ cpu_num = os.environ.get("PROC_COUNT") if cpu_num is None: raise EnvironmentError("Required environment variable 'PROC_COUNT' is not set.") + cpu_num = int(cpu_num) worksheet.write(0, 0, "cpu_num = " + str(cpu_num), right_bold_border) it = 1