diff options
author | 2019-09-12 09:54:38 -0400 | |
---|---|---|
committer | 2019-09-12 09:54:38 -0400 | |
commit | b8d56b2f8f04f0210b2ec1404b2cc815f06c1324 (patch) | |
tree | a709ea2309d53d9d1e8b166c6ca91b5719b5e15d /Tools/performance_tests/functions_perftest.py | |
parent | 1e3b0b68a27c653ede0f1b06cf7765e6e7ce6824 (diff) | |
parent | 0bda5edfefde5773f5a773dcc8991649d33cc360 (diff) | |
download | WarpX-b8d56b2f8f04f0210b2ec1404b2cc815f06c1324.tar.gz WarpX-b8d56b2f8f04f0210b2ec1404b2cc815f06c1324.tar.zst WarpX-b8d56b2f8f04f0210b2ec1404b2cc815f06c1324.zip |
merge conflicts with dev
Diffstat (limited to 'Tools/performance_tests/functions_perftest.py')
-rw-r--r-- | Tools/performance_tests/functions_perftest.py | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/Tools/performance_tests/functions_perftest.py b/Tools/performance_tests/functions_perftest.py index f3f3748a9..67622317a 100644 --- a/Tools/performance_tests/functions_perftest.py +++ b/Tools/performance_tests/functions_perftest.py @@ -172,14 +172,14 @@ def get_nsteps(run_name): return nsteps def extract_dataframe(filename, n_steps): - # Get init time and total time through Inclusive time + # Get init time and total time through Inclusive time partition_limit_start = 'NCalls Incl. Min Incl. Avg Incl. Max Max %' with open(filename) as file_handler: output_text = file_handler.read() - # get total simulation time + # get total simulation time line_match_totaltime = re.search('TinyProfiler total time across processes.*', output_text) total_time = float(line_match_totaltime.group(0).split()[8]) - # get time performing steps as Inclusive WarpX::Evolve() time + # get time performing steps as Inclusive WarpX::Evolve() time search_area = output_text.partition(partition_limit_start)[2] line_match_looptime = re.search('\nWarpX::Evolve().*', search_area) time_wo_initialization = float(line_match_looptime.group(0).split()[3]) @@ -189,14 +189,14 @@ def extract_dataframe(filename, n_steps): time_WritePlotFile = float(line_match_WritePlotFile.group(0).split()[3]) else: time_WritePlotFile = 0. - # Get timers for all routines - # Where to start and stop in the output_file + # Get timers for all routines + # Where to start and stop in the output_file partition_limit_start = 'NCalls Excl. Min Excl. Avg Excl. Max Max %' partition_limit_end = 'NCalls Incl. Min Incl. Avg Incl. Max Max %' - # Put file content in a string + # Put file content in a string with open(filename) as file_handler: output_text = file_handler.read() - # Keep only profiling data + # Keep only profiling data search_area = output_text.partition(partition_limit_start)[2]\ .partition(partition_limit_end)[0] list_string = search_area.split('\n')[2:-4] @@ -213,26 +213,26 @@ def extract_dataframe(filename, n_steps): # df['string_output'] = partition_limit_start + '\n' + search_area return df -# Run a performance test in an interactive allocation +# Run a performance test in an interactive allocation # def run_interactive(run_name, res_dir, n_node=1, n_mpi=1, n_omp=1): -# # Clean res_dir # +# # Clean res_dir # # if os.path.exists(res_dir): # shutil.rmtree(res_dir) # os.makedirs(res_dir) -# # Copy files to res_dir # +# # Copy files to res_dir # # shutil.copyfile(bin_dir + bin_name, res_dir + bin_name) # shutil.copyfile(cwd + run_name, res_dir + 'inputs') # os.chdir(res_dir) # if args.architecture == 'cpu': -# cflag_value = max(1, int(32/n_mpi) * 2) # Follow NERSC directives # +# cflag_value = max(1, int(32/n_mpi) * 2) # Follow NERSC directives # # exec_command = 'export OMP_NUM_THREADS=' + str(n_omp) + ';' +\ # 'srun --cpu_bind=cores ' + \ # ' -n ' + str(n_node*n_mpi) + \ # ' -c ' + str(cflag_value) + \ # ' ./' + bin_name + ' inputs > perf_output.txt' # elif args.architecture == 'knl': -# # number of logical cores per MPI process # -# cflag_value = max(1,int(68/n_mpi) * 4) # Follow NERSC directives # +# # number of logical cores per MPI process # +# cflag_value = max(1,int(68/n_mpi) * 4) # Follow NERSC directives # # exec_command = 'export OMP_NUM_THREADS=' + str(n_omp) + ';' +\ # 'srun --cpu_bind=cores ' + \ # ' -n ' + str(n_node*n_mpi) + \ |