From 21abaafc7ffe04adf598d15f2bf62b1a2439029b Mon Sep 17 00:00:00 2001 From: Chetanya <95761876+chetanyagoyal@users.noreply.github.com> Date: Thu, 9 Nov 2023 19:20:44 +0530 Subject: [PATCH] return dictionary of simulation state instead of null --- openfasoc/generators/common/simulation/simulation_run.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openfasoc/generators/common/simulation/simulation_run.py b/openfasoc/generators/common/simulation/simulation_run.py index dee8aa753..45b80e19f 100644 --- a/openfasoc/generators/common/simulation/simulation_run.py +++ b/openfasoc/generators/common/simulation/simulation_run.py @@ -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 = { @@ -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,