Skip to content

Commit

Permalink
return dictionary of simulation state instead of null
Browse files Browse the repository at this point in the history
  • Loading branch information
chetanyagoyal authored Nov 9, 2023
1 parent 539609c commit 21abaaf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions openfasoc/generators/common/simulation/simulation_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ def _run_simulations(
- `num_concurrent_sims` (int): The maximum number of concurrent simulations.
- `sim_tool` (str): Path to the directory in which the simulation runs will be generated.
- `runs_dir_path` (str): Path to the directory in which the simulation runs will be generated.
Returns: `simulation_state`, the number of ongoing, completed and failed sims.
"""

simulation_state = {
Expand Down Expand Up @@ -67,11 +69,9 @@ def thread_on_exit(exit_status: int, state=simulation_state):

_print_progress(num_configs, simulation_state['completed_sims'], simulation_state['failed_sims'], start_time)
time.sleep(1)

# to dump the simulation state (completed, failed, ongoing) to an output file for later use
json.dump(simulation_state, open("work/sim_state_file.txt",'w'))

_print_progress(num_configs, simulation_state['completed_sims'], simulation_state['failed_sims'], start_time, end='\n')
return simulation_state

def _run_config(
sim_tool: str,
Expand Down

0 comments on commit 21abaaf

Please sign in to comment.