Skip to content

Commit

Permalink
Add debug print to flaky JSON test (#2404)
Browse files Browse the repository at this point in the history
Initialize all members to avoid undefined values.
  • Loading branch information
thorstenhater authored Sep 12, 2024
1 parent f81b4f2 commit b6ecfef
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
6 changes: 3 additions & 3 deletions arbor/backends/gpu/shared_state.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ struct ARB_ARBOR_API shared_state: shared_state_base<shared_state, array, ion_st
arb_size_type n_cv = 0; // Total number of CVs.

iarray cv_to_cell; // Maps CV index to cell index.
arb_value_type time; // integration start time [ms].
arb_value_type time_to; // integration end time [ms]
arb_value_type dt; // dt [ms].
arb_value_type time = 0.0; // integration start time [ms].
arb_value_type time_to = 0.0; // integration end time [ms]
arb_value_type dt = 0.0; // dt [ms].
array voltage; // Maps CV index to membrane voltage [mV].
array current_density; // Maps CV index to current density [A/m²].
array conductivity; // Maps CV index to membrane conductivity [kS/m²].
Expand Down
6 changes: 3 additions & 3 deletions arbor/backends/multicore/shared_state.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ struct ARB_ARBOR_API shared_state:
arb_size_type n_cv = 0; // Total number of CVs.

iarray cv_to_cell; // Maps CV index to GID
arb_value_type time; // integration start time [ms].
arb_value_type time_to; // integration end time [ms]
arb_value_type dt; // dt [ms].
arb_value_type time = 0.0; // integration start time [ms].
arb_value_type time_to = 0.0; // integration end time [ms]
arb_value_type dt = 0.0; // dt [ms].
array voltage; // Maps CV index to membrane voltage [mV].
array current_density; // Maps CV index to membrane current density contributions [A/m²].
array conductivity; // Maps CV index to membrane conductivity [kS/m²].
Expand Down
6 changes: 5 additions & 1 deletion python/test/unit/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,4 +246,8 @@ def test_serialize(self):
rec = serdes_recipe()
sim = A.simulation(rec)
jsn = sim.serialize()
sim.deserialize(jsn)
try:
sim.deserialize(jsn)
except RuntimeError as e:
print(f"Unexpected error\n{e}\nin JSON:\n{jsn}")
raise

0 comments on commit b6ecfef

Please sign in to comment.