Skip to content

Commit

Permalink
Fix crash handling unit test and add debugging print statements
Browse files Browse the repository at this point in the history
  • Loading branch information
IshaanDesai committed Feb 12, 2025
1 parent 123060f commit 0472155
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
21 changes: 10 additions & 11 deletions micro_manager/micro_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,16 +209,16 @@ def solve(self) -> None:
self._global_ids_of_local_sims[inactive_id]
)

# print(
# "Rank {} has active sims: {}".format(
# self._rank, active_sim_gids
# )
# )
# print(
# "Rank {} has inactive sims: {}".format(
# self._rank, inactive_sim_gids
# )
# )
print(
"Rank {} has active sims: {}".format(
self._rank, active_sim_gids
)
)
print(
"Rank {} has inactive sims: {}".format(
self._rank, inactive_sim_gids
)
)

if self._is_adaptivity_with_load_balancing:
if n % self._load_balancing_n == 0 and not first_time_window:
Expand Down Expand Up @@ -284,7 +284,6 @@ def solve(self) -> None:
)
sys.exit()

# precice_write_data(micro_sims_output)
self._write_data_to_precice(micro_sims_output)

t += dt
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/test_micro_simulation_crash_handling.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def test_crash_handling(self):
)
manager._micro_sims = [MicroSimulation(i) for i in range(4)]

micro_sims_output, _ = manager._solve_micro_simulations(macro_data, 1.0)
micro_sims_output = manager._solve_micro_simulations(macro_data, 1.0)

# Crashed simulation has interpolated value
data_crashed = micro_sims_output[2]
Expand Down Expand Up @@ -107,7 +107,7 @@ def test_crash_handling_with_adaptivity(self):
[-2, -2, -2, -2, 2]
)

micro_sims_output, _ = manager._solve_micro_simulations_with_adaptivity(
micro_sims_output = manager._solve_micro_simulations_with_adaptivity(
macro_data, 1.0
)

Expand Down

0 comments on commit 0472155

Please sign in to comment.