Skip to content

Commit

Permalink
Add more configuration check for the direct mode
Browse files Browse the repository at this point in the history
BLUECONFIGS_BRANCH=weji/coreneuron_direct
SPACK_BRANCH=weji/neuron_nmodl_develop
  • Loading branch information
Weina Ji committed Mar 25, 2024
1 parent 38dfd85 commit 13ed866
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions neurodamus/core/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ def init(cls, config_file, cli_options):
cls.cli_options = CliOptions(**(cli_options or {}))
cls.dry_run = cls.cli_options.dry_run
cls.num_target_ranks = cls.cli_options.num_target_ranks
cls.coreneuron_direct_mode = cls.cli_options.coreneuron_direct_mode
# change simulator by request before validator and init hoc config
if cls.cli_options.simulator:
cls._parsed_run["Simulator"] = cls.cli_options.simulator
Expand Down Expand Up @@ -1012,12 +1011,24 @@ def _spikes_sort_order(config: _SimConfig, run_conf):

@SimConfig.validator
def _coreneuron_direct_mode(config: _SimConfig, run_conf):
if config.coreneuron_direct_mode:
user_config = config.cli_options
direct_mode = user_config.coreneuron_direct_mode
if direct_mode:
if config.use_coreneuron:
logging.info("Run CORENEURON without writing model data to disk")
logging.info("Run CORENEURON direct mode without writing model data to disk")
else:
logging.warning("--coreneuron-direct-mode not valid for NEURON, continue with NEURON")
config.coreneuron_direct_mode = False
direct_mode = False
if config.modelbuilding_steps > 1:
logging.warning("--coreneuron-direct-mode not valid for multi-cyle model building, "
"continue with file mode")
direct_mode = False
if config.save:
logging.warning("--coreneuron-direct-mode not valid for save/restore, "
"continue with file mode")
direct_mode = False

config.coreneuron_direct_mode = direct_mode


def get_debug_cell_gid(cli_options):
Expand Down

0 comments on commit 13ed866

Please sign in to comment.