Skip to content

Commit

Permalink
Cosmit
Browse files Browse the repository at this point in the history
  • Loading branch information
jasmainak committed Jul 31, 2021
1 parent 02b6e60 commit aff49b5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions hnn_core/network_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,6 @@ def _gid_assign(self):
# round robin assignment of gids
for gid in range(rank, self.net.n_cells, nhosts):
# set the cell gid
_PC.set_gid2node(gid, rank)
self._gid_list.append(gid)

# loop over all drives, then all cell types, then all artificial cells
Expand All @@ -386,14 +385,15 @@ def _gid_assign(self):
conn['target_gids']):
if (target_gid in self._gid_list and
src_gid not in self._gid_list):
_PC.set_gid2node(src_gid, rank)
self._gid_list.append(src_gid)
else:
src_gids = list(self.net.gid_ranges[drive['name']])
for gid_idx in range(rank, len(src_gids), nhosts):
_PC.set_gid2node(src_gids[gid_idx], rank)
self._gid_list.append(src_gids[gid_idx])

for gid in self._gid_list:
_PC.set_gid2node(gid, rank)

# extremely important to get the gids in the right order
self._gid_list.sort()

Expand Down Expand Up @@ -429,6 +429,7 @@ def _create_cells_and_drives(self, threshold, record_vsoma=False,

# this call could belong in init of a _Cell (with threshold)?
nrn_netcon = cell.setup_source_netcon(threshold)
assert cell.gid in self._gid_list
_PC.cell(cell.gid, nrn_netcon)
self._cells.append(cell)

Expand Down
2 changes: 1 addition & 1 deletion hnn_core/tests/test_parallel_backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def _terminate_mpibackend(event, backend):
sleep(0.01)


def test_gid_assignment_across_ranks():
def test_gid_assignment():
"""Test that gids are assigned without overlap across ranks"""
hnn_core_root = op.dirname(hnn_core.__file__)
params_fname = op.join(hnn_core_root, 'param', 'default.json')
Expand Down

0 comments on commit aff49b5

Please sign in to comment.