From beeaec4bc7f39670a443a0bbec19bbfe56edbcbf Mon Sep 17 00:00:00 2001 From: Jan Vogelsang <47158055+JanVogelsang@users.noreply.github.com> Date: Tue, 17 Dec 2024 15:24:10 +0100 Subject: [PATCH 1/2] Add threaded-timer support to hpc-benchmark --- hpc_benchmark/hpc_benchmark.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/hpc_benchmark/hpc_benchmark.py b/hpc_benchmark/hpc_benchmark.py index 1a837aa..ca175f6 100644 --- a/hpc_benchmark/hpc_benchmark.py +++ b/hpc_benchmark/hpc_benchmark.py @@ -487,14 +487,20 @@ def run_simulation(): d.update(final_kernel_status) # Subtract timer information from presimulation period - timers = ['time_collocate_spike_data', 'time_communicate_prepare', - 'time_communicate_spike_data', 'time_deliver_spike_data', - 'time_gather_spike_data', 'time_update', 'time_simulate'] + timers = ['time_collocate_spike_data', 'time_communicate_prepare', 'time_communicate_spike_data', 'time_communicate_target_data', 'time_construction_connect', 'time_construction_create', 'time_deliver_secondary_data', 'time_deliver_spike_data', 'time_gather_secondary_data', 'time_gather_spike_data', 'time_gather_target_data', 'time_omp_synchronization_construction', 'time_omp_synchronization_simulation', 'time_mpi_synchronization', 'time_simulate', 'time_update'] + timers.append([timer + '_cpu' for timer in timers]) for timer in timers: try: d[timer + '_presim'] = intermediate_kernel_status[timer] - d[timer] -= intermediate_kernel_status[timer] + if type(d[timer]) == tuple or type(d[timer]) == list: + timer_array = tuple(d[timer][tid] - intermediate_kernel_status[timer][tid] for tid in range(len(d[timer]))) + d[timer] = timer_array[0] + d[timer + "_max"] = max(timer_array) + d[timer + "_max"] = min(timer_array) + d[timer + "_avg"] = np.mean(timer_array) + else: + d[timer] -= intermediate_kernel_status[timer] except KeyError: # KeyError if compiled without detailed timers, except time_simulate continue From f5653b84aa0ebe2afac80fa3e034736936cf8b06 Mon Sep 17 00:00:00 2001 From: Jan Vogelsang <47158055+JanVogelsang@users.noreply.github.com> Date: Wed, 18 Dec 2024 00:36:42 +0100 Subject: [PATCH 2/2] Update hpc_benchmark.py --- hpc_benchmark/hpc_benchmark.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hpc_benchmark/hpc_benchmark.py b/hpc_benchmark/hpc_benchmark.py index ca175f6..eac3069 100644 --- a/hpc_benchmark/hpc_benchmark.py +++ b/hpc_benchmark/hpc_benchmark.py @@ -488,7 +488,7 @@ def run_simulation(): # Subtract timer information from presimulation period timers = ['time_collocate_spike_data', 'time_communicate_prepare', 'time_communicate_spike_data', 'time_communicate_target_data', 'time_construction_connect', 'time_construction_create', 'time_deliver_secondary_data', 'time_deliver_spike_data', 'time_gather_secondary_data', 'time_gather_spike_data', 'time_gather_target_data', 'time_omp_synchronization_construction', 'time_omp_synchronization_simulation', 'time_mpi_synchronization', 'time_simulate', 'time_update'] - timers.append([timer + '_cpu' for timer in timers]) + timers.extend([timer + '_cpu' for timer in timers]) for timer in timers: try: