Skip to content

Commit 9cbb956

Browse files
allnesaobolensk
andcommitted
Update perf counters (learning-process#660)
Co-authored-by: Arseniy Obolenskiy <gooddoog@student.su>
1 parent 253f85a commit 9cbb956

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

scripts/create_perf_table.py

Lines changed: 3 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,9 @@
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.")
5455
worksheet.write(0, 0, "cpu_num = " + str(cpu_num), right_bold_border)
5556

5657
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)