From 11d6fbbde41f09fd67942107366d5c1e378a1671 Mon Sep 17 00:00:00 2001 From: Alessandro Cattabiani Date: Thu, 3 Jul 2025 11:56:08 +0200 Subject: [PATCH] add i_membrane to compute and report with coreneuron --- commonutils.py | 11 ++++++++++- ringtest.py | 5 ++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/commonutils.py b/commonutils.py index a8d1de0..748abd7 100644 --- a/commonutils.py +++ b/commonutils.py @@ -102,7 +102,6 @@ def timeit(message, rank): print ('%gs %s' % ((x - _timeit), message)) _timeit = x - # function to register section-segment mapping with bbcore write def setup_nrnbbcore_register_mapping(rings): @@ -144,6 +143,11 @@ def setup_nrnbbcore_register_mapping(rings): v.record(seg._ref_v) v.label("soma %d %d" % (isec, seg.node_index())) recordlist.append(v) + + i_membrane = h.Vector() + i_membrane.record(seg._ref_i_membrane_) + i_membrane.label("soma i_membrane %d %d" % (isec, seg.node_index())) + recordlist.append(i_membrane) isec += 1 #for sections in dendrite @@ -157,6 +161,11 @@ def setup_nrnbbcore_register_mapping(rings): v.record(seg._ref_v) v.label("dend %d %d" % (isec, seg.node_index())) recordlist.append(v) + + i_membrane = h.Vector() + i_membrane.record(seg._ref_i_membrane_) + i_membrane.label("dend i_membrane %d %d" % (isec, seg.node_index())) + recordlist.append(i_membrane) isec += 1 #register soma section list diff --git a/ringtest.py b/ringtest.py index be04886..0179c01 100644 --- a/ringtest.py +++ b/ringtest.py @@ -157,6 +157,7 @@ def create_rings(): ## CoreNEURON setting ## h.cvode.cache_efficient(1) + h.cvode.use_fast_imem(1) if use_coreneuron: from neuron import coreneuron @@ -174,8 +175,10 @@ def create_rings(): report_conf_file = "report.conf" sim_conf_file = "sim.conf" if settings.rank == 0: - write_report_config(report_conf_file, "soma.h5", "Mosaic", "compartment", "v", + write_report_config(report_conf_file, "soma_v.h5", "Mosaic", "compartment", "v", "mV", "SONATA", 2, 1, 0, tstop, list(range(ncell))) + write_report_config(report_conf_file, "soma_i_membrane.h5", "Mosaic", "compartment", "v", + "nA", "SONATA", 2, 1, 0, tstop, list(range(ncell))) write_spike_config(report_conf_file, "spikes.h5", ["default"], [0]) write_sim_config(sim_conf_file, "corenrn_data", report_conf_file, tstop) coreneuron.sim_config=sim_conf_file