Skip to content

Commit

Permalink
Divide output folder by cycle, nodegroup ID, group ID, and node
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiorg-hpc committed Aug 17, 2023
1 parent b17886e commit 9bb0951
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions neurodamus/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -1316,8 +1316,9 @@ def _sim_corenrn_write_config(self, corenrn_restore=False):
if MPI.rank == local_node_rank0:
import shutil

group_id = int(SHMUtil.node_id / 20)
node_specific_corenrn_output_in_storage = \
Path(corenrn_output) / f"coreneuron_input_{SHMUtil.node_id}"
Path(SimConfig.coreneuron_datadir) / f"cycle_{self._cycle_i}/group_{group_id}/node_{SHMUtil.node_id}"
allfiles = glob.glob(
os.path.join(corenrn_data, "*_[1-3].dat"), recursive=False
)
Expand Down Expand Up @@ -1647,17 +1648,6 @@ def cleanup(self):
data_folder_shm = SHMUtil.get_datadir_shm(data_folder)
logging.info("Deleting intermediate SHM data in %s", data_folder_shm)
subprocess.call(['/bin/rm', '-rf', data_folder_shm])
# Remove also the coreneuron_input_{node_id} folders
# if they were created in dev shm cache mode
if SimConfig.cli_options.enable_shm == "CACHE" and MPI.rank == 0:
corenrn_output = SimConfig.coreneuron_outputdir
allcoredatfolders = glob.glob(
os.path.join(corenrn_output, "coreneuron_input_*"),
recursive=False,
)
for folder in allcoredatfolders:
logging.info("Deleting intermediate data in %s", folder)
subprocess.call(["/bin/rm", "-rf", folder])

MPI.barrier()

Expand Down Expand Up @@ -1876,7 +1866,6 @@ def _instantiate_simulation(self):
if MPI.rank == 0:
base_filesdat = ospath.join(SimConfig.coreneuron_datadir, 'files')
os.rename(base_filesdat + '.dat', base_filesdat + "_{}.dat".format(cycle_i))

# Archive timers for this cycle
TimerManager.archive(archive_name="Cycle Run {:d}".format(cycle_i + 1))

Expand Down

0 comments on commit 9bb0951

Please sign in to comment.