@@ -140,17 +140,15 @@ def _write_csv(path: str, header: list[str], tasks_list: list[str], table: dict)
140140logs_path = os .path .abspath (args .input )
141141xlsx_path = os .path .abspath (args .output )
142142
143- list_of_type_of_tasks = ["all" , "mpi" , "omp" , "seq" , "stl" , "tbb" ]
144-
145143# For each perf_type (pipeline/task_run) store times per task
146144result_tables = {"pipeline" : {}, "task_run" : {}}
147145# Map task name -> category (threads|processes)
148146task_categories = {}
149147# Track tasks per category to split output
150148tasks_by_category = {"threads" : set (), "processes" : set ()}
151149
152- logs_file = open (logs_path , "r" )
153- logs_lines = logs_file .readlines ()
150+ with open (logs_path , "r" ) as logs_file :
151+ logs_lines = logs_file .readlines ()
154152for line in logs_lines :
155153 # Handle both old format: tasks/task_type/task_name:perf_type:time
156154 # and new format: namespace_task_type_enabled:perf_type:time
@@ -254,11 +252,19 @@ def _write_csv(path: str, header: list[str], tasks_list: list[str], table: dict)
254252 if not tasks_list :
255253 continue
256254
257- cpu_num_env = os .environ .get ("PPC_NUM_PROC" )
258- if cpu_num_env is None :
259- raise EnvironmentError (
260- "Required environment variable 'PPC_NUM_PROC' is not set."
261- )
255+ # Use appropriate env var per category
256+ if category == "threads" :
257+ cpu_num_env = os .environ .get ("PPC_NUM_THREADS" )
258+ if cpu_num_env is None :
259+ raise EnvironmentError (
260+ "Required environment variable 'PPC_NUM_THREADS' is not set."
261+ )
262+ else :
263+ cpu_num_env = os .environ .get ("PPC_NUM_PROC" )
264+ if cpu_num_env is None :
265+ raise EnvironmentError (
266+ "Required environment variable 'PPC_NUM_PROC' is not set."
267+ )
262268 cpu_num = int (cpu_num_env )
263269 cols = _columns_for_category (category )
264270
0 commit comments