From 9b64d7f3866757e9a30fe250e61c7a684f586513 Mon Sep 17 00:00:00 2001 From: Weina Ji Date: Mon, 25 Mar 2024 14:10:57 +0100 Subject: [PATCH] disable shm, no direct mode with restore BLUECONFIGS_BRANCH=weji/coreneuron_direct SPACK_BRANCH=weji/neuron_nmodl_develop --- neurodamus/core/configuration.py | 2 +- neurodamus/node.py | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/neurodamus/core/configuration.py b/neurodamus/core/configuration.py index 64806eaef..0fdf57d48 100644 --- a/neurodamus/core/configuration.py +++ b/neurodamus/core/configuration.py @@ -1023,7 +1023,7 @@ def _coreneuron_direct_mode(config: _SimConfig, run_conf): logging.warning("--coreneuron-direct-mode not valid for multi-cyle model building, " "continue with file mode") direct_mode = False - if config.save: + if config.save or config.restore: logging.warning("--coreneuron-direct-mode not valid for save/restore, " "continue with file mode") direct_mode = False diff --git a/neurodamus/node.py b/neurodamus/node.py index 681a6daa0..a9ab707ca 100644 --- a/neurodamus/node.py +++ b/neurodamus/node.py @@ -1210,9 +1210,11 @@ def _coreneuron_ensure_all_ranks_have_gids(self, corenrn_data): dummyfile.write("%s\n0\n" % coredata_version) # - - def _sim_corenrn_configure_datadir(self, corenrn_restore): + def _sim_corenrn_configure_datadir(self, corenrn_restore, coreneuron_direct_mode): corenrn_datadir = SimConfig.coreneuron_datadir os.makedirs(corenrn_datadir, exist_ok=True) + if coreneuron_direct_mode: + return corenrn_datadir corenrn_datadir_shm = SHMUtil.get_datadir_shm(corenrn_datadir) # Clean-up any previous simulations in the same output directory @@ -1271,7 +1273,8 @@ def _sim_corenrn_configure_datadir(self, corenrn_restore): @timeit(name="corewrite") def _sim_corenrn_write_config(self, corenrn_restore=False): log_stage("Dataset generation for CoreNEURON") - CoreConfig.datadir = self._sim_corenrn_configure_datadir(corenrn_restore) + CoreConfig.datadir = self._sim_corenrn_configure_datadir(corenrn_restore, + SimConfig.coreneuron_direct_mode) fwd_skip = self._run_conf.get("ForwardSkip", 0) if not corenrn_restore else 0 if not corenrn_restore: