Skip to content

Commit

Permalink
Address Review Comments from Dave
Browse files Browse the repository at this point in the history
  • Loading branch information
ax3l committed Aug 10, 2024
1 parent 9ce016c commit 0070c6f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 27 deletions.
2 changes: 1 addition & 1 deletion Examples/Tests/photon_pusher/analysis_photon_pusher.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def generate():
f.write("{}.single_particle_u = {} {} {}\n".
format(name, velx, vely, velz))
f.write("{}.single_particle_weight = 1.0\n".format(name))
f.write("\n".format())
f.write("\n")

def main():
if (len(sys.argv) < 2):
Expand Down
22 changes: 8 additions & 14 deletions Tools/PerformanceTests/run_alltests.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,8 @@
import shutil
import time

import functions_perftest as perftest
import pandas as pd
from functions_perftest import (
extract_dataframe,
get_nsteps,
read_run_perf,
run_batch,
write_perf_logfile,
)

# This script runs automated performance tests for WarpX.
# It runs tests in list test_list defined below, and write
Expand Down Expand Up @@ -247,15 +241,15 @@ def process_analysis():
n_node = current_run[1]
n_mpi = current_run[2]
n_omp = current_run[3]
n_steps = get_nsteps(cwd + run_name)
n_steps = perftest.get_nsteps(cwd + run_name)
res_dir = res_dir_base
res_dir += '_'.join([run_name, args.compiler,\
args.architecture, str(n_node), str(n_mpi),\
str(n_omp), str(count)]) + '/'
# Run the simulation.
# If you are currently in an interactive session and want to run interactive,
# just replace run_batch with run_interactive
run_batch(run_name, res_dir, bin_name, config_command, architecture=args.architecture, \
# just replace perftest.run_batch with run_interactive
perftest.run_batch(run_name, res_dir, bin_name, config_command, architecture=args.architecture, \
Cname=module_Cname[args.architecture], n_node=n_node, n_mpi=n_mpi, n_omp=n_omp)
os.chdir(cwd)
process_analysis()
Expand All @@ -281,7 +275,7 @@ def process_analysis():
n_mpi = current_run[2]
n_omp = current_run[3]
if args.n_steps is None:
n_steps = get_nsteps(cwd + run_name)
n_steps = perftest.get_nsteps(cwd + run_name)
else:
n_steps = int(args.n_steps)
res_dir = res_dir_base
Expand All @@ -291,17 +285,17 @@ def process_analysis():
# Read to store in text file
# --------------------------
output_filename = 'perf_output.txt'
timing_list = read_run_perf(res_dir + output_filename, n_steps)
timing_list = perftest.read_run_perf(res_dir + output_filename, n_steps)
# Write performance data to the performance log file
log_line = ' '.join([year, month, day, run_name, args.compiler,\
args.architecture, str(n_node), str(n_mpi),\
str(n_omp)] + timing_list + ['\n'])
write_perf_logfile(log_dir + log_file, log_line)
perftest.write_perf_logfile(log_dir + log_file, log_line)

# Read data for all test to put in hdf5 a database
# ------------------------------------------------
# This is an hdf5 file containing ALL the simulation parameters and results. Might be too large for a repo
df_newline = extract_dataframe(res_dir + 'perf_output.txt', n_steps)
df_newline = perftest.extract_dataframe(res_dir + 'perf_output.txt', n_steps)
# Add all simulation parameters to the dataframe
df_newline['run_name'] = run_name
df_newline['n_node'] = n_node
Expand Down
18 changes: 6 additions & 12 deletions Tools/PerformanceTests/run_alltests_1node.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,8 @@
import shutil
import time

import functions_perftest as perftest
import pandas as pd
from functions_perftest import (
extract_dataframe,
get_nsteps,
read_run_perf,
run_batch_nnode,
write_perf_logfile,
)

# This script runs automated performance tests for WarpX.
# It runs tests in list test_list defined below, and write
Expand Down Expand Up @@ -223,7 +217,7 @@ def process_analysis():
res_dir += '_'.join([run_name, args.compiler,\
args.architecture, str(n_node)]) + '/'
# Run the simulation.
run_batch_nnode(test_list, res_dir, bin_name, config_command,\
perftest.run_batch_nnode(test_list, res_dir, bin_name, config_command,\
architecture=args.architecture, Cname=module_Cname[args.architecture], \
n_node=n_node)

Check failure

Code scanning / CodeQL

Wrong name for an argument in a call Error

Keyword argument 'n_node' is not a supported parameter name of
function run_batch_nnode
.
Keyword argument 'architecture' is not a supported parameter name of
function run_batch_nnode
.
Keyword argument 'Cname' is not a supported parameter name of
function run_batch_nnode
.
os.chdir(cwd)
Expand All @@ -249,23 +243,23 @@ def process_analysis():
# Do not read n_node = current_run[1], it is an external parameter
n_mpi = current_run[2]
n_omp = current_run[3]
n_steps = get_nsteps(cwd + input_file)
n_steps = perftest.get_nsteps(cwd + input_file)
print('n_steps = ' + str(n_steps))
res_dir = res_dir_base
res_dir += '_'.join([run_name, args.compiler,\
args.architecture, str(n_node)]) + '/'
# Read performance data from the output file
output_filename = 'out_' + '_'.join([input_file, str(n_node), str(n_mpi), str(n_omp), str(count)]) + '.txt'
timing_list = read_run_perf(res_dir + output_filename, n_steps)
timing_list = perftest.read_run_perf(res_dir + output_filename, n_steps)
# Write performance data to the performance log file
log_line = ' '.join([year, month, day, input_file, args.compiler,\
args.architecture, str(n_node), str(n_mpi),\
str(n_omp)] + timing_list + ['\n'])
write_perf_logfile(log_dir + log_file, log_line)
perftest.write_perf_logfile(log_dir + log_file, log_line)
# Read data for all test to put in hdf5 a database
# ------------------------------------------------
# This is an hdf5 file containing ALL the simulation parameters and results. Might be too large for a repo
df_newline = extract_dataframe(res_dir + output_filename, n_steps)
df_newline = perftest.extract_dataframe(res_dir + output_filename, n_steps)
# Add all simulation parameters to the dataframe
df_newline['run_name'] = run_name
df_newline['n_node'] = n_node
Expand Down

0 comments on commit 0070c6f

Please sign in to comment.