Skip to content

Commit

Permalink
Fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
AngelFP committed Oct 10, 2023
1 parent 86e6a09 commit 5609f0e
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions optimas/sim_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ def run_template_simulation(H, persis_info, sim_specs, libE_info):
analysis_func=step_specs['analysis_func'],
libE_output=libE_output,
num_procs=step_specs['num_procs'],
num_gpus=step_specs['num_gpus']
num_gpus=step_specs['num_gpus'],
env_script=step_specs['env_script'],
mpi_runner_type=step_specs['env_mpi']
)
# If a step has failed, do not continue with next steps.
if calc_status != WORKER_DONE:
Expand All @@ -60,15 +62,18 @@ def run_template_simulation(H, persis_info, sim_specs, libE_info):
sim_template=user_specs['sim_template'],
input_values=input_values,
analysis_func=user_specs['analysis_func'],
libE_output=libE_output
libE_output=libE_output,
env_script=user_specs['env_script'],
mpi_runner_type=user_specs['env_mpi']
)

return libE_output, persis_info, calc_status


def execute_and_analyze_simulation(app_name, sim_template, input_values,
analysis_func, libE_output, num_procs=None,
num_gpus=None):
num_gpus=None, env_script=None,
mpi_runner_type=None):
# Create simulation input file.
with open(sim_template, 'r') as f:
template = jinja2.Template(f.read())
Expand All @@ -91,8 +96,8 @@ def execute_and_analyze_simulation(app_name, sim_template, input_values,
stderr='err.txt',
num_procs=num_procs,
num_gpus=num_gpus,
env_script=user_specs['env_script'],
mpi_runner_type=user_specs['env_mpi']
env_script=env_script,
mpi_runner_type=mpi_runner_type
)

# Wait for simulation to complete
Expand Down

0 comments on commit 5609f0e

Please sign in to comment.