Skip to content

Commit 568c6e4

Browse files
Fix memory values
1 parent 3459cae commit 568c6e4

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

tests/conftest.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import json
22
import pytest
3-
from pathlib import Path
43
import platform
4+
from pathlib import Path
5+
56
from neurodamus.core._utils import run_only_rank0
67

78
try:
@@ -91,18 +92,16 @@ def change_test_dir(monkeypatch, tmp_path):
9192

9293
@pytest.fixture()
9394
def copy_memory_files(change_test_dir):
94-
import json
95-
95+
# Fix values to ensure allocation memory (0,0)[1, 3] (1,0)[2]
9696
metypes_memory = {
97-
"MTYPE0-ETYPE0": 1377.9,
98-
"MTYPE1-ETYPE1": 1107.8,
99-
"MTYPE2-ETYPE2": 97.9,
100-
"MTYPE0-ETYPE1": 83.8
97+
"MTYPE0-ETYPE0": 100.0,
98+
"MTYPE1-ETYPE1": 200.0,
99+
"MTYPE2-ETYPE2": 1000.0,
101100
}
102-
with Path("cell_memory_usage.json").open("w") as f:
103-
json.dump(metypes_memory, f, indent=4)
104101
with Path("memory_per_metype.json").open("w") as f:
105102
json.dump(metypes_memory, f, indent=4)
103+
with Path("cell_memory_usage.json").open("w") as f:
104+
json.dump(metypes_memory, f, indent=4)
106105

107106

108107
@run_only_rank0

tests/unit-mpi/test_dry_run.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ def test_dry_run_dynamic_distribute(create_tmp_simulation_config_file, mpi_ranks
129129
# RingA neuron 1 always in rank 0, neuron 2 always in rank 1
130130
# but neuron 3 can be in either of the two
131131
if rank == 0:
132-
assert is_subset(rank_allocation_standard['RingA'][(0, 0)], [1, 3])
132+
expected_allocation = {'RingA': {(0, 0): [1, 3]}}
133133
elif rank == 1:
134-
assert is_subset(rank_allocation_standard['RingA'][(1, 0)], [2, 3])
134+
expected_allocation = {'RingA': {(1, 0): [2]}}
135+
assert rank_allocation_standard == expected_allocation

tests/unit/test_dry_run.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ def test_dry_run_lb_mode_memory(create_tmp_simulation_config_file, copy_memory_f
100100
rank_allocation_standard = defaultdict_to_standard_types(rank_alloc)
101101
expected_allocation = {
102102
'RingA': {
103-
(0, 0): [1],
104-
(1, 0): [2, 3]
103+
(0, 0): [1, 3],
104+
(1, 0): [2]
105105
}
106106
}
107107
assert rank_allocation_standard == expected_allocation

0 commit comments

Comments
 (0)