x[id] = _args[1];
So, the R
in AST needs to be renamed with _args[1]
.
-Definition at line 2147 of file codegen_neuron_cpp_visitor.cpp.
+Definition at line 2153 of file codegen_neuron_cpp_visitor.cpp.
diff --git a/doxygen/src_2codegen_2codegen__neuron__cpp__visitor_8cpp_source.html b/doxygen/src_2codegen_2codegen__neuron__cpp__visitor_8cpp_source.html
index 30f4fb7fd..dd481f245 100644
--- a/doxygen/src_2codegen_2codegen__neuron__cpp__visitor_8cpp_source.html
+++ b/doxygen/src_2codegen_2codegen__neuron__cpp__visitor_8cpp_source.html
@@ -913,1425 +913,1431 @@
-
- 821 {
"", fmt::format(
"{}&", instance_struct()),
"",
"inst"},
- 822 {
"",
"int",
"",
"id"},
- 823 {
"",
"double",
"",
"v"},
- 824 {
"",
"Datum*",
"",
"_thread"}};
-
-
-
- 828 const auto value_initialize = print_initializers ?
"{}" :
"";
-
-
- 831 printer->add_newline(2);
- 832 printer->add_line(
"/* NEURON global variables */");
- 833 if (info.primes_size != 0) {
- 834 printer->fmt_line(
"static neuron::container::field_index _slist1[{0}], _dlist1[{0}];",
-
-
-
- 838 for (
const auto& ion: info.ions) {
- 839 printer->fmt_line(
"static Symbol* _{}_sym;", ion.name);
-
-
- 842 printer->add_line(
"static int mech_type;");
+
+ 821 params.push_back({
"",
"NrnThread*",
"",
"nt"});
+ 822 params.push_back({
"", fmt::format(
"{}&", instance_struct()),
"",
"inst"});
+ 823 params.push_back({
"",
"int",
"",
"id"});
+ 824 params.push_back({
"",
"double",
"",
"v"});
+ 825 params.push_back({
"",
"Datum*",
"",
"_thread"});
+ 826 if (!codegen_thread_variables.empty()) {
+ 827 params.push_back({
"", fmt::format(
"{}&", thread_variables_struct()),
"",
"_thread_vars"});
+
+
+
+
+
+
+ 834 const auto value_initialize = print_initializers ?
"{}" :
"";
+
+
+ 837 printer->add_newline(2);
+ 838 printer->add_line(
"/* NEURON global variables */");
+ 839 if (info.primes_size != 0) {
+ 840 printer->fmt_line(
"static neuron::container::field_index _slist1[{0}], _dlist1[{0}];",
+
+
- 844 if (info.point_process) {
- 845 printer->add_line(
"static int _pointtype;");
-
- 847 printer->add_multi_line(R
"CODE(
- 848 static Prop* _extcall_prop;
- 849 /* _prop_id kind of shadows _extcall_prop to allow validity checking. */
- 850 static _nrn_non_owning_id_without_container _prop_id{};)CODE");
-
-
- 853 printer->fmt_line("static int {} = {};",
-
- 855 info.pointer_variables.size() > 0
- 856 ?
static_cast<int>(info.pointer_variables.size())
-
-
- 859 printer->add_line(
"static _nrn_mechanism_std_vector<Datum> _extcall_thread;");
-
-
- 862 auto float_type = default_float_data_type();
- 863 printer->add_newline(2);
- 864 printer->add_line(
"/** all global variables */");
- 865 printer->fmt_push_block(
"struct {}", global_struct());
+ 844 for (
const auto& ion: info.ions) {
+ 845 printer->fmt_line(
"static Symbol* _{}_sym;", ion.name);
+
+
+ 848 printer->add_line(
"static int mech_type;");
+
+ 850 if (info.point_process) {
+ 851 printer->add_line(
"static int _pointtype;");
+
+ 853 printer->add_multi_line(R
"CODE(
+ 854 static Prop* _extcall_prop;
+ 855 /* _prop_id kind of shadows _extcall_prop to allow validity checking. */
+ 856 static _nrn_non_owning_id_without_container _prop_id{};)CODE");
+
+
+ 859 printer->fmt_line("static int {} = {};",
+
+ 861 info.pointer_variables.size() > 0
+ 862 ?
static_cast<int>(info.pointer_variables.size())
+
+
+ 865 printer->add_line(
"static _nrn_mechanism_std_vector<Datum> _extcall_thread;");
- 867 if (!info.ions.empty()) {
-
-
-
- 871 if (!info.vectorize && !info.top_local_variables.empty()) {
- 872 throw std::runtime_error(
"Not implemented, global vectorize something.");
-
-
- 875 if (!info.thread_variables.empty()) {
- 876 size_t prefix_sum = 0;
- 877 for (
size_t i = 0; i < info.thread_variables.size(); ++i) {
- 878 const auto& var = info.thread_variables[i];
- 879 codegen_thread_variables.push_back({var, i, prefix_sum});
+
+ 868 auto float_type = default_float_data_type();
+ 869 printer->add_newline(2);
+ 870 printer->add_line(
"/** all global variables */");
+ 871 printer->fmt_push_block(
"struct {}", global_struct());
+
+ 873 if (!info.ions.empty()) {
+
+
+
+ 877 if (!info.vectorize && !info.top_local_variables.empty()) {
+ 878 throw std::runtime_error(
"Not implemented, global vectorize something.");
+
- 881 prefix_sum += var->get_length();
-
-
-
- 885 if (!info.top_local_variables.empty()) {
- 886 size_t prefix_sum = info.thread_var_data_size;
- 887 size_t n_thread_vars = codegen_thread_variables.size();
- 888 for (
size_t i = 0; i < info.top_local_variables.size(); ++i) {
- 889 const auto& var = info.top_local_variables[i];
- 890 codegen_thread_variables.push_back({var, n_thread_vars + i, prefix_sum});
-
- 892 prefix_sum += var->get_length();
-
-
-
- 896 if (!codegen_thread_variables.empty()) {
- 897 auto thread_data_size = info.thread_var_data_size + info.top_local_thread_size;
- 898 printer->fmt_line(
"int thread_data_in_use{};", value_initialize);
- 899 printer->fmt_line(
"{} thread_data[{}];", float_type, thread_data_size);
-
- 901 codegen_global_variables.push_back(make_symbol(
"thread_data_in_use"));
-
- 903 auto symbol = make_symbol(
"thread_data");
- 904 symbol->set_as_array(thread_data_size);
- 905 codegen_global_variables.push_back(symbol);
-
-
+ 881 if (!info.thread_variables.empty()) {
+ 882 size_t prefix_sum = 0;
+ 883 for (
size_t i = 0; i < info.thread_variables.size(); ++i) {
+ 884 const auto& var = info.thread_variables[i];
+ 885 codegen_thread_variables.push_back({var, i, prefix_sum});
+
+ 887 prefix_sum += var->get_length();
+
+
+
+ 891 if (!info.top_local_variables.empty()) {
+ 892 size_t prefix_sum = info.thread_var_data_size;
+ 893 size_t n_thread_vars = codegen_thread_variables.size();
+ 894 for (
size_t i = 0; i < info.top_local_variables.size(); ++i) {
+ 895 const auto& var = info.top_local_variables[i];
+ 896 codegen_thread_variables.push_back({var, n_thread_vars + i, prefix_sum});
+
+ 898 prefix_sum += var->get_length();
+
+
+
+ 902 if (!codegen_thread_variables.empty()) {
+ 903 auto thread_data_size = info.thread_var_data_size + info.top_local_thread_size;
+ 904 printer->fmt_line(
"int thread_data_in_use{};", value_initialize);
+ 905 printer->fmt_line(
"{} thread_data[{}];", float_type, thread_data_size);
+
+ 907 codegen_global_variables.push_back(make_symbol(
"thread_data_in_use"));
- 909 if (info.table_count > 0) {
-
- 911 printer->fmt_line(
"double usetable{};", print_initializers ?
"{1}" :
"");
-
+ 909 auto symbol = make_symbol(
"thread_data");
+ 910 symbol->set_as_array(thread_data_size);
+ 911 codegen_global_variables.push_back(symbol);
+
- 914 for (
const auto& block: info.functions_with_table) {
- 915 const auto& name = block->get_node_name();
- 916 printer->fmt_line(
"{} tmin_{}{};", float_type, name, value_initialize);
- 917 printer->fmt_line(
"{} mfac_{}{};", float_type, name, value_initialize);
- 918 codegen_global_variables.push_back(make_symbol(
"tmin_" + name));
- 919 codegen_global_variables.push_back(make_symbol(
"mfac_" + name));
-
-
- 922 for (
const auto& variable: info.table_statement_variables) {
- 923 auto const name =
"t_" + variable->get_name();
- 924 auto const num_values = variable->get_num_values();
- 925 if (variable->is_array()) {
- 926 int array_len = variable->get_length();
-
- 928 "{} {}[{}][{}]{};", float_type, name, array_len, num_values, value_initialize);
-
- 930 printer->fmt_line(
"{} {}[{}]{};", float_type, name, num_values, value_initialize);
-
- 932 codegen_global_variables.push_back(make_symbol(name));
-
-
-
- 936 for (
const auto& var: info.state_vars) {
- 937 auto name = var->get_name() +
"0";
- 938 auto symbol = program_symtab->lookup(name);
- 939 if (symbol ==
nullptr) {
- 940 printer->fmt_line(
"{} {}{};", float_type, name, value_initialize);
- 941 codegen_global_variables.push_back(make_symbol(name));
-
-
-
- 945 for (
const auto& var: info.global_variables) {
- 946 auto name = var->get_name();
- 947 auto length = var->get_length();
- 948 if (var->is_array()) {
- 949 printer->fmt_line(
"{} {}[{}] /* TODO init const-array */;", float_type, name, length);
-
-
- 952 if (
auto const& value_ptr = var->get_value()) {
-
-
- 955 printer->fmt_line(
"{} {}{};",
-
-
- 958 print_initializers ? fmt::format(
"{{{:g}}}", value) : std::string{});
-
- 960 codegen_global_variables.push_back(var);
-
-
-
-
- 965 if (!info.function_tables.empty()) {
- 966 throw std::runtime_error(
"Not implemented, global function tables.");
+
+ 915 if (info.table_count > 0) {
+
+ 917 printer->fmt_line(
"double usetable{};", print_initializers ?
"{1}" :
"");
+
+
+ 920 for (
const auto& block: info.functions_with_table) {
+ 921 const auto& name = block->get_node_name();
+ 922 printer->fmt_line(
"{} tmin_{}{};", float_type, name, value_initialize);
+ 923 printer->fmt_line(
"{} mfac_{}{};", float_type, name, value_initialize);
+ 924 codegen_global_variables.push_back(make_symbol(
"tmin_" + name));
+ 925 codegen_global_variables.push_back(make_symbol(
"mfac_" + name));
+
+
+ 928 for (
const auto& variable: info.table_statement_variables) {
+ 929 auto const name =
"t_" + variable->get_name();
+ 930 auto const num_values = variable->get_num_values();
+ 931 if (variable->is_array()) {
+ 932 int array_len = variable->get_length();
+
+ 934 "{} {}[{}][{}]{};", float_type, name, array_len, num_values, value_initialize);
+
+ 936 printer->fmt_line(
"{} {}[{}]{};", float_type, name, num_values, value_initialize);
+
+ 938 codegen_global_variables.push_back(make_symbol(name));
+
+
+
+ 942 for (
const auto& var: info.state_vars) {
+ 943 auto name = var->get_name() +
"0";
+ 944 auto symbol = program_symtab->lookup(name);
+ 945 if (symbol ==
nullptr) {
+ 946 printer->fmt_line(
"{} {}{};", float_type, name, value_initialize);
+ 947 codegen_global_variables.push_back(make_symbol(name));
+
+
+
+ 951 for (
const auto& var: info.global_variables) {
+ 952 auto name = var->get_name();
+ 953 auto length = var->get_length();
+ 954 if (var->is_array()) {
+ 955 printer->fmt_line(
"{} {}[{}] /* TODO init const-array */;", float_type, name, length);
+
+
+ 958 if (
auto const& value_ptr = var->get_value()) {
+
+
+ 961 printer->fmt_line(
"{} {}{};",
+
+
+ 964 print_initializers ? fmt::format(
"{{{:g}}}", value) : std::string{});
+
+ 966 codegen_global_variables.push_back(var);
- 969 if (info.vectorize && info.thread_data_index) {
-
-
-
-
- 974 printer->pop_block(
";");
-
- 976 print_global_var_struct_assertions();
- 977 print_global_var_struct_decl();
-
-
-
-
-
-
- 984 auto variable_printer =
- 985 [&](
const std::vector<SymbolType>& variables,
bool if_array,
bool if_vector) {
- 986 for (
const auto& variable: variables) {
- 987 if (variable->is_array() == if_array) {
-
-
- 990 auto name = get_variable_name(variable->get_name(),
false);
- 991 auto ename = add_escape_quote(variable->get_name() +
"_" + info.mod_suffix);
- 992 auto length = variable->get_length();
-
- 994 printer->fmt_line(
"{{{}, {}, {}}},", ename, name, length);
-
- 996 printer->fmt_line(
"{{{}, &{}}},", ename, name);
-
-
-
-
-
- 1002 auto globals = info.global_variables;
- 1003 auto thread_vars = info.thread_variables;
-
- 1005 if (info.table_count > 0) {
-
-
-
- 1009 printer->add_newline(2);
- 1010 printer->add_line(
"/** connect global (scalar) variables to hoc -- */");
- 1011 printer->add_line(
"static DoubScal hoc_scalar_double[] = {");
- 1012 printer->increase_indent();
- 1013 variable_printer(globals,
false,
false);
- 1014 variable_printer(thread_vars,
false,
false);
- 1015 printer->add_line(
"{nullptr, nullptr}");
- 1016 printer->decrease_indent();
- 1017 printer->add_line(
"};");
-
- 1019 printer->add_newline(2);
- 1020 printer->add_line(
"/** connect global (array) variables to hoc -- */");
- 1021 printer->add_line(
"static DoubVec hoc_vector_double[] = {");
- 1022 printer->increase_indent();
- 1023 variable_printer(globals,
true,
true);
- 1024 variable_printer(thread_vars,
true,
true);
- 1025 printer->add_line(
"{nullptr, nullptr, 0}");
- 1026 printer->decrease_indent();
- 1027 printer->add_line(
"};");
-
- 1029 printer->add_newline(2);
- 1030 printer->add_line(
"/* declaration of user functions */");
- 1031 for (
const auto& procedure: info.procedures) {
- 1032 const auto proc_name = procedure->get_node_name();
- 1033 printer->fmt_line(
"{};", hoc_function_signature(proc_name));
-
- 1035 for (
const auto&
function: info.functions) {
- 1036 const auto func_name =
function->get_node_name();
- 1037 printer->fmt_line(
"{};", hoc_function_signature(func_name));
-
- 1039 if (!info.point_process) {
- 1040 for (
const auto& procedure: info.procedures) {
- 1041 const auto proc_name = procedure->get_node_name();
- 1042 printer->fmt_line(
"{};", py_function_signature(proc_name));
-
- 1044 for (
const auto&
function: info.functions) {
- 1045 const auto func_name =
function->get_node_name();
- 1046 printer->fmt_line(
"{};", py_function_signature(func_name));
-
-
-
- 1050 printer->add_newline(2);
- 1051 printer->add_line(
"/* connect user functions to hoc names */");
- 1052 printer->add_line(
"static VoidFunc hoc_intfunc[] = {");
- 1053 printer->increase_indent();
- 1054 if (info.point_process) {
- 1055 printer->add_line(
"{0, 0}");
- 1056 printer->decrease_indent();
- 1057 printer->add_line(
"};");
- 1058 printer->add_line(
"static Member_func _member_func[] = {");
- 1059 printer->increase_indent();
- 1060 printer->add_multi_line(R
"CODE(
- 1061 {"loc", _hoc_loc_pnt},
- 1062 {"has_loc", _hoc_has_loc},
- 1063 {"get_loc", _hoc_get_loc_pnt},)CODE");
-
- 1065 printer->fmt_line(
"{{\"setdata_{}\", _hoc_setdata}},", info.mod_suffix);
-
-
- 1068 for (
const auto& procedure: info.procedures) {
- 1069 const auto proc_name = procedure->get_node_name();
- 1070 printer->fmt_line(
"{{\"{}{}\", {}}},",
-
-
- 1073 hoc_function_name(proc_name));
-
- 1075 for (
const auto&
function: info.functions) {
- 1076 const auto func_name =
function->get_node_name();
- 1077 printer->fmt_line(
"{{\"{}{}\", {}}},",
-
-
- 1080 hoc_function_name(func_name));
-
-
- 1083 printer->add_line(
"{nullptr, nullptr}");
- 1084 printer->decrease_indent();
- 1085 printer->add_line(
"};");
- 1086 if (!info.point_process) {
- 1087 printer->push_block(
"static NPyDirectMechFunc npy_direct_func_proc[] =");
- 1088 for (
const auto& procedure: info.procedures) {
- 1089 const auto proc_name = procedure->get_node_name();
- 1090 printer->fmt_line(
"{{\"{}\", {}}},", proc_name, py_function_name(proc_name));
-
- 1092 for (
const auto&
function: info.functions) {
- 1093 const auto func_name =
function->get_node_name();
- 1094 printer->fmt_line(
"{{\"{}\", {}}},", func_name, py_function_name(func_name));
-
- 1096 printer->add_line(
"{nullptr, nullptr}");
- 1097 printer->pop_block(
";");
-
-
-
-
-
- 1103 printer->add_newline(2);
- 1104 printer->add_line(
"/** register channel with the simulator */");
- 1105 printer->fmt_push_block(
"extern \"C\" void _{}_reg()", info.mod_file);
- 1106 printer->add_line(
"_initlists();");
- 1107 printer->add_newline();
-
- 1109 for (
const auto& ion: info.ions) {
- 1110 printer->fmt_line(
"ion_reg(\"{}\", {});", ion.name,
"-10000.");
-
- 1112 if (!info.ions.empty()) {
- 1113 printer->add_newline();
-
-
- 1116 for (
const auto& ion: info.ions) {
- 1117 printer->fmt_line(
"_{0}_sym = hoc_lookup(\"{0}_ion\");", ion.name);
-
- 1119 if (!info.ions.empty()) {
- 1120 printer->add_newline();
-
-
- 1123 const auto compute_functions_parameters =
-
- 1125 ? fmt::format(
"{}, {}, {}",
-
-
-
- 1129 :
"nullptr, nullptr, nullptr";
- 1130 const auto register_mech_args = fmt::format(
"{}, {}, {}, {}, {}, {}",
- 1131 get_channel_info_var_name(),
-
- 1133 compute_functions_parameters,
-
-
- 1136 1 + info.thread_data_index);
- 1137 if (info.point_process) {
-
- 1139 "_pointtype = point_register_mech({}, _hoc_create_pnt, _hoc_destroy_pnt, "
-
- 1141 register_mech_args);
-
- 1143 printer->fmt_line(
"register_mech({});", register_mech_args);
-
-
-
- 1147 printer->add_newline();
- 1148 printer->fmt_line(
"mech_type = nrn_get_mechtype({}[1]);", get_channel_info_var_name());
-
-
- 1151 if (info.table_count > 0) {
- 1152 printer->fmt_line(
"_nrn_thread_table_reg(mech_type, {});", table_thread_function_name());
-
-
-
-
-
-
-
-
-
-
-
- 1164 printer->add_line(
"_nrn_mechanism_register_data_fields(mech_type,");
- 1165 printer->increase_indent();
-
- 1167 const auto codegen_float_variables_size = codegen_float_variables.size();
- 1168 std::vector<std::string> mech_register_args;
-
- 1170 for (
int i = 0; i < codegen_float_variables_size; ++i) {
- 1171 const auto& float_var = codegen_float_variables[i];
- 1172 if (float_var->is_array()) {
- 1173 mech_register_args.push_back(
- 1174 fmt::format(
"_nrn_mechanism_field<double>{{\"{}\", {}}} /* {} */",
- 1175 float_var->get_name(),
- 1176 float_var->get_length(),
-
-
- 1179 mech_register_args.push_back(fmt::format(
- 1180 "_nrn_mechanism_field<double>{{\"{}\"}} /* {} */", float_var->get_name(), i));
-
-
-
- 1184 const auto codegen_int_variables_size = codegen_int_variables.size();
- 1185 for (
int i = 0; i < codegen_int_variables_size; ++i) {
- 1186 const auto& int_var = codegen_int_variables[i];
- 1187 const auto& name = int_var.symbol->get_name();
- 1188 if (i != info.semantics[i].index) {
- 1189 throw std::runtime_error(
"Broken logic.");
-
-
- 1192 auto type =
"double*";
-
- 1194 type =
"Point_process*";
-
-
-
- 1198 mech_register_args.push_back(
- 1199 fmt::format(
"_nrn_mechanism_field<{}>{{\"{}\", \"{}\"}} /* {} */",
-
-
- 1202 info.semantics[i].name,
-
-
- 1205 if (info.emit_cvode) {
- 1206 mech_register_args.push_back(
- 1207 "_nrn_mechanism_field<int>{\"_cvode_ieq\", \"cvodeieq\"} /* 0 */");
-
-
- 1210 printer->add_multi_line(fmt::format(
"{}", fmt::join(mech_register_args,
",\n")));
-
- 1212 printer->decrease_indent();
- 1213 printer->add_line(
");");
- 1214 printer->add_newline();
+
+
+ 971 if (!info.function_tables.empty()) {
+ 972 throw std::runtime_error(
"Not implemented, global function tables.");
+
+
+ 975 if (info.vectorize && info.thread_data_index) {
+
+
+
+
+ 980 printer->pop_block(
";");
+
+ 982 print_global_var_struct_assertions();
+ 983 print_global_var_struct_decl();
+
+
+
+
+
+
+ 990 auto variable_printer =
+ 991 [&](
const std::vector<SymbolType>& variables,
bool if_array,
bool if_vector) {
+ 992 for (
const auto& variable: variables) {
+ 993 if (variable->is_array() == if_array) {
+
+
+ 996 auto name = get_variable_name(variable->get_name(),
false);
+ 997 auto ename = add_escape_quote(variable->get_name() +
"_" + info.mod_suffix);
+ 998 auto length = variable->get_length();
+
+ 1000 printer->fmt_line(
"{{{}, {}, {}}},", ename, name, length);
+
+ 1002 printer->fmt_line(
"{{{}, &{}}},", ename, name);
+
+
+
+
+
+ 1008 auto globals = info.global_variables;
+ 1009 auto thread_vars = info.thread_variables;
+
+ 1011 if (info.table_count > 0) {
+
+
+
+ 1015 printer->add_newline(2);
+ 1016 printer->add_line(
"/** connect global (scalar) variables to hoc -- */");
+ 1017 printer->add_line(
"static DoubScal hoc_scalar_double[] = {");
+ 1018 printer->increase_indent();
+ 1019 variable_printer(globals,
false,
false);
+ 1020 variable_printer(thread_vars,
false,
false);
+ 1021 printer->add_line(
"{nullptr, nullptr}");
+ 1022 printer->decrease_indent();
+ 1023 printer->add_line(
"};");
+
+ 1025 printer->add_newline(2);
+ 1026 printer->add_line(
"/** connect global (array) variables to hoc -- */");
+ 1027 printer->add_line(
"static DoubVec hoc_vector_double[] = {");
+ 1028 printer->increase_indent();
+ 1029 variable_printer(globals,
true,
true);
+ 1030 variable_printer(thread_vars,
true,
true);
+ 1031 printer->add_line(
"{nullptr, nullptr, 0}");
+ 1032 printer->decrease_indent();
+ 1033 printer->add_line(
"};");
+
+ 1035 printer->add_newline(2);
+ 1036 printer->add_line(
"/* declaration of user functions */");
+ 1037 for (
const auto& procedure: info.procedures) {
+ 1038 const auto proc_name = procedure->get_node_name();
+ 1039 printer->fmt_line(
"{};", hoc_function_signature(proc_name));
+
+ 1041 for (
const auto&
function: info.functions) {
+ 1042 const auto func_name =
function->get_node_name();
+ 1043 printer->fmt_line(
"{};", hoc_function_signature(func_name));
+
+ 1045 if (!info.point_process) {
+ 1046 for (
const auto& procedure: info.procedures) {
+ 1047 const auto proc_name = procedure->get_node_name();
+ 1048 printer->fmt_line(
"{};", py_function_signature(proc_name));
+
+ 1050 for (
const auto&
function: info.functions) {
+ 1051 const auto func_name =
function->get_node_name();
+ 1052 printer->fmt_line(
"{};", py_function_signature(func_name));
+
+
+
+ 1056 printer->add_newline(2);
+ 1057 printer->add_line(
"/* connect user functions to hoc names */");
+ 1058 printer->add_line(
"static VoidFunc hoc_intfunc[] = {");
+ 1059 printer->increase_indent();
+ 1060 if (info.point_process) {
+ 1061 printer->add_line(
"{0, 0}");
+ 1062 printer->decrease_indent();
+ 1063 printer->add_line(
"};");
+ 1064 printer->add_line(
"static Member_func _member_func[] = {");
+ 1065 printer->increase_indent();
+ 1066 printer->add_multi_line(R
"CODE(
+ 1067 {"loc", _hoc_loc_pnt},
+ 1068 {"has_loc", _hoc_has_loc},
+ 1069 {"get_loc", _hoc_get_loc_pnt},)CODE");
+
+ 1071 printer->fmt_line(
"{{\"setdata_{}\", _hoc_setdata}},", info.mod_suffix);
+
+
+ 1074 for (
const auto& procedure: info.procedures) {
+ 1075 const auto proc_name = procedure->get_node_name();
+ 1076 printer->fmt_line(
"{{\"{}{}\", {}}},",
+
+
+ 1079 hoc_function_name(proc_name));
+
+ 1081 for (
const auto&
function: info.functions) {
+ 1082 const auto func_name =
function->get_node_name();
+ 1083 printer->fmt_line(
"{{\"{}{}\", {}}},",
+
+
+ 1086 hoc_function_name(func_name));
+
+
+ 1089 printer->add_line(
"{nullptr, nullptr}");
+ 1090 printer->decrease_indent();
+ 1091 printer->add_line(
"};");
+ 1092 if (!info.point_process) {
+ 1093 printer->push_block(
"static NPyDirectMechFunc npy_direct_func_proc[] =");
+ 1094 for (
const auto& procedure: info.procedures) {
+ 1095 const auto proc_name = procedure->get_node_name();
+ 1096 printer->fmt_line(
"{{\"{}\", {}}},", proc_name, py_function_name(proc_name));
+
+ 1098 for (
const auto&
function: info.functions) {
+ 1099 const auto func_name =
function->get_node_name();
+ 1100 printer->fmt_line(
"{{\"{}\", {}}},", func_name, py_function_name(func_name));
+
+ 1102 printer->add_line(
"{nullptr, nullptr}");
+ 1103 printer->pop_block(
";");
+
+
+
+
+
+ 1109 printer->add_newline(2);
+ 1110 printer->add_line(
"/** register channel with the simulator */");
+ 1111 printer->fmt_push_block(
"extern \"C\" void _{}_reg()", info.mod_file);
+ 1112 printer->add_line(
"_initlists();");
+ 1113 printer->add_newline();
+
+ 1115 for (
const auto& ion: info.ions) {
+ 1116 printer->fmt_line(
"ion_reg(\"{}\", {});", ion.name,
"-10000.");
+
+ 1118 if (!info.ions.empty()) {
+ 1119 printer->add_newline();
+
+
+ 1122 for (
const auto& ion: info.ions) {
+ 1123 printer->fmt_line(
"_{0}_sym = hoc_lookup(\"{0}_ion\");", ion.name);
+
+ 1125 if (!info.ions.empty()) {
+ 1126 printer->add_newline();
+
+
+ 1129 const auto compute_functions_parameters =
+
+ 1131 ? fmt::format(
"{}, {}, {}",
+
+
+
+ 1135 :
"nullptr, nullptr, nullptr";
+ 1136 const auto register_mech_args = fmt::format(
"{}, {}, {}, {}, {}, {}",
+ 1137 get_channel_info_var_name(),
+
+ 1139 compute_functions_parameters,
+
+
+ 1142 1 + info.thread_data_index);
+ 1143 if (info.point_process) {
+
+ 1145 "_pointtype = point_register_mech({}, _hoc_create_pnt, _hoc_destroy_pnt, "
+
+ 1147 register_mech_args);
+
+ 1149 printer->fmt_line(
"register_mech({});", register_mech_args);
+
+
+
+ 1153 printer->add_newline();
+ 1154 printer->fmt_line(
"mech_type = nrn_get_mechtype({}[1]);", get_channel_info_var_name());
+
+
+ 1157 if (info.table_count > 0) {
+ 1158 printer->fmt_line(
"_nrn_thread_table_reg(mech_type, {});", table_thread_function_name());
+
+
+
+
+
+
+
+
+
+
+
+ 1170 printer->add_line(
"_nrn_mechanism_register_data_fields(mech_type,");
+ 1171 printer->increase_indent();
+
+ 1173 const auto codegen_float_variables_size = codegen_float_variables.size();
+ 1174 std::vector<std::string> mech_register_args;
+
+ 1176 for (
int i = 0; i < codegen_float_variables_size; ++i) {
+ 1177 const auto& float_var = codegen_float_variables[i];
+ 1178 if (float_var->is_array()) {
+ 1179 mech_register_args.push_back(
+ 1180 fmt::format(
"_nrn_mechanism_field<double>{{\"{}\", {}}} /* {} */",
+ 1181 float_var->get_name(),
+ 1182 float_var->get_length(),
+
+
+ 1185 mech_register_args.push_back(fmt::format(
+ 1186 "_nrn_mechanism_field<double>{{\"{}\"}} /* {} */", float_var->get_name(), i));
+
+
+
+ 1190 const auto codegen_int_variables_size = codegen_int_variables.size();
+ 1191 for (
int i = 0; i < codegen_int_variables_size; ++i) {
+ 1192 const auto& int_var = codegen_int_variables[i];
+ 1193 const auto& name = int_var.symbol->get_name();
+ 1194 if (i != info.semantics[i].index) {
+ 1195 throw std::runtime_error(
"Broken logic.");
+
+
+ 1198 auto type =
"double*";
+
+ 1200 type =
"Point_process*";
+
+
+
+ 1204 mech_register_args.push_back(
+ 1205 fmt::format(
"_nrn_mechanism_field<{}>{{\"{}\", \"{}\"}} /* {} */",
+
+
+ 1208 info.semantics[i].name,
+
+
+ 1211 if (info.emit_cvode) {
+ 1212 mech_register_args.push_back(
+ 1213 "_nrn_mechanism_field<int>{\"_cvode_ieq\", \"cvodeieq\"} /* 0 */");
+
-
- 1217 printer->fmt_line(
"hoc_register_prop_size(mech_type, {}, {});",
- 1218 float_variables_size(),
- 1219 int_variables_size());
-
- 1221 for (
int i = 0; i < codegen_int_variables_size; ++i) {
- 1222 if (i != info.semantics[i].index) {
- 1223 throw std::runtime_error(
"Broken logic.");
-
-
- 1226 printer->fmt_line(
"hoc_register_dparam_semantics(mech_type, {}, \"{}\");",
-
- 1228 info.semantics[i].name);
-
-
- 1231 if (info.artificial_cell) {
- 1232 printer->fmt_line(
"add_nrn_artcell(mech_type, {});", info.tqitem_index);
-
-
- 1235 printer->add_line(
"hoc_register_var(hoc_scalar_double, hoc_vector_double, hoc_intfunc);");
- 1236 if (!info.point_process) {
- 1237 printer->add_line(
"hoc_register_npy_direct(mech_type, npy_direct_func_proc);");
-
- 1239 if (info.net_receive_node) {
- 1240 printer->fmt_line(
"pnt_receive[mech_type] = nrn_net_receive_{};", info.mod_suffix);
- 1241 printer->fmt_line(
"pnt_receive_size[mech_type] = {};", info.num_net_receive_parameters);
-
-
- 1244 if (info.thread_callback_register) {
- 1245 printer->add_line(
"_nrn_thread_reg(mech_type, 1, thread_mem_init);");
- 1246 printer->add_line(
"_nrn_thread_reg(mech_type, 0, thread_mem_cleanup);");
-
-
- 1249 printer->pop_block();
-
-
-
-
- 1254 if (!info.thread_callback_register) {
-
-
+ 1216 printer->add_multi_line(fmt::format(
"{}", fmt::join(mech_register_args,
",\n")));
+
+ 1218 printer->decrease_indent();
+ 1219 printer->add_line(
");");
+ 1220 printer->add_newline();
+
+
+ 1223 printer->fmt_line(
"hoc_register_prop_size(mech_type, {}, {});",
+ 1224 float_variables_size(),
+ 1225 int_variables_size());
+
+ 1227 for (
int i = 0; i < codegen_int_variables_size; ++i) {
+ 1228 if (i != info.semantics[i].index) {
+ 1229 throw std::runtime_error(
"Broken logic.");
+
+
+ 1232 printer->fmt_line(
"hoc_register_dparam_semantics(mech_type, {}, \"{}\");",
+
+ 1234 info.semantics[i].name);
+
+
+ 1237 if (info.artificial_cell) {
+ 1238 printer->fmt_line(
"add_nrn_artcell(mech_type, {});", info.tqitem_index);
+
+
+ 1241 printer->add_line(
"hoc_register_var(hoc_scalar_double, hoc_vector_double, hoc_intfunc);");
+ 1242 if (!info.point_process) {
+ 1243 printer->add_line(
"hoc_register_npy_direct(mech_type, npy_direct_func_proc);");
+
+ 1245 if (info.net_receive_node) {
+ 1246 printer->fmt_line(
"pnt_receive[mech_type] = nrn_net_receive_{};", info.mod_suffix);
+ 1247 printer->fmt_line(
"pnt_receive_size[mech_type] = {};", info.num_net_receive_parameters);
+
+
+ 1250 if (info.thread_callback_register) {
+ 1251 printer->add_line(
"_nrn_thread_reg(mech_type, 1, thread_mem_init);");
+ 1252 printer->add_line(
"_nrn_thread_reg(mech_type, 0, thread_mem_cleanup);");
+
+
+ 1255 printer->pop_block();
+
- 1258 auto static_thread_data = get_variable_name(
"thread_data",
false);
- 1259 auto inuse = get_variable_name(
"thread_data_in_use",
false);
- 1260 auto thread_data_index = info.thread_var_thread_id;
- 1261 printer->push_block(
"static void thread_mem_init(Datum* _thread) ");
- 1262 printer->push_block(fmt::format(
"if({})", inuse));
- 1263 printer->fmt_line(
"_thread[{}] = {{neuron::container::do_not_search, new double[{}]{{}}}};",
-
- 1265 info.thread_var_data_size + info.top_local_thread_size);
- 1266 printer->pop_block();
- 1267 printer->push_block(
"else");
- 1268 printer->fmt_line(
"_thread[{}] = {{neuron::container::do_not_search, {}}};",
-
- 1270 static_thread_data);
- 1271 printer->fmt_line(
"{} = 1;", inuse);
+
+
+ 1260 if (!info.thread_callback_register) {
+
+
+
+ 1264 auto static_thread_data = get_variable_name(
"thread_data",
false);
+ 1265 auto inuse = get_variable_name(
"thread_data_in_use",
false);
+ 1266 auto thread_data_index = info.thread_var_thread_id;
+ 1267 printer->push_block(
"static void thread_mem_init(Datum* _thread) ");
+ 1268 printer->push_block(fmt::format(
"if({})", inuse));
+ 1269 printer->fmt_line(
"_thread[{}] = {{neuron::container::do_not_search, new double[{}]{{}}}};",
+
+ 1271 info.thread_var_data_size + info.top_local_thread_size);
1272 printer->pop_block();
- 1273 printer->pop_block();
-
- 1275 printer->push_block(
"static void thread_mem_cleanup(Datum* _thread) ");
- 1276 printer->fmt_line(
"double * _thread_data_ptr = _thread[{}].get<double*>();", thread_data_index);
- 1277 printer->push_block(fmt::format(
"if(_thread_data_ptr == {})", static_thread_data));
- 1278 printer->fmt_line(
"{} = 0;", inuse);
+ 1273 printer->push_block(
"else");
+ 1274 printer->fmt_line(
"_thread[{}] = {{neuron::container::do_not_search, {}}};",
+
+ 1276 static_thread_data);
+ 1277 printer->fmt_line(
"{} = 1;", inuse);
+ 1278 printer->pop_block();
1279 printer->pop_block();
- 1280 printer->push_block(
"else");
- 1281 printer->add_line(
"delete[] _thread_data_ptr;");
- 1282 printer->pop_block();
- 1283 printer->pop_block();
-
-
-
-
- 1288 for (
auto const& [var, type]: info.neuron_global_variables) {
- 1289 auto const name = var->get_name();
- 1290 printer->fmt_line(
"extern {} {};", type, name);
-
-
-
-
- 1295 auto const value_initialize = print_initializers ?
"{}" :
"";
- 1296 auto int_type = default_int_data_type();
- 1297 printer->add_newline(2);
- 1298 printer->add_line(
"/** all mechanism instance variables and global variables */");
- 1299 printer->fmt_push_block(
"struct {} ", instance_struct());
-
- 1301 for (
auto const& [var, type]: info.neuron_global_variables) {
- 1302 auto const name = var->get_name();
- 1303 printer->fmt_line(
"{}* {}{};",
-
-
- 1306 print_initializers ? fmt::format(
"{{&::{}}}", name) : std::string{});
-
- 1308 for (
auto& var: codegen_float_variables) {
- 1309 const auto& name = var->get_name();
- 1310 printer->fmt_line(
"double* {}{};", name, value_initialize);
-
- 1312 for (
auto& var: codegen_int_variables) {
- 1313 const auto& name = var.symbol->get_name();
-
-
- 1316 }
else if (var.is_index || var.is_integer) {
- 1317 auto qualifier = var.is_constant ?
"const " :
"";
- 1318 printer->fmt_line(
"{}{}* const* {}{};", qualifier, int_type, name, value_initialize);
-
- 1320 auto qualifier = var.is_constant ?
"const " :
"";
- 1321 auto type = var.is_vdata ?
"void*" : default_float_data_type();
- 1322 printer->fmt_line(
"{}{}* const* {}{};", qualifier, type, name, value_initialize);
-
-
-
- 1326 printer->fmt_line(
"{}* {}{};",
-
-
- 1329 print_initializers ? fmt::format(
"{{&{}}}", global_struct_instance())
-
- 1331 printer->pop_block(
";");
-
-
-
- 1335 printer->add_newline(2);
- 1336 printer->fmt_push_block(
"static {} make_instance_{}(_nrn_mechanism_cache_range& _lmc)",
-
-
- 1339 printer->fmt_push_block(
"return {}", instance_struct());
-
- 1341 std::vector<std::string> make_instance_args;
-
-
- 1344 for (
auto const& [var, type]: info.neuron_global_variables) {
- 1345 auto const name = var->get_name();
- 1346 make_instance_args.push_back(fmt::format(
"&::{}", name));
-
+
+ 1281 printer->push_block(
"static void thread_mem_cleanup(Datum* _thread) ");
+ 1282 printer->fmt_line(
"double * _thread_data_ptr = _thread[{}].get<double*>();", thread_data_index);
+ 1283 printer->push_block(fmt::format(
"if(_thread_data_ptr == {})", static_thread_data));
+ 1284 printer->fmt_line(
"{} = 0;", inuse);
+ 1285 printer->pop_block();
+ 1286 printer->push_block(
"else");
+ 1287 printer->add_line(
"delete[] _thread_data_ptr;");
+ 1288 printer->pop_block();
+ 1289 printer->pop_block();
+
+
+
+
+ 1294 for (
auto const& [var, type]: info.neuron_global_variables) {
+ 1295 auto const name = var->get_name();
+ 1296 printer->fmt_line(
"extern {} {};", type, name);
+
+
+
+
+ 1301 auto const value_initialize = print_initializers ?
"{}" :
"";
+ 1302 auto int_type = default_int_data_type();
+ 1303 printer->add_newline(2);
+ 1304 printer->add_line(
"/** all mechanism instance variables and global variables */");
+ 1305 printer->fmt_push_block(
"struct {} ", instance_struct());
+
+ 1307 for (
auto const& [var, type]: info.neuron_global_variables) {
+ 1308 auto const name = var->get_name();
+ 1309 printer->fmt_line(
"{}* {}{};",
+
+
+ 1312 print_initializers ? fmt::format(
"{{&::{}}}", name) : std::string{});
+
+ 1314 for (
auto& var: codegen_float_variables) {
+ 1315 const auto& name = var->get_name();
+ 1316 printer->fmt_line(
"double* {}{};", name, value_initialize);
+
+ 1318 for (
auto& var: codegen_int_variables) {
+ 1319 const auto& name = var.symbol->get_name();
+
+
+ 1322 }
else if (var.is_index || var.is_integer) {
+ 1323 auto qualifier = var.is_constant ?
"const " :
"";
+ 1324 printer->fmt_line(
"{}{}* const* {}{};", qualifier, int_type, name, value_initialize);
+
+ 1326 auto qualifier = var.is_constant ?
"const " :
"";
+ 1327 auto type = var.is_vdata ?
"void*" : default_float_data_type();
+ 1328 printer->fmt_line(
"{}{}* const* {}{};", qualifier, type, name, value_initialize);
+
+
+
+ 1332 printer->fmt_line(
"{}* {}{};",
+
+
+ 1335 print_initializers ? fmt::format(
"{{&{}}}", global_struct_instance())
+
+ 1337 printer->pop_block(
";");
+
+
+
+ 1341 printer->add_newline(2);
+ 1342 printer->fmt_push_block(
"static {} make_instance_{}(_nrn_mechanism_cache_range& _lmc)",
+
+
+ 1345 printer->fmt_push_block(
"return {}", instance_struct());
+
+ 1347 std::vector<std::string> make_instance_args;
- 1350 const auto codegen_float_variables_size = codegen_float_variables.size();
- 1351 for (
int i = 0; i < codegen_float_variables_size; ++i) {
- 1352 const auto& float_var = codegen_float_variables[i];
- 1353 if (float_var->is_array()) {
- 1354 make_instance_args.push_back(
- 1355 fmt::format(
"_lmc.template data_array_ptr<{}, {}>()", i, float_var->get_length()));
-
- 1357 make_instance_args.push_back(fmt::format(
"_lmc.template fpfield_ptr<{}>()", i));
-
-
-
- 1361 const auto codegen_int_variables_size = codegen_int_variables.size();
- 1362 for (
size_t i = 0; i < codegen_int_variables_size; ++i) {
- 1363 const auto& var = codegen_int_variables[i];
- 1364 auto name = var.symbol->get_name();
- 1365 auto const variable = [&var, i]() -> std::string {
- 1366 if (var.is_index || var.is_integer) {
-
- 1368 }
else if (var.is_vdata) {
-
-
- 1371 return fmt::format(
"_lmc.template dptr_field_ptr<{}>()", i);
-
-
- 1374 if (variable !=
"") {
- 1375 make_instance_args.push_back(variable);
-
-
-
- 1379 printer->add_multi_line(fmt::format(
"{}", fmt::join(make_instance_args,
",\n")));
-
- 1381 printer->pop_block(
";");
- 1382 printer->pop_block();
-
+ 1350 for (
auto const& [var, type]: info.neuron_global_variables) {
+ 1351 auto const name = var->get_name();
+ 1352 make_instance_args.push_back(fmt::format(
"&::{}", name));
+
+
+
+ 1356 const auto codegen_float_variables_size = codegen_float_variables.size();
+ 1357 for (
int i = 0; i < codegen_float_variables_size; ++i) {
+ 1358 const auto& float_var = codegen_float_variables[i];
+ 1359 if (float_var->is_array()) {
+ 1360 make_instance_args.push_back(
+ 1361 fmt::format(
"_lmc.template data_array_ptr<{}, {}>()", i, float_var->get_length()));
+
+ 1363 make_instance_args.push_back(fmt::format(
"_lmc.template fpfield_ptr<{}>()", i));
+
+
+
+ 1367 const auto codegen_int_variables_size = codegen_int_variables.size();
+ 1368 for (
size_t i = 0; i < codegen_int_variables_size; ++i) {
+ 1369 const auto& var = codegen_int_variables[i];
+ 1370 auto name = var.symbol->get_name();
+ 1371 auto const variable = [&var, i]() -> std::string {
+ 1372 if (var.is_index || var.is_integer) {
+
+ 1374 }
else if (var.is_vdata) {
+
+
+ 1377 return fmt::format(
"_lmc.template dptr_field_ptr<{}>()", i);
+
+
+ 1380 if (variable !=
"") {
+ 1381 make_instance_args.push_back(variable);
+
+
-
- 1386 printer->add_newline(2);
- 1387 printer->fmt_push_block(
"struct {} ", node_data_struct());
-
-
- 1390 printer->add_line(
"int const * nodeindices;");
- 1391 printer->add_line(
"double const * node_voltages;");
- 1392 printer->add_line(
"double * node_diagonal;");
- 1393 printer->add_line(
"double * node_rhs;");
- 1394 printer->add_line(
"int nodecount;");
-
- 1396 printer->pop_block(
";");
-
-
-
- 1400 printer->add_newline(2);
- 1401 printer->fmt_push_block(
"static {} make_node_data_{}(NrnThread& nt, Memb_list& _ml_arg)",
-
-
+ 1385 printer->add_multi_line(fmt::format(
"{}", fmt::join(make_instance_args,
",\n")));
+
+ 1387 printer->pop_block(
";");
+ 1388 printer->pop_block();
+
+
+
+ 1392 printer->add_newline(2);
+ 1393 printer->fmt_push_block(
"struct {} ", node_data_struct());
+
+
+ 1396 printer->add_line(
"int const * nodeindices;");
+ 1397 printer->add_line(
"double const * node_voltages;");
+ 1398 printer->add_line(
"double * node_diagonal;");
+ 1399 printer->add_line(
"double * node_rhs;");
+ 1400 printer->add_line(
"int nodecount;");
+
+ 1402 printer->pop_block(
";");
+
- 1405 std::vector<std::string> make_node_data_args = {
"_ml_arg.nodeindices",
- 1406 "nt.node_voltage_storage()",
- 1407 "nt.node_d_storage()",
- 1408 "nt.node_rhs_storage()",
- 1409 "_ml_arg.nodecount"};
+
+ 1406 printer->add_newline(2);
+ 1407 printer->fmt_push_block(
"static {} make_node_data_{}(NrnThread& nt, Memb_list& _ml_arg)",
+
+
- 1411 printer->fmt_push_block(
"return {}", node_data_struct());
- 1412 printer->add_multi_line(fmt::format(
"{}", fmt::join(make_node_data_args,
",\n")));
-
- 1414 printer->pop_block(
";");
- 1415 printer->pop_block();
-
-
-
- 1419 if (codegen_thread_variables.empty()) {
-
-
-
- 1423 printer->add_newline(2);
- 1424 printer->fmt_push_block(
"struct {} ", thread_variables_struct());
- 1425 printer->add_line(
"double * thread_data;");
- 1426 printer->add_newline();
-
- 1428 std::string simd_width =
"1";
-
-
- 1431 for (
const auto& var_info: codegen_thread_variables) {
- 1432 printer->fmt_push_block(
"double * {}_ptr(size_t id)", var_info.symbol->get_name());
- 1433 printer->fmt_line(
"return thread_data + {} + (id % {});", var_info.offset, simd_width);
- 1434 printer->pop_block();
+ 1411 std::vector<std::string> make_node_data_args = {
"_ml_arg.nodeindices",
+ 1412 "nt.node_voltage_storage()",
+ 1413 "nt.node_d_storage()",
+ 1414 "nt.node_rhs_storage()",
+ 1415 "_ml_arg.nodecount"};
+
+ 1417 printer->fmt_push_block(
"return {}", node_data_struct());
+ 1418 printer->add_multi_line(fmt::format(
"{}", fmt::join(make_node_data_args,
",\n")));
+
+ 1420 printer->pop_block(
";");
+ 1421 printer->pop_block();
+
+
+
+ 1425 if (codegen_thread_variables.empty()) {
+
+
+
+ 1429 printer->add_newline(2);
+ 1430 printer->fmt_push_block(
"struct {} ", thread_variables_struct());
+ 1431 printer->add_line(
"double * thread_data;");
+ 1432 printer->add_newline();
+
+ 1434 std::string simd_width =
"1";
- 1436 printer->fmt_push_block(
"double & {}(size_t id)", var_info.symbol->get_name());
- 1437 printer->fmt_line(
"return thread_data[{} + (id % {})];", var_info.offset, simd_width);
- 1438 printer->pop_block();
-
- 1440 printer->add_newline();
+
+ 1437 for (
const auto& var_info: codegen_thread_variables) {
+ 1438 printer->fmt_push_block(
"double * {}_ptr(size_t id)", var_info.symbol->get_name());
+ 1439 printer->fmt_line(
"return thread_data + {} + (id % {});", var_info.offset, simd_width);
+ 1440 printer->pop_block();
- 1442 printer->push_block(fmt::format(
"{}(double * const thread_data)", thread_variables_struct()));
- 1443 printer->fmt_line(
"this->thread_data = thread_data;");
- 1444 printer->pop_block();
-
- 1446 printer->pop_block(
";");
-
-
-
-
-
-
- 1453 for (
auto& statement: read_statements) {
- 1454 printer->add_line(statement);
-
-
-
- 1458 if (node !=
nullptr) {
-
- 1460 print_statement_block(*block,
false,
false);
+ 1442 printer->fmt_push_block(
"double & {}(size_t id)", var_info.symbol->get_name());
+ 1443 printer->fmt_line(
"return thread_data[{} + (id % {})];", var_info.offset, simd_width);
+ 1444 printer->pop_block();
+
+ 1446 printer->add_newline();
+
+ 1448 printer->push_block(fmt::format(
"{}(double * const thread_data)", thread_variables_struct()));
+ 1449 printer->fmt_line(
"this->thread_data = thread_data;");
+ 1450 printer->pop_block();
+
+ 1452 printer->pop_block(
";");
+
+
+
+
+
+
+ 1459 for (
auto& statement: read_statements) {
+ 1460 printer->add_line(statement);
-
-
- 1465 for (
auto& statement: write_statements) {
-
- 1467 printer->add_line(text);
-
-
-
-
-
- 1473 const std::string& function_name) {
- 1474 std::string method = function_name.empty() ? compute_method_name(type) : function_name;
- 1475 ParamVector args = {{
"",
"const _nrn_model_sorted_token&",
"",
"_sorted_token"},
- 1476 {
"",
"NrnThread*",
"",
"nt"},
- 1477 {
"",
"Memb_list*",
"",
"_ml_arg"},
- 1478 {
"",
"int",
"",
"_type"}};
- 1479 printer->fmt_push_block(
"void {}({})", method, get_parameter_str(args));
-
- 1481 printer->add_line(
"_nrn_mechanism_cache_range _lmc{_sorted_token, *nt, *_ml_arg, _type};");
- 1482 printer->fmt_line(
"auto inst = make_instance_{}(_lmc);", info.mod_suffix);
- 1483 printer->fmt_line(
"auto node_data = make_node_data_{}(*nt, *_ml_arg);", info.mod_suffix);
-
- 1485 printer->add_line(
"auto nodecount = _ml_arg->nodecount;");
- 1486 printer->add_line(
"auto* _thread = _ml_arg->_thread;");
- 1487 if (!codegen_thread_variables.empty()) {
- 1488 printer->fmt_line(
"auto _thread_vars = {}(_thread[{}].get<double*>());",
- 1489 thread_variables_struct(),
- 1490 info.thread_var_thread_id);
-
-
-
-
-
- 1496 printer->add_newline(2);
-
-
+
+ 1464 if (node !=
nullptr) {
+
+ 1466 print_statement_block(*block,
false,
false);
+
+
+
+
+ 1471 for (
auto& statement: write_statements) {
+
+ 1473 printer->add_line(text);
+
+
+
+
+
+ 1479 const std::string& function_name) {
+ 1480 std::string method = function_name.empty() ? compute_method_name(type) : function_name;
+ 1481 ParamVector args = {{
"",
"const _nrn_model_sorted_token&",
"",
"_sorted_token"},
+ 1482 {
"",
"NrnThread*",
"",
"nt"},
+ 1483 {
"",
"Memb_list*",
"",
"_ml_arg"},
+ 1484 {
"",
"int",
"",
"_type"}};
+ 1485 printer->fmt_push_block(
"void {}({})", method, get_parameter_str(args));
+
+ 1487 printer->add_line(
"_nrn_mechanism_cache_range _lmc{_sorted_token, *nt, *_ml_arg, _type};");
+ 1488 printer->fmt_line(
"auto inst = make_instance_{}(_lmc);", info.mod_suffix);
+ 1489 printer->fmt_line(
"auto node_data = make_node_data_{}(*nt, *_ml_arg);", info.mod_suffix);
+
+ 1491 printer->add_line(
"auto nodecount = _ml_arg->nodecount;");
+ 1492 printer->add_line(
"auto* _thread = _ml_arg->_thread;");
+ 1493 if (!codegen_thread_variables.empty()) {
+ 1494 printer->fmt_line(
"auto _thread_vars = {}(_thread[{}].get<double*>());",
+ 1495 thread_variables_struct(),
+ 1496 info.thread_var_thread_id);
+
+
- 1500 printer->push_block(
"for (int id = 0; id < nodecount; id++)");
-
- 1502 printer->add_line(
"auto* _ppvar = _ml_arg->pdata[id];");
- 1503 if (!info.artificial_cell) {
- 1504 printer->add_line(
"int node_id = node_data.nodeindices[id];");
- 1505 printer->add_line(
"auto v = node_data.node_voltages[node_id];");
-
-
-
- 1509 print_initial_block(info.initial_node);
- 1510 printer->pop_block();
-
- 1512 printer->pop_block();
-
+
+
+ 1502 printer->add_newline(2);
+
+
+
+ 1506 printer->push_block(
"for (int id = 0; id < nodecount; id++)");
+
+ 1508 printer->add_line(
"auto* _ppvar = _ml_arg->pdata[id];");
+ 1509 if (!info.artificial_cell) {
+ 1510 printer->add_line(
"int node_id = node_data.nodeindices[id];");
+ 1511 printer->add_line(
"auto v = node_data.node_voltages[node_id];");
+
+
-
- 1516 printer->add_newline(2);
+ 1515 print_initial_block(info.initial_node);
+ 1516 printer->pop_block();
- 1518 ParamVector args = {{
"",
"const _nrn_model_sorted_token&",
"",
"_sorted_token"},
- 1519 {
"",
"NrnThread*",
"",
"nt"},
- 1520 {
"",
"Memb_list*",
"",
"_ml_arg"},
- 1521 {
"",
"int",
"",
"_type"}};
-
- 1523 printer->fmt_push_block(
"static void {}({})",
-
- 1525 get_parameter_str(args));
-
-
- 1528 printer->add_multi_line(
- 1529 "_nrn_mechanism_cache_range _lmc{_sorted_token, *nt, *_ml_arg, _type};");
-
- 1531 printer->fmt_line(
"auto inst = make_instance_{}(_lmc);", info.mod_suffix);
- 1532 printer->fmt_line(
"auto node_data = make_node_data_{}(*nt, *_ml_arg);", info.mod_suffix);
- 1533 printer->fmt_line(
"auto nodecount = _ml_arg->nodecount;");
- 1534 printer->push_block(
"for (int id = 0; id < nodecount; id++)");
-
- 1536 if (breakpoint_exist()) {
- 1537 printer->add_line(
"int node_id = node_data.nodeindices[id];");
- 1538 printer->fmt_line(
"node_data.node_diagonal[node_id] += inst.{}[id];",
-
-
-
-
- 1543 printer->pop_block();
- 1544 printer->pop_block();
-
-
-
-
-
-
+ 1518 printer->pop_block();
+
+
+
+ 1522 printer->add_newline(2);
+
+ 1524 ParamVector args = {{
"",
"const _nrn_model_sorted_token&",
"",
"_sorted_token"},
+ 1525 {
"",
"NrnThread*",
"",
"nt"},
+ 1526 {
"",
"Memb_list*",
"",
"_ml_arg"},
+ 1527 {
"",
"int",
"",
"_type"}};
+
+ 1529 printer->fmt_push_block(
"static void {}({})",
+
+ 1531 get_parameter_str(args));
+
+
+ 1534 printer->add_multi_line(
+ 1535 "_nrn_mechanism_cache_range _lmc{_sorted_token, *nt, *_ml_arg, _type};");
+
+ 1537 printer->fmt_line(
"auto inst = make_instance_{}(_lmc);", info.mod_suffix);
+ 1538 printer->fmt_line(
"auto node_data = make_node_data_{}(*nt, *_ml_arg);", info.mod_suffix);
+ 1539 printer->fmt_line(
"auto nodecount = _ml_arg->nodecount;");
+ 1540 printer->push_block(
"for (int id = 0; id < nodecount; id++)");
+
+ 1542 if (breakpoint_exist()) {
+ 1543 printer->add_line(
"int node_id = node_data.nodeindices[id];");
+ 1544 printer->fmt_line(
"node_data.node_diagonal[node_id] += inst.{}[id];",
+
+
+
+
+ 1549 printer->pop_block();
+ 1550 printer->pop_block();
-
+
-
-
- 1562 printer->add_newline(2);
-
-
- 1565 printer->fmt_push_block(
"static void {}(Prop* _prop)", method);
- 1566 printer->add_multi_line(R
"CODE(
-
-
-
-
- 1571 if (info.point_process) {
- 1572 printer->push_block(
"if (nrn_point_prop_)");
- 1573 printer->add_multi_line(R
"CODE(
- 1574 _nrn_mechanism_access_alloc_seq(_prop) = _nrn_mechanism_access_alloc_seq(nrn_point_prop_);
- 1575 _ppvar = _nrn_mechanism_access_dparam(nrn_point_prop_);
-
- 1577 printer->chain_block("else");
-
- 1579 if (info.semantic_variable_count) {
- 1580 printer->fmt_line(
"_ppvar = nrn_prop_datum_alloc(mech_type, {}, _prop);",
- 1581 info.semantic_variable_count);
- 1582 printer->add_line(
"_nrn_mechanism_access_dparam(_prop) = _ppvar;");
-
- 1584 printer->add_multi_line(R
"CODE(
- 1585 _nrn_mechanism_cache_instance _lmc{_prop};
- 1586 size_t const _iml{};
-
- 1588 printer->fmt_line("assert(_nrn_mechanism_get_num_vars(_prop) == {});",
- 1589 codegen_float_variables.size());
- 1590 if (float_variables_size()) {
- 1591 printer->add_line(
"/*initialize range parameters*/");
- 1592 for (
const auto& var: info.range_parameter_vars) {
- 1593 if (var->is_array()) {
-
-
- 1596 const auto& var_name = var->get_name();
- 1597 auto var_pos = position_of_float_var(var_name);
- 1598 double var_value = var->get_value() ==
nullptr ? 0.0 : *var->get_value();
-
- 1600 printer->fmt_line(
"_lmc.template fpfield<{}>(_iml) = {}; /* {} */",
-
-
-
-
-
- 1606 if (info.point_process) {
- 1607 printer->pop_block();
-
-
- 1610 if (info.semantic_variable_count) {
- 1611 printer->add_line(
"_nrn_mechanism_access_dparam(_prop) = _ppvar;");
-
-
- 1614 const auto codegen_int_variables_size = codegen_int_variables.size();
+
+
+
+
+
+
+
+
+ 1568 printer->add_newline(2);
+
+
+ 1571 printer->fmt_push_block(
"static void {}(Prop* _prop)", method);
+ 1572 printer->add_multi_line(R
"CODE(
+
+
+
+
+ 1577 if (info.point_process) {
+ 1578 printer->push_block(
"if (nrn_point_prop_)");
+ 1579 printer->add_multi_line(R
"CODE(
+ 1580 _nrn_mechanism_access_alloc_seq(_prop) = _nrn_mechanism_access_alloc_seq(nrn_point_prop_);
+ 1581 _ppvar = _nrn_mechanism_access_dparam(nrn_point_prop_);
+
+ 1583 printer->chain_block("else");
+
+ 1585 if (info.semantic_variable_count) {
+ 1586 printer->fmt_line(
"_ppvar = nrn_prop_datum_alloc(mech_type, {}, _prop);",
+ 1587 info.semantic_variable_count);
+ 1588 printer->add_line(
"_nrn_mechanism_access_dparam(_prop) = _ppvar;");
+
+ 1590 printer->add_multi_line(R
"CODE(
+ 1591 _nrn_mechanism_cache_instance _lmc{_prop};
+ 1592 size_t const _iml{};
+
+ 1594 printer->fmt_line("assert(_nrn_mechanism_get_num_vars(_prop) == {});",
+ 1595 codegen_float_variables.size());
+ 1596 if (float_variables_size()) {
+ 1597 printer->add_line(
"/*initialize range parameters*/");
+ 1598 for (
const auto& var: info.range_parameter_vars) {
+ 1599 if (var->is_array()) {
+
+
+ 1602 const auto& var_name = var->get_name();
+ 1603 auto var_pos = position_of_float_var(var_name);
+ 1604 double var_value = var->get_value() ==
nullptr ? 0.0 : *var->get_value();
+
+ 1606 printer->fmt_line(
"_lmc.template fpfield<{}>(_iml) = {}; /* {} */",
+
+
+
+
+
+ 1612 if (info.point_process) {
+ 1613 printer->pop_block();
+
- 1616 if (info.diam_used || info.area_used) {
- 1617 for (
size_t i = 0; i < codegen_int_variables.size(); ++i) {
- 1618 auto var_info = codegen_int_variables[i];
-
- 1620 printer->add_line(
"Symbol * morphology_sym = hoc_lookup(\"morphology\");");
- 1621 printer->fmt_line(
"Prop * morphology_prop = need_memb(morphology_sym);");
-
-
- 1624 "_ppvar[{}] = _nrn_mechanism_get_param_handle(morphology_prop, 0);", i);
-
-
- 1627 printer->fmt_line(
"_ppvar[{}] = _nrn_mechanism_get_area_handle(nrn_alloc_node_);",
-
-
-
-
-
- 1633 for (
const auto& ion: info.ions) {
- 1634 printer->fmt_line(
"Symbol * {}_sym = hoc_lookup(\"{}_ion\");", ion.name, ion.name);
- 1635 printer->fmt_line(
"Prop * {}_prop = need_memb({}_sym);", ion.name, ion.name);
-
- 1637 for (
size_t i = 0; i < codegen_int_variables_size; ++i) {
- 1638 const auto& var = codegen_int_variables[i];
-
-
- 1641 const std::string& var_name = var.symbol->get_name();
- 1642 if (var_name.rfind(
"ion_", 0) != 0) {
-
-
+ 1616 if (info.semantic_variable_count) {
+ 1617 printer->add_line(
"_nrn_mechanism_access_dparam(_prop) = _ppvar;");
+
+
+ 1620 const auto codegen_int_variables_size = codegen_int_variables.size();
+
+ 1622 if (info.diam_used || info.area_used) {
+ 1623 for (
size_t i = 0; i < codegen_int_variables.size(); ++i) {
+ 1624 auto var_info = codegen_int_variables[i];
+
+ 1626 printer->add_line(
"Symbol * morphology_sym = hoc_lookup(\"morphology\");");
+ 1627 printer->fmt_line(
"Prop * morphology_prop = need_memb(morphology_sym);");
+
+
+ 1630 "_ppvar[{}] = _nrn_mechanism_get_param_handle(morphology_prop, 0);", i);
+
+
+ 1633 printer->fmt_line(
"_ppvar[{}] = _nrn_mechanism_get_area_handle(nrn_alloc_node_);",
+
+
+
+
+
+ 1639 for (
const auto& ion: info.ions) {
+ 1640 printer->fmt_line(
"Symbol * {}_sym = hoc_lookup(\"{}_ion\");", ion.name, ion.name);
+ 1641 printer->fmt_line(
"Prop * {}_prop = need_memb({}_sym);", ion.name, ion.name);
+
+ 1643 for (
size_t i = 0; i < codegen_int_variables_size; ++i) {
+ 1644 const auto& var = codegen_int_variables[i];
- 1646 std::string ion_var_name = std::string(var_name.begin() + 4, var_name.end());
- 1647 if (ion.is_ionic_variable(ion_var_name)) {
- 1648 printer->fmt_line(
"_ppvar[{}] = _nrn_mechanism_get_param_handle({}_prop, {});",
-
-
- 1651 ion.variable_index(ion_var_name));
-
-
- 1654 else if (ion.is_current_derivative(ion_var_name)) {
- 1655 printer->fmt_line(
"_ppvar[{}] = _nrn_mechanism_get_param_handle({}_prop, {});",
-
-
- 1658 ion.variable_index(ion_var_name));
-
-
-
-
-
-
-
- 1666 printer->pop_block();
-
-
-
-
-
-
-
-
-
- 1676 if (!nrn_state_required()) {
-
-
-
- 1680 printer->add_newline(2);
-
-
- 1683 printer->push_block(
"for (int id = 0; id < nodecount; id++)");
- 1684 printer->add_line(
"int node_id = node_data.nodeindices[id];");
- 1685 printer->add_line(
"auto* _ppvar = _ml_arg->pdata[id];");
- 1686 printer->add_line(
"auto v = node_data.node_voltages[node_id];");
-
-
-
-
-
- 1692 if (ion_variable_struct_required()) {
- 1693 throw std::runtime_error(
"Not implemented.");
-
-
-
- 1697 for (
auto& statement: read_statements) {
- 1698 printer->add_line(statement);
-
-
- 1701 if (info.nrn_state_block) {
- 1702 info.nrn_state_block->visit_children(*
this);
-
-
- 1705 if (info.currents.empty() && info.breakpoint_node !=
nullptr) {
- 1706 auto block = info.breakpoint_node->get_statement_block();
- 1707 print_statement_block(*block,
false,
false);
-
-
-
- 1711 for (
auto& statement: write_statements) {
- 1712 const auto& text = process_shadow_update_statement(statement,
BlockType::State);
- 1713 printer->add_line(text);
+
+ 1647 const std::string& var_name = var.symbol->get_name();
+ 1648 if (var_name.rfind(
"ion_", 0) != 0) {
+
+
+
+ 1652 std::string ion_var_name = std::string(var_name.begin() + 4, var_name.end());
+ 1653 if (ion.is_ionic_variable(ion_var_name)) {
+ 1654 printer->fmt_line(
"_ppvar[{}] = _nrn_mechanism_get_param_handle({}_prop, {});",
+
+
+ 1657 ion.variable_index(ion_var_name));
+
+
+ 1660 else if (ion.is_current_derivative(ion_var_name)) {
+ 1661 printer->fmt_line(
"_ppvar[{}] = _nrn_mechanism_get_param_handle({}_prop, {});",
+
+
+ 1664 ion.variable_index(ion_var_name));
+
+
+
+
+
+
+
+ 1672 printer->pop_block();
+
+
+
+
+
+
+
+
+
+ 1682 if (!nrn_state_required()) {
+
+
+
+ 1686 printer->add_newline(2);
+
+
+ 1689 printer->push_block(
"for (int id = 0; id < nodecount; id++)");
+ 1690 printer->add_line(
"int node_id = node_data.nodeindices[id];");
+ 1691 printer->add_line(
"auto* _ppvar = _ml_arg->pdata[id];");
+ 1692 printer->add_line(
"auto v = node_data.node_voltages[node_id];");
+
+
+
+
+
+ 1698 if (ion_variable_struct_required()) {
+ 1699 throw std::runtime_error(
"Not implemented.");
+
+
+
+ 1703 for (
auto& statement: read_statements) {
+ 1704 printer->add_line(statement);
+
+
+ 1707 if (info.nrn_state_block) {
+ 1708 info.nrn_state_block->visit_children(*
this);
+
+
+ 1711 if (info.currents.empty() && info.breakpoint_node !=
nullptr) {
+ 1712 auto block = info.breakpoint_node->get_statement_block();
+ 1713 print_statement_block(*block,
false,
false);
- 1716 printer->pop_block();
- 1717 printer->pop_block();
-
-
-
-
-
-
-
-
- 1726 return get_arg_str(nrn_current_parameters());
-
-
-
-
- 1731 if (ion_variable_struct_required()) {
- 1732 throw std::runtime_error(
"Not implemented.");
-
+
+ 1717 for (
auto& statement: write_statements) {
+ 1718 const auto& text = process_shadow_update_statement(statement,
BlockType::State);
+ 1719 printer->add_line(text);
+
+
+ 1722 printer->pop_block();
+ 1723 printer->pop_block();
+
+
+
+
+
+
+
+
+ 1732 return get_arg_str(nrn_current_parameters());
+
- 1735 ParamVector params = {{
"",
"_nrn_mechanism_cache_range&",
"",
"_lmc"},
- 1736 {
"",
"NrnThread*",
"",
"nt"},
- 1737 {
"",
"Datum*",
"",
"_ppvar"},
- 1738 {
"",
"Datum*",
"",
"_thread"}};
-
- 1740 if (info.thread_callback_register) {
- 1741 auto type_name = fmt::format(
"{}&", thread_variables_struct());
- 1742 params.emplace_back(
"", type_name,
"",
"_thread_vars");
-
- 1744 params.emplace_back(
"",
"size_t",
"",
"id");
- 1745 params.emplace_back(
"", fmt::format(
"{}&", instance_struct()),
"",
"inst");
- 1746 params.emplace_back(
"", fmt::format(
"{}&", node_data_struct()),
"",
"node_data");
- 1747 params.emplace_back(
"",
"double",
"",
"v");
-
-
-
-
-
-
- 1754 const auto& args = nrn_current_parameters();
-
- 1756 printer->add_newline(2);
- 1757 printer->fmt_push_block(
"inline double nrn_current_{}({})",
-
- 1759 get_parameter_str(args));
- 1760 printer->add_line(
"double current = 0.0;");
- 1761 print_statement_block(*block,
false,
false);
- 1762 for (
auto& current: info.currents) {
- 1763 const auto& name = get_variable_name(current);
- 1764 printer->fmt_line(
"current += {};", name);
-
- 1766 printer->add_line(
"return current;");
- 1767 printer->pop_block();
-
-
-
-
-
-
- 1774 print_statement_block(*block,
false,
false);
- 1775 if (!info.currents.empty()) {
-
- 1777 for (
const auto& current: info.currents) {
- 1778 auto var = breakpoint_current(current);
- 1779 sum += get_variable_name(var);
- 1780 if (¤t != &info.currents.back()) {
-
-
-
- 1784 printer->fmt_line(
"double rhs = {};", sum);
-
-
-
- 1788 for (
const auto& conductance: info.conductances) {
- 1789 auto var = breakpoint_current(conductance.variable);
- 1790 sum += get_variable_name(var);
- 1791 if (&conductance != &info.conductances.back()) {
-
-
-
- 1795 printer->fmt_line(
"double g = {};", sum);
-
- 1797 for (
const auto& conductance: info.conductances) {
- 1798 if (!conductance.ion.empty()) {
-
-
- 1801 const auto& rhs = get_variable_name(conductance.variable);
-
-
- 1804 printer->add_line(text);
-
-
-
-
-
-
-
- 1812 printer->fmt_line(
"double I1 = nrn_current_{}({}+0.001);",
-
- 1814 nrn_current_arguments());
- 1815 for (
auto& ion: info.ions) {
- 1816 for (
auto& var: ion.writes) {
- 1817 if (ion.is_ionic_current(var)) {
- 1818 const auto& name = get_variable_name(var);
- 1819 printer->fmt_line(
"double di{} = {};", ion.name, name);
-
-
-
- 1823 printer->fmt_line(
"double I0 = nrn_current_{}({});", info.mod_suffix, nrn_current_arguments());
- 1824 printer->add_line(
"double rhs = I0;");
-
- 1826 printer->add_line(
"double g = (I1-I0)/0.001;");
- 1827 for (
auto& ion: info.ions) {
- 1828 for (
auto& var: ion.writes) {
- 1829 if (ion.is_ionic_current(var)) {
-
- 1831 auto rhs = fmt::format(
"(di{}-{})/0.001", ion.name, get_variable_name(var));
- 1832 if (info.point_process) {
-
- 1834 rhs += fmt::format(
"*1.e2/{}", area);
-
-
-
- 1838 printer->add_line(text);
-
-
-
-
-
-
-
-
- 1847 printer->add_line(
"int node_id = node_data.nodeindices[id];");
- 1848 printer->add_line(
"double v = node_data.node_voltages[node_id];");
- 1849 printer->add_line(
"auto* _ppvar = _ml_arg->pdata[id];");
-
- 1851 for (
auto& statement: read_statements) {
- 1852 printer->add_line(statement);
-
-
- 1855 if (info.conductances.empty()) {
- 1856 print_nrn_cur_non_conductance_kernel();
-
- 1858 print_nrn_cur_conductance_kernel(node);
+
+
+ 1737 if (ion_variable_struct_required()) {
+ 1738 throw std::runtime_error(
"Not implemented.");
+
+
+ 1741 ParamVector params = {{
"",
"_nrn_mechanism_cache_range&",
"",
"_lmc"},
+ 1742 {
"",
"NrnThread*",
"",
"nt"},
+ 1743 {
"",
"Datum*",
"",
"_ppvar"},
+ 1744 {
"",
"Datum*",
"",
"_thread"}};
+
+ 1746 if (info.thread_callback_register) {
+ 1747 auto type_name = fmt::format(
"{}&", thread_variables_struct());
+ 1748 params.emplace_back(
"", type_name,
"",
"_thread_vars");
+
+ 1750 params.emplace_back(
"",
"size_t",
"",
"id");
+ 1751 params.emplace_back(
"", fmt::format(
"{}&", instance_struct()),
"",
"inst");
+ 1752 params.emplace_back(
"", fmt::format(
"{}&", node_data_struct()),
"",
"node_data");
+ 1753 params.emplace_back(
"",
"double",
"",
"v");
+
+
+
+
+
+
+ 1760 const auto& args = nrn_current_parameters();
+
+ 1762 printer->add_newline(2);
+ 1763 printer->fmt_push_block(
"inline double nrn_current_{}({})",
+
+ 1765 get_parameter_str(args));
+ 1766 printer->add_line(
"double current = 0.0;");
+ 1767 print_statement_block(*block,
false,
false);
+ 1768 for (
auto& current: info.currents) {
+ 1769 const auto& name = get_variable_name(current);
+ 1770 printer->fmt_line(
"current += {};", name);
+
+ 1772 printer->add_line(
"return current;");
+ 1773 printer->pop_block();
+
+
+
+
+
+
+ 1780 print_statement_block(*block,
false,
false);
+ 1781 if (!info.currents.empty()) {
+
+ 1783 for (
const auto& current: info.currents) {
+ 1784 auto var = breakpoint_current(current);
+ 1785 sum += get_variable_name(var);
+ 1786 if (¤t != &info.currents.back()) {
+
+
+
+ 1790 printer->fmt_line(
"double rhs = {};", sum);
+
+
+
+ 1794 for (
const auto& conductance: info.conductances) {
+ 1795 auto var = breakpoint_current(conductance.variable);
+ 1796 sum += get_variable_name(var);
+ 1797 if (&conductance != &info.conductances.back()) {
+
+
+
+ 1801 printer->fmt_line(
"double g = {};", sum);
+
+ 1803 for (
const auto& conductance: info.conductances) {
+ 1804 if (!conductance.ion.empty()) {
+
+
+ 1807 const auto& rhs = get_variable_name(conductance.variable);
+
+
+ 1810 printer->add_line(text);
+
+
+
+
+
+
+
+ 1818 printer->fmt_line(
"double I1 = nrn_current_{}({}+0.001);",
+
+ 1820 nrn_current_arguments());
+ 1821 for (
auto& ion: info.ions) {
+ 1822 for (
auto& var: ion.writes) {
+ 1823 if (ion.is_ionic_current(var)) {
+ 1824 const auto& name = get_variable_name(var);
+ 1825 printer->fmt_line(
"double di{} = {};", ion.name, name);
+
+
+
+ 1829 printer->fmt_line(
"double I0 = nrn_current_{}({});", info.mod_suffix, nrn_current_arguments());
+ 1830 printer->add_line(
"double rhs = I0;");
+
+ 1832 printer->add_line(
"double g = (I1-I0)/0.001;");
+ 1833 for (
auto& ion: info.ions) {
+ 1834 for (
auto& var: ion.writes) {
+ 1835 if (ion.is_ionic_current(var)) {
+
+ 1837 auto rhs = fmt::format(
"(di{}-{})/0.001", ion.name, get_variable_name(var));
+ 1838 if (info.point_process) {
+
+ 1840 rhs += fmt::format(
"*1.e2/{}", area);
+
+
+
+ 1844 printer->add_line(text);
+
+
+
+
+
+
+
+
+ 1853 printer->add_line(
"int node_id = node_data.nodeindices[id];");
+ 1854 printer->add_line(
"double v = node_data.node_voltages[node_id];");
+ 1855 printer->add_line(
"auto* _ppvar = _ml_arg->pdata[id];");
+
+ 1857 for (
auto& statement: read_statements) {
+ 1858 printer->add_line(statement);
-
- 1862 for (
auto& statement: write_statements) {
-
- 1864 printer->add_line(text);
+ 1861 if (info.conductances.empty()) {
+ 1862 print_nrn_cur_non_conductance_kernel();
+
+ 1864 print_nrn_cur_conductance_kernel(node);
- 1867 if (info.point_process) {
-
- 1869 printer->fmt_line(
"double mfactor = 1.e2/{};", area);
- 1870 printer->add_line(
"g = g*mfactor;");
- 1871 printer->add_line(
"rhs = rhs*mfactor;");
-
-
-
-
-
-
-
-
-
+
+ 1868 for (
auto& statement: write_statements) {
+
+ 1870 printer->add_line(text);
+
+
+ 1873 if (info.point_process) {
+
+ 1875 printer->fmt_line(
"double mfactor = 1.e2/{};", area);
+ 1876 printer->add_line(
"g = g*mfactor;");
+ 1877 printer->add_line(
"rhs = rhs*mfactor;");
+
+
+
-
- 1886 if (!nrn_cur_required()) {
-
-
-
- 1890 if (info.conductances.empty()) {
- 1891 print_nrn_current(*info.breakpoint_node);
-
-
- 1894 printer->add_newline(2);
- 1895 printer->add_line(
"/** update current */");
-
-
- 1898 printer->push_block(
"for (int id = 0; id < nodecount; id++)");
- 1899 print_nrn_cur_kernel(*info.breakpoint_node);
-
-
-
-
-
-
- 1906 printer->add_line(
"node_data.node_rhs[node_id] -= rhs;");
-
- 1908 if (breakpoint_exist()) {
- 1909 printer->fmt_line(
"inst.{}[id] = g;",
-
-
-
- 1913 printer->pop_block();
-
-
-
-
-
-
-
-
-
- 1923 printer->pop_block();
-
-
-
-
-
-
-
-
- 1932 print_standard_includes();
- 1933 print_neuron_includes();
-
- 1935 if (info.thread_callback_register) {
- 1936 printer->add_line(
"extern void _nrn_thread_reg(int, int, void(*)(Datum*));");
-
-
-
+
+
+
+
+
+
+
+ 1892 if (!nrn_cur_required()) {
+
+
+
+ 1896 if (info.conductances.empty()) {
+ 1897 print_nrn_current(*info.breakpoint_node);
+
+
+ 1900 printer->add_newline(2);
+ 1901 printer->add_line(
"/** update current */");
+
+
+ 1904 printer->push_block(
"for (int id = 0; id < nodecount; id++)");
+ 1905 print_nrn_cur_kernel(*info.breakpoint_node);
+
+
+
+
+
+
+ 1912 printer->add_line(
"node_data.node_rhs[node_id] -= rhs;");
+
+ 1914 if (breakpoint_exist()) {
+ 1915 printer->fmt_line(
"inst.{}[id] = g;",
+
+
+
+ 1919 printer->pop_block();
+
+
+
+
+
+
+
+
+
+ 1929 printer->pop_block();
+
+
+
+
+
+
+
+
+ 1938 print_standard_includes();
+ 1939 print_neuron_includes();
-
- 1942 print_global_macros();
- 1943 print_mechanism_variables_macros();
-
- 1945 printer->add_line(
"extern Node* nrn_alloc_node_;");
-
-
-
-
- 1950 printer->add_newline();
- 1951 printer->add_line(
"/* NEURON global macro definitions */");
- 1952 if (info.vectorize) {
- 1953 printer->add_multi_line(R
"CODE(
-
- 1955 #define NRN_VECTORIZED 1
-
-
- 1958 printer->add_multi_line(R
"CODE(
- 1959 /* NOT VECTORIZED */
- 1960 #define NRN_VECTORIZED 0
-
-
-
-
-
-
- 1967 printer->add_newline();
- 1968 printer->add_line(
"static constexpr auto number_of_datum_variables = ",
-
-
- 1971 printer->add_line(
"static constexpr auto number_of_floating_point_variables = ",
-
-
- 1974 printer->add_newline();
- 1975 printer->add_multi_line(R
"CODE(
-
- 1977 template <typename T>
- 1978 using _nrn_mechanism_std_vector = std::vector<T>;
- 1979 using _nrn_model_sorted_token = neuron::model_sorted_token;
- 1980 using _nrn_mechanism_cache_range = neuron::cache::MechanismRange<number_of_floating_point_variables, number_of_datum_variables>;
- 1981 using _nrn_mechanism_cache_instance = neuron::cache::MechanismInstance<number_of_floating_point_variables, number_of_datum_variables>;
- 1982 using _nrn_non_owning_id_without_container = neuron::container::non_owning_identifier_without_container;
+ 1941 if (info.thread_callback_register) {
+ 1942 printer->add_line(
"extern void _nrn_thread_reg(int, int, void(*)(Datum*));");
+
+
+
+
+
+ 1948 print_global_macros();
+ 1949 print_mechanism_variables_macros();
+
+ 1951 printer->add_line(
"extern Node* nrn_alloc_node_;");
+
+
+
+
+ 1956 printer->add_newline();
+ 1957 printer->add_line(
"/* NEURON global macro definitions */");
+ 1958 if (info.vectorize) {
+ 1959 printer->add_multi_line(R
"CODE(
+
+ 1961 #define NRN_VECTORIZED 1
+
+
+ 1964 printer->add_multi_line(R
"CODE(
+ 1965 /* NOT VECTORIZED */
+ 1966 #define NRN_VECTORIZED 0
+
+
+
+
+
+
+ 1973 printer->add_newline();
+ 1974 printer->add_line(
"static constexpr auto number_of_datum_variables = ",
+
+
+ 1977 printer->add_line(
"static constexpr auto number_of_floating_point_variables = ",
+
+
+ 1980 printer->add_newline();
+ 1981 printer->add_multi_line(R
"CODE(
+
1983 template <typename T>
- 1984 using _nrn_mechanism_field = neuron::mechanism::field<T>;
- 1985 template <typename... Args>
- 1986 void _nrn_mechanism_register_data_fields(Args&&... args) {
- 1987 neuron::mechanism::register_data_fields(std::forward<Args>(args)...);
-
-
-
-
- 1992 if (info.point_process) {
- 1993 printer->add_line(
"extern Prop* nrn_point_prop_;");
-
- 1995 printer->add_line(
"Prop* hoc_getdata_range(int type);");
-
-
-
- 1999 if (info.table_count > 0) {
- 2000 printer->add_line(
"void _nrn_thread_table_reg(int, nrn_thread_table_check_t);");
-
-
-
-
-
- 2006 print_namespace_start();
-
-
+ 1984 using _nrn_mechanism_std_vector = std::vector<T>;
+ 1985 using _nrn_model_sorted_token = neuron::model_sorted_token;
+ 1986 using _nrn_mechanism_cache_range = neuron::cache::MechanismRange<number_of_floating_point_variables, number_of_datum_variables>;
+ 1987 using _nrn_mechanism_cache_instance = neuron::cache::MechanismInstance<number_of_floating_point_variables, number_of_datum_variables>;
+ 1988 using _nrn_non_owning_id_without_container = neuron::container::non_owning_identifier_without_container;
+ 1989 template <typename T>
+ 1990 using _nrn_mechanism_field = neuron::mechanism::field<T>;
+ 1991 template <typename... Args>
+ 1992 void _nrn_mechanism_register_data_fields(Args&&... args) {
+ 1993 neuron::mechanism::register_data_fields(std::forward<Args>(args)...);
+
+
+
+
+ 1998 if (info.point_process) {
+ 1999 printer->add_line(
"extern Prop* nrn_point_prop_;");
+
+ 2001 printer->add_line(
"Prop* hoc_getdata_range(int type);");
+
+
+
+ 2005 if (info.table_count > 0) {
+ 2006 printer->add_line(
"void _nrn_thread_table_reg(int, nrn_thread_table_check_t);");
+
+
-
- 2011 print_namespace_stop();
-
-
+
+
+ 2012 print_namespace_start();
+
-
- 2016 print_mechanism_global_var_structure(print_initializers);
- 2017 print_mechanism_range_var_structure(print_initializers);
- 2018 print_node_data_structure(print_initializers);
- 2019 print_thread_variables_structure(print_initializers);
- 2020 print_make_instance();
- 2021 print_make_node_data();
-
-
-
-
- 2026 if (!info.vectorize) {
-
-
- 2029 printer->add_multi_line(R
"CODE(
-
- 2031 inst->v_unused[id] = v;
-
-
-
-
-
-
- 2038 printer->add_multi_line(R
"CODE(
-
- 2040 inst->g_unused[id] = g;
-
-
-
-
-
-
-
- 2048 print_hoc_py_wrapper_function_definitions();
- 2049 for (
const auto& procedure: info.procedures) {
- 2050 print_procedure(*procedure);
-
- 2052 for (
const auto&
function: info.functions) {
- 2053 print_function(*
function);
-
-
-
-
-
- 2059 print_net_receive();
-
-
-
-
-
- 2065 print_backend_info();
- 2066 print_headers_include();
- 2067 print_macro_definitions();
- 2068 print_neuron_global_variable_declarations();
- 2069 print_namespace_begin();
- 2070 print_nmodl_constants();
- 2071 print_prcellstate_macros();
- 2072 print_mechanism_info();
- 2073 print_data_structures(
true);
-
- 2075 print_function_prototypes();
- 2076 print_functors_definitions();
- 2077 print_global_variables_for_hoc();
- 2078 print_thread_memory_callbacks();
- 2079 print_compute_functions();
- 2080 print_sdlists_init(
true);
- 2081 print_mechanism_register();
- 2082 print_namespace_end();
-
-
-
- 2086 throw std::runtime_error(
"Not implemented.");
-
-
-
-
-
-
- 2093 if (printing_net_init) {
- 2094 throw std::runtime_error(
"Not implemented. [jfiwoei]");
-
-
- 2097 std::string weight_pointer =
"nullptr";
-
-
- 2100 if (!printing_net_receive) {
- 2101 point_process +=
".get<Point_process*>()";
-
- 2103 const auto& tqitem = get_variable_name(
"tqitem",
false);
-
- 2105 printer->fmt_text(
"net_send(/* tqitem */ &{}, {}, {}, {} + ",
-
-
-
- 2109 get_variable_name(
"t"));
- 2110 print_vector_elements(arguments,
", ");
- 2111 printer->add_text(
')');
-
-
-
- 2115 const auto& point_process = get_variable_name(
"point_process",
false);
- 2116 const auto& tqitem = get_variable_name(
"tqitem",
false);
-
- 2118 printer->fmt_text(
"net_move(/* tqitem */ &{}, {}, ", tqitem, point_process);
+
+
+ 2017 print_namespace_stop();
+
+
+
+
+ 2022 print_mechanism_global_var_structure(print_initializers);
+ 2023 print_mechanism_range_var_structure(print_initializers);
+ 2024 print_node_data_structure(print_initializers);
+ 2025 print_thread_variables_structure(print_initializers);
+ 2026 print_make_instance();
+ 2027 print_make_node_data();
+
+
+
+
+ 2032 if (!info.vectorize) {
+
+
+ 2035 printer->add_multi_line(R
"CODE(
+
+ 2037 inst->v_unused[id] = v;
+
+
+
+
+
+
+ 2044 printer->add_multi_line(R
"CODE(
+
+ 2046 inst->g_unused[id] = g;
+
+
+
+
+
+
+
+ 2054 print_hoc_py_wrapper_function_definitions();
+ 2055 for (
const auto& procedure: info.procedures) {
+ 2056 print_procedure(*procedure);
+
+ 2058 for (
const auto&
function: info.functions) {
+ 2059 print_function(*
function);
+
+
+
+
+
+ 2065 print_net_receive();
+
+
+
+
+
+ 2071 print_backend_info();
+ 2072 print_headers_include();
+ 2073 print_macro_definitions();
+ 2074 print_neuron_global_variable_declarations();
+ 2075 print_namespace_begin();
+ 2076 print_nmodl_constants();
+ 2077 print_prcellstate_macros();
+ 2078 print_mechanism_info();
+ 2079 print_data_structures(
true);
+
+ 2081 print_function_prototypes();
+ 2082 print_functors_definitions();
+ 2083 print_global_variables_for_hoc();
+ 2084 print_thread_memory_callbacks();
+ 2085 print_compute_functions();
+ 2086 print_sdlists_init(
true);
+ 2087 print_mechanism_register();
+ 2088 print_namespace_end();
+
+
+
+ 2092 throw std::runtime_error(
"Not implemented.");
+
+
+
+
+
+
+ 2099 if (printing_net_init) {
+ 2100 throw std::runtime_error(
"Not implemented. [jfiwoei]");
+
+
+ 2103 std::string weight_pointer =
"nullptr";
+
+
+ 2106 if (!printing_net_receive) {
+ 2107 point_process +=
".get<Point_process*>()";
+
+ 2109 const auto& tqitem = get_variable_name(
"tqitem",
false);
+
+ 2111 printer->fmt_text(
"net_send(/* tqitem */ &{}, {}, {}, {} + ",
+
+
+
+ 2115 get_variable_name(
"t"));
+ 2116 print_vector_elements(arguments,
", ");
+ 2117 printer->add_text(
')');
+
-
- 2121 printer->add_text(
')');
-
+
+ 2121 const auto& point_process = get_variable_name(
"point_process",
false);
+ 2122 const auto& tqitem = get_variable_name(
"tqitem",
false);
-
-
-
- 2127 printer->fmt_text(
"net_event({}, t)", point_process);
+ 2124 printer->fmt_text(
"net_move(/* tqitem */ &{}, {}, ", tqitem, point_process);
+
+
+ 2127 printer->add_text(
')');
-
-
-
-
-
-
-
-
-
+
+
+
+
+ 2133 printer->fmt_text(
"net_event({}, t)", point_process);
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
-
-
- 2151 auto n_parameters = parameters.size();
- 2152 for (
size_t i = 0; i < n_parameters; ++i) {
- 2153 const auto& name = parameters[i]->get_node_name();
-
-
-
-
-
-
-
-
-
- 2163 printing_net_receive =
true;
- 2164 auto node = info.net_receive_node;
-
-
-
-
- 2169 ParamVector args = {{
"",
"Point_process*",
"",
"_pnt"},
- 2170 {
"",
"double*",
"",
"_args"},
- 2171 {
"",
"double",
"",
"flag"}};
-
- 2173 printer->fmt_push_block(
"static void nrn_net_receive_{}({})",
-
- 2175 get_parameter_str(args));
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+ 2157 auto n_parameters = parameters.size();
+ 2158 for (
size_t i = 0; i < n_parameters; ++i) {
+ 2159 const auto& name = parameters[i]->get_node_name();
+
+
+
+
+
+
+
+
+
+ 2169 printing_net_receive =
true;
+ 2170 auto node = info.net_receive_node;
+
+
+
+
+ 2175 ParamVector args = {{
"",
"Point_process*",
"",
"_pnt"},
+ 2176 {
"",
"double*",
"",
"_args"},
+ 2177 {
"",
"double",
"",
"flag"}};
- 2179 printer->add_line(
"_nrn_mechanism_cache_instance _lmc{_pnt->prop};");
- 2180 printer->add_line(
"auto * nt = static_cast<NrnThread*>(_pnt->_vnt);");
- 2181 printer->add_line(
"auto * _ppvar = _nrn_mechanism_access_dparam(_pnt->prop);");
+ 2179 printer->fmt_push_block(
"static void nrn_net_receive_{}({})",
+
+ 2181 get_parameter_str(args));
- 2183 printer->fmt_line(
"auto inst = make_instance_{}(_lmc);", info.mod_suffix);
- 2184 printer->fmt_line(
"// nocmodl has a nullptr dereference for thread variables.");
- 2185 printer->fmt_line(
"// NMODL will fail to compile at a later point, because of");
- 2186 printer->fmt_line(
"// missing '_thread_vars'.");
- 2187 printer->fmt_line(
"Datum * _thread = nullptr;");
+
+
+ 2185 printer->add_line(
"_nrn_mechanism_cache_instance _lmc{_pnt->prop};");
+ 2186 printer->add_line(
"auto * nt = static_cast<NrnThread*>(_pnt->_vnt);");
+ 2187 printer->add_line(
"auto * _ppvar = _nrn_mechanism_access_dparam(_pnt->prop);");
- 2189 printer->add_line(
"size_t id = 0;");
- 2190 printer->add_line(
"double t = nt->_t;");
-
- 2192 print_statement_block(*node->get_statement_block(),
false,
false);
-
- 2194 printer->add_newline();
- 2195 printer->pop_block();
- 2196 printing_net_receive =
false;
-
-
+ 2189 printer->fmt_line(
"auto inst = make_instance_{}(_lmc);", info.mod_suffix);
+ 2190 printer->fmt_line(
"// nocmodl has a nullptr dereference for thread variables.");
+ 2191 printer->fmt_line(
"// NMODL will fail to compile at a later point, because of");
+ 2192 printer->fmt_line(
"// missing '_thread_vars'.");
+ 2193 printer->fmt_line(
"Datum * _thread = nullptr;");
+
+ 2195 printer->add_line(
"size_t id = 0;");
+ 2196 printer->add_line(
"double t = nt->_t;");
+
+ 2198 print_statement_block(*node->get_statement_block(),
false,
false);
-
-
-
-
-
-
-
-
-
-
-
-
+ 2200 printer->add_newline();
+ 2201 printer->pop_block();
+ 2202 printing_net_receive =
false;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-void print_nrn_destructor() override
Print nrn_destructor function definition.
+void print_nrn_destructor() override
Print nrn_destructor function definition.
Base class for all AST node.
bool is_index
if this is pure index (e.g.
-void print_nrn_cur_non_conductance_kernel() override
Print the nrn_cur kernel without NMODL conductance keyword provisions.
+void print_nrn_cur_non_conductance_kernel() override
Print the nrn_cur kernel without NMODL conductance keyword provisions.
std::string py_function_signature(const std::string &function_or_procedure_name) const
Get the signature of the npy <func_or_proc_name> function.
Helper to represent information about index/int variables.
-void print_nrn_cur() override
Print nrn_cur / current update function definition.
-void print_macro_definitions()
Print all NEURON macros.
+void print_nrn_cur() override
Print nrn_cur / current update function definition.
+void print_macro_definitions()
Print all NEURON macros.
-void print_net_event_call(const ast::FunctionCall &node) override
Print call to net_event.
+void print_net_event_call(const ast::FunctionCall &node) override
Print call to net_event.
static constexpr char POINT_PROCESS_VARIABLE[]
inbuilt neuron variable for point process
void print_neuron_includes()
Print includes from NEURON.
static constexpr char NRN_JACOB_METHOD[]
nrn_jacob method in generated code
-void print_nrn_init(bool skip_init_check=true)
Print the nrn_init function definition.
+void print_nrn_init(bool skip_init_check=true)
Print the nrn_init function definition.
void print_hoc_py_wrapper_function_body(const ast::Block *function_or_procedure_block, InterpreterWrapper wrapper_type)
std::string internal_method_arguments() override
Arguments for functions that are defined and used internally.
std::shared_ptr< symtab::Symbol > SymbolType
-void print_nrn_alloc() override
Print nrn_alloc function definition.
+void print_nrn_alloc() override
Print nrn_alloc function definition.
static constexpr char VOLTAGE_UNUSED_VARIABLE[]
range variable for voltage when unused (for vectorized model)
std::string register_mechanism_arguments() const override
Arguments for register_mech or point_register_mech function.
int position_of_int_var(const std::string &name) const override
Determine the position in the data array for a given int variable.
const ArgumentVector & get_parameters() const noexcept override
Getter for member variable NetReceiveBlock::parameters.
-std::string nrn_current_arguments()
+std::string nrn_current_arguments()
std::string table_thread_function_name() const
Name of the threaded table checking function.
bool optimize_ion_variable_copies() const override
Check if ion variable copies should be avoided.
std::string hoc_function_name(const std::string &function_or_procedure_name) const
All functions and procedures need a hoc <func_or_proc_name> to be available to the HOC interpreter.
@@ -2342,30 +2348,30 @@
Visitor for printing C++ code compatible with legacy api of NEURON
std::string backend_name() const override
Name of the code generation backend.
std::string process_verbatim_text(std::string const &text) override
Process a verbatim block for possible variable renaming.
-ParamVector nrn_current_parameters()
+ParamVector nrn_current_parameters()
static constexpr char NTHREAD_DT_VARIABLE[]
dt variable in neuron thread structure
-void print_g_unused() const override
Set g_unused (conductance) for NRN_PRCELLSTATE feature.
-void visit_watch_statement(const ast::WatchStatement &node) override
TODO: Edit for NEURON.
+void print_g_unused() const override
Set g_unused (conductance) for NRN_PRCELLSTATE feature.
+void visit_watch_statement(const ast::WatchStatement &node) override
TODO: Edit for NEURON.
virtual bool is_procedure_block() const noexcept
Check if the ast node is an instance of ast::ProcedureBlock.
-void print_net_send_call(const ast::FunctionCall &node) override
Print call to net_send.
+void print_net_send_call(const ast::FunctionCall &node) override
Print call to net_send.
Check if variable is used in given block.
Implement string manipulation functions.
-void print_namespace_end() override
Print end of namespaces.
-void print_net_move_call(const ast::FunctionCall &node) override
Print call to net_move.
+void print_namespace_end() override
Print end of namespaces.
+void print_net_move_call(const ast::FunctionCall &node) override
Print call to net_move.
std::string thread_variable_name(const ThreadVariableInfo &var_info, bool use_instance=true) const
Determine the C++ string to print for thread variables.
static constexpr char NODE_AREA_VARIABLE[]
inbuilt neuron variable for area of the compartment
-void print_nrn_state() override
Print nrn_state / state update function definition.
+void print_nrn_state() override
Print nrn_state / state update function definition.
virtual bool is_function_block() const noexcept
Check if the ast node is an instance of ast::FunctionBlock.
static constexpr char NRN_ALLOC_METHOD[]
nrn_alloc method in generated code
-void print_initial_block(const ast::InitialBlock *node)
Print the initial block.
+void print_initial_block(const ast::InitialBlock *node)
Print the initial block.
bool is_integer
if this is an integer (e.g.
-void print_global_function_common_code(BlockType type, const std::string &function_name="") override
Print common code for global functions like nrn_init, nrn_cur and nrn_state.
+void print_global_function_common_code(BlockType type, const std::string &function_name="") override
Print common code for global functions like nrn_init, nrn_cur and nrn_state.
std::string float_variable_name(const SymbolType &symbol, bool use_instance) const override
Determine the name of a float variable given its symbol.
void print_function(const ast::FunctionBlock &node) override
Print NMODL function in target backend code.
std::shared_ptr< StatementBlock > get_statement_block() const noexcept override
Getter for member variable BreakpointBlock::statement_block.
void print_hoc_py_wrapper_function_definitions()
-void print_v_unused() const override
Set v_unused (voltage) for NRN_PRCELLSTATE feature.
-void print_ion_variable() override
+void print_v_unused() const override
Set v_unused (voltage) for NRN_PRCELLSTATE feature.
+void print_ion_variable() override
static constexpr char CONDUCTANCE_VARIABLE[]
range variable for conductance
ParamVector functor_params() override
The parameters of the Newton solver "functor".
Visitor for printing C++ code compatible with legacy api of CoreNEURON
@@ -2378,69 +2384,69 @@
@ Equation
breakpoint block
static constexpr char USE_TABLE_VARIABLE[]
global variable to indicate if table is used
Represent WATCH statement in NMODL.
-void print_neuron_global_variable_declarations()
Print extern declarations for neuron global variables.
+void print_neuron_global_variable_declarations()
Print extern declarations for neuron global variables.
Represents a BREAKPOINT block in NMODL.
-void print_nrn_cur_conductance_kernel(const ast::BreakpointBlock &node) override
Print the nrn_cur kernel with NMODL conductance keyword provisions.
+void print_nrn_cur_conductance_kernel(const ast::BreakpointBlock &node) override
Print the nrn_cur kernel with NMODL conductance keyword provisions.
std::string int_variable_name(const IndexVariableInfo &symbol, const std::string &name, bool use_instance) const override
Determine the name of an int variable given its symbol.
InterpreterWrapper
Enum to switch between HOC and Python wrappers for functions and procedures defined in mechanisms.
-void print_namespace_begin() override
Print start of namespaces.
+void print_namespace_begin() override
Print start of namespaces.
-void print_global_variables_for_hoc() override
Print byte arrays that register scalar and vector variables for hoc interface.
+void print_global_variables_for_hoc() override
Print byte arrays that register scalar and vector variables for hoc interface.
void print_standard_includes() override
Print standard C/C++ includes.
-void print_mechanism_range_var_structure(bool print_initializers) override
Print the structure that wraps all range and int variables required for the NMODL.
+void print_mechanism_range_var_structure(bool print_initializers) override
Print the structure that wraps all range and int variables required for the NMODL.
void print_procedure(const ast::ProcedureBlock &node) override
Print NMODL procedure in target backend code.
void add_variable_tqitem(std::vector< IndexVariableInfo > &variables) override
Add the variable tqitem during get_int_variables.
std::string hoc_function_signature(const std::string &function_or_procedure_name) const
Get the signature of the hoc <func_or_proc_name> function.
void print_namespace_start() override
Prints the start of the neuron namespace.
-void print_thread_variables_structure(bool print_initializers)
Print the data structure used to access thread variables.
+void print_thread_variables_structure(bool print_initializers)
Print the data structure used to access thread variables.
std::string to_string(const T &obj)
-void print_compute_functions() override
Print all compute functions for every backend.
+void print_compute_functions() override
Print all compute functions for every backend.
static constexpr char NRN_INIT_METHOD[]
nrn_init method in generated code
const ExpressionVector & get_arguments() const noexcept
Getter for member variable FunctionCall::arguments.
-void print_thread_memory_callbacks()
Print thread variable (de-)initialization functions.
+void print_thread_memory_callbacks()
Print thread variable (de-)initialization functions.
static void rename_net_receive_arguments(const ast::NetReceiveBlock &net_receive_node, const ast::Node &node)
Rename arguments to NET_RECEIVE block with corresponding pointer variable.
-void print_nrn_cur_kernel(const ast::BreakpointBlock &node) override
Print main body of nrn_cur function.
+void print_nrn_cur_kernel(const ast::BreakpointBlock &node) override
Print main body of nrn_cur function.
Blindly rename given variable to new name
static constexpr char NRN_CUR_METHOD[]
nrn_cur method in generated code
std::string conc_write_statement(const std::string &ion_name, const std::string &concentration, int index) override
Generate Function call statement for nrn_wrote_conc.
-void print_mechanism_register() override
Print the mechanism registration function.
+void print_mechanism_register() override
Print the mechanism registration function.
Implement utility functions for codegen visitors.
static constexpr char TQITEM_VARIABLE[]
inbuilt neuron variable for tqitem process
-void print_nrn_jacob()
Print nrn_jacob function definition.
+void print_nrn_jacob()
Print nrn_jacob function definition.
-void print_fast_imem_calculation() override
Print fast membrane current calculation code.
-void print_data_structures(bool print_initializers) override
Print all classes.
+void print_fast_imem_calculation() override
Print fast membrane current calculation code.
+void print_data_structures(bool print_initializers) override
Print all classes.
std::string get_node_name() const override
Return name of the node.
void print_sdlists_init(bool print_initializers) override
const std::string external_method_arguments() noexcept override
Arguments for external functions called from generated code.
std::string py_function_name(const std::string &function_or_procedure_name) const
In non POINT_PROCESS mechanisms all functions and procedures need a py <func_or_proc_name> to be avai...
size_t offset
The global variables ahead of this one require offset doubles to store.
-void print_node_data_structure(bool print_initializers)
Print the structure that wraps all node variables required for the NMODL.
+void print_node_data_structure(bool print_initializers)
Print the structure that wraps all node variables required for the NMODL.
static constexpr char INST_GLOBAL_MEMBER[]
instance struct member pointing to the global variable structure
-void print_make_instance() const
Print make_*_instance.
+void print_make_instance() const
Print make_*_instance.
void print_atomic_reduction_pragma() override
Print atomic update pragma for reduction statements.
NmodlType
NMODL variable properties.
void print_namespace_stop() override
Prints the end of the neuron namespace.
void print_setdata_functions()
Print NEURON functions related to setting global variables of the mechanism.
Represents ion write statement during code generation.
-void print_mechanism_variables_macros()
Print mechanism variables' related macros.
-void print_nrn_constructor() override
Print nrn_constructor function definition.
+void print_mechanism_variables_macros()
Print mechanism variables' related macros.
+void print_nrn_constructor() override
Print nrn_constructor function definition.
void print_check_table_function_prototypes()
Print all check_* function declarations.
std::shared_ptr< StatementBlock > get_statement_block() const noexcept override
Getter for member variable FunctionBlock::statement_block.
BlockType
Helper to represent various block types.
-void print_headers_include() override
Print all includes.
+void print_headers_include() override
Print all includes.
const ParamVector external_method_parameters(bool table=false) noexcept override
Parameters for functions in generated code that are called back from external code.
void print_function_or_procedure(const ast::Block &node, const std::string &name, const std::unordered_set< CppObjectSpecifier > &specifiers={ CppObjectSpecifier::Inline}) override
Print nmodl function or procedure (common code)
static constexpr char NRN_STATE_METHOD[]
nrn_state method in generated code
const std::shared_ptr< symtab::Symbol > symbol
Version information and units file path.
-void print_nrn_current(const ast::BreakpointBlock &node) override
Print the nrn_current kernel.
+void print_nrn_current(const ast::BreakpointBlock &node) override
Print the nrn_current kernel.
int position_of_float_var(const std::string &name) const override
Determine the position in the data array for a given float variable.
std::string get_variable_name(const std::string &name, bool use_instance=true) const override
Determine variable name in the structure of mechanism properties.
static constexpr char AREA_VARIABLE[]
similar to node_area but user can explicitly declare it as area
-void print_make_node_data() const
Print make_*_node_data.
+void print_make_node_data() const
Print make_*_node_data.
virtual std::shared_ptr< StatementBlock > get_statement_block() const
Return associated statement block for the AST node.
std::string simulator_name() override
Name of the simulator the code was generated for.
void print_function_procedure_helper(const ast::Block &node) override
Common helper function to help printing function or procedure blocks.
@@ -2455,16 +2461,16 @@
std::string nrn_thread_arguments() const override
Arguments for "_threadargs_" macro in neuron implementation.
static constexpr char CONDUCTANCE_UNUSED_VARIABLE[]
range variable when conductance is not used (for vectorized model)
-void print_codegen_routines() override
Print entry point to code generation.
+void print_codegen_routines() override
Print entry point to code generation.
static constexpr char NRN_POINTERINDEX[]
hoc_nrnpointerindex name
ParamVector internal_method_parameters() override
Parameters for internally defined functions.
virtual std::string get_node_name() const
Return name of of the node.
Auto generated AST classes declaration.
-void print_net_receive()
Print net_receive call-back.
+void print_net_receive()
Print net_receive call-back.
void print_function_prototypes() override
Print function and procedures prototype declaration.
-void print_mechanism_global_var_structure(bool print_initializers) override
Print the structure that wraps all global variables used in the NMODL.
-void print_global_macros()
Print NEURON global variable macros.
+void print_mechanism_global_var_structure(bool print_initializers) override
Print the structure that wraps all global variables used in the NMODL.
+void print_global_macros()
Print NEURON global variable macros.
std::vector< std::tuple< std::string, std::string, std::string, std::string > > ParamVector
A vector of parameters represented by a 4-tuple of strings:
static constexpr char ION_VARNAME_PREFIX[]
prefix for ion variable
diff --git a/notebooks/nmodl-kinetic-schemes.ipynb b/notebooks/nmodl-kinetic-schemes.ipynb
index 9423ac0c3..cad158aba 100644
--- a/notebooks/nmodl-kinetic-schemes.ipynb
+++ b/notebooks/nmodl-kinetic-schemes.ipynb
@@ -152,10 +152,10 @@
"execution_count": 1,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:11.343181Z",
- "iopub.status.busy": "2024-07-08T14:19:11.342948Z",
- "iopub.status.idle": "2024-07-08T14:19:12.142002Z",
- "shell.execute_reply": "2024-07-08T14:19:12.141214Z"
+ "iopub.execute_input": "2024-07-09T13:27:18.879666Z",
+ "iopub.status.busy": "2024-07-09T13:27:18.879113Z",
+ "iopub.status.idle": "2024-07-09T13:27:19.619276Z",
+ "shell.execute_reply": "2024-07-09T13:27:19.618410Z"
}
},
"outputs": [],
@@ -169,10 +169,10 @@
"execution_count": 2,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:12.145153Z",
- "iopub.status.busy": "2024-07-08T14:19:12.144926Z",
- "iopub.status.idle": "2024-07-08T14:19:12.173471Z",
- "shell.execute_reply": "2024-07-08T14:19:12.172816Z"
+ "iopub.execute_input": "2024-07-09T13:27:19.622702Z",
+ "iopub.status.busy": "2024-07-09T13:27:19.622278Z",
+ "iopub.status.idle": "2024-07-09T13:27:19.648873Z",
+ "shell.execute_reply": "2024-07-09T13:27:19.648278Z"
}
},
"outputs": [],
@@ -277,10 +277,10 @@
"execution_count": 3,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:12.176565Z",
- "iopub.status.busy": "2024-07-08T14:19:12.176282Z",
- "iopub.status.idle": "2024-07-08T14:19:12.181063Z",
- "shell.execute_reply": "2024-07-08T14:19:12.180392Z"
+ "iopub.execute_input": "2024-07-09T13:27:19.651570Z",
+ "iopub.status.busy": "2024-07-09T13:27:19.651308Z",
+ "iopub.status.idle": "2024-07-09T13:27:19.655905Z",
+ "shell.execute_reply": "2024-07-09T13:27:19.655225Z"
}
},
"outputs": [
@@ -323,10 +323,10 @@
"execution_count": 4,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:12.212484Z",
- "iopub.status.busy": "2024-07-08T14:19:12.212210Z",
- "iopub.status.idle": "2024-07-08T14:19:12.217225Z",
- "shell.execute_reply": "2024-07-08T14:19:12.216517Z"
+ "iopub.execute_input": "2024-07-09T13:27:19.684875Z",
+ "iopub.status.busy": "2024-07-09T13:27:19.684393Z",
+ "iopub.status.idle": "2024-07-09T13:27:19.688190Z",
+ "shell.execute_reply": "2024-07-09T13:27:19.687532Z"
}
},
"outputs": [
@@ -367,10 +367,10 @@
"execution_count": 5,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:12.219699Z",
- "iopub.status.busy": "2024-07-08T14:19:12.219477Z",
- "iopub.status.idle": "2024-07-08T14:19:12.223731Z",
- "shell.execute_reply": "2024-07-08T14:19:12.223002Z"
+ "iopub.execute_input": "2024-07-09T13:27:19.690618Z",
+ "iopub.status.busy": "2024-07-09T13:27:19.690173Z",
+ "iopub.status.idle": "2024-07-09T13:27:19.693903Z",
+ "shell.execute_reply": "2024-07-09T13:27:19.693249Z"
},
"scrolled": true
},
@@ -412,10 +412,10 @@
"execution_count": 6,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:12.226274Z",
- "iopub.status.busy": "2024-07-08T14:19:12.226063Z",
- "iopub.status.idle": "2024-07-08T14:19:12.230139Z",
- "shell.execute_reply": "2024-07-08T14:19:12.229453Z"
+ "iopub.execute_input": "2024-07-09T13:27:19.696347Z",
+ "iopub.status.busy": "2024-07-09T13:27:19.695905Z",
+ "iopub.status.idle": "2024-07-09T13:27:19.699730Z",
+ "shell.execute_reply": "2024-07-09T13:27:19.699051Z"
},
"scrolled": true
},
@@ -459,10 +459,10 @@
"execution_count": 7,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:12.233438Z",
- "iopub.status.busy": "2024-07-08T14:19:12.232862Z",
- "iopub.status.idle": "2024-07-08T14:19:12.238022Z",
- "shell.execute_reply": "2024-07-08T14:19:12.237325Z"
+ "iopub.execute_input": "2024-07-09T13:27:19.702048Z",
+ "iopub.status.busy": "2024-07-09T13:27:19.701710Z",
+ "iopub.status.idle": "2024-07-09T13:27:19.706028Z",
+ "shell.execute_reply": "2024-07-09T13:27:19.705375Z"
}
},
"outputs": [
diff --git a/notebooks/nmodl-python-tutorial.ipynb b/notebooks/nmodl-python-tutorial.ipynb
index 6bbe2e92e..29a8f495a 100644
--- a/notebooks/nmodl-python-tutorial.ipynb
+++ b/notebooks/nmodl-python-tutorial.ipynb
@@ -30,10 +30,10 @@
"execution_count": 1,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:17.773745Z",
- "iopub.status.busy": "2024-07-08T14:19:17.773508Z",
- "iopub.status.idle": "2024-07-08T14:19:18.583317Z",
- "shell.execute_reply": "2024-07-08T14:19:18.582499Z"
+ "iopub.execute_input": "2024-07-09T13:27:24.565006Z",
+ "iopub.status.busy": "2024-07-09T13:27:24.564810Z",
+ "iopub.status.idle": "2024-07-09T13:27:25.307028Z",
+ "shell.execute_reply": "2024-07-09T13:27:25.306162Z"
}
},
"outputs": [],
@@ -63,10 +63,10 @@
"execution_count": 2,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:18.586574Z",
- "iopub.status.busy": "2024-07-08T14:19:18.586304Z",
- "iopub.status.idle": "2024-07-08T14:19:18.613678Z",
- "shell.execute_reply": "2024-07-08T14:19:18.612926Z"
+ "iopub.execute_input": "2024-07-09T13:27:25.310263Z",
+ "iopub.status.busy": "2024-07-09T13:27:25.310058Z",
+ "iopub.status.idle": "2024-07-09T13:27:25.334976Z",
+ "shell.execute_reply": "2024-07-09T13:27:25.334393Z"
}
},
"outputs": [],
@@ -86,10 +86,10 @@
"execution_count": 3,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:18.616835Z",
- "iopub.status.busy": "2024-07-08T14:19:18.616603Z",
- "iopub.status.idle": "2024-07-08T14:19:18.620503Z",
- "shell.execute_reply": "2024-07-08T14:19:18.619909Z"
+ "iopub.execute_input": "2024-07-09T13:27:25.337629Z",
+ "iopub.status.busy": "2024-07-09T13:27:25.337237Z",
+ "iopub.status.idle": "2024-07-09T13:27:25.340859Z",
+ "shell.execute_reply": "2024-07-09T13:27:25.340321Z"
}
},
"outputs": [],
@@ -152,10 +152,10 @@
"execution_count": 4,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:18.623065Z",
- "iopub.status.busy": "2024-07-08T14:19:18.622848Z",
- "iopub.status.idle": "2024-07-08T14:19:18.627437Z",
- "shell.execute_reply": "2024-07-08T14:19:18.626783Z"
+ "iopub.execute_input": "2024-07-09T13:27:25.343141Z",
+ "iopub.status.busy": "2024-07-09T13:27:25.342828Z",
+ "iopub.status.idle": "2024-07-09T13:27:25.346646Z",
+ "shell.execute_reply": "2024-07-09T13:27:25.346093Z"
}
},
"outputs": [],
@@ -183,10 +183,10 @@
"execution_count": 5,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:18.630025Z",
- "iopub.status.busy": "2024-07-08T14:19:18.629756Z",
- "iopub.status.idle": "2024-07-08T14:19:18.633773Z",
- "shell.execute_reply": "2024-07-08T14:19:18.633051Z"
+ "iopub.execute_input": "2024-07-09T13:27:25.349113Z",
+ "iopub.status.busy": "2024-07-09T13:27:25.348659Z",
+ "iopub.status.idle": "2024-07-09T13:27:25.352244Z",
+ "shell.execute_reply": "2024-07-09T13:27:25.351628Z"
}
},
"outputs": [
@@ -235,10 +235,10 @@
"execution_count": 6,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:18.636311Z",
- "iopub.status.busy": "2024-07-08T14:19:18.636114Z",
- "iopub.status.idle": "2024-07-08T14:19:18.640682Z",
- "shell.execute_reply": "2024-07-08T14:19:18.640124Z"
+ "iopub.execute_input": "2024-07-09T13:27:25.354849Z",
+ "iopub.status.busy": "2024-07-09T13:27:25.354394Z",
+ "iopub.status.idle": "2024-07-09T13:27:25.358702Z",
+ "shell.execute_reply": "2024-07-09T13:27:25.358079Z"
}
},
"outputs": [],
@@ -260,10 +260,10 @@
"execution_count": 7,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:18.643170Z",
- "iopub.status.busy": "2024-07-08T14:19:18.642970Z",
- "iopub.status.idle": "2024-07-08T14:19:18.646781Z",
- "shell.execute_reply": "2024-07-08T14:19:18.646083Z"
+ "iopub.execute_input": "2024-07-09T13:27:25.361370Z",
+ "iopub.status.busy": "2024-07-09T13:27:25.360884Z",
+ "iopub.status.idle": "2024-07-09T13:27:25.364571Z",
+ "shell.execute_reply": "2024-07-09T13:27:25.363943Z"
}
},
"outputs": [
@@ -297,10 +297,10 @@
"execution_count": 8,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:18.649463Z",
- "iopub.status.busy": "2024-07-08T14:19:18.649062Z",
- "iopub.status.idle": "2024-07-08T14:19:18.656877Z",
- "shell.execute_reply": "2024-07-08T14:19:18.656192Z"
+ "iopub.execute_input": "2024-07-09T13:27:25.366962Z",
+ "iopub.status.busy": "2024-07-09T13:27:25.366605Z",
+ "iopub.status.idle": "2024-07-09T13:27:25.373828Z",
+ "shell.execute_reply": "2024-07-09T13:27:25.373168Z"
}
},
"outputs": [
@@ -365,10 +365,10 @@
"execution_count": 9,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:18.659462Z",
- "iopub.status.busy": "2024-07-08T14:19:18.659251Z",
- "iopub.status.idle": "2024-07-08T14:19:18.663832Z",
- "shell.execute_reply": "2024-07-08T14:19:18.663176Z"
+ "iopub.execute_input": "2024-07-09T13:27:25.376286Z",
+ "iopub.status.busy": "2024-07-09T13:27:25.375921Z",
+ "iopub.status.idle": "2024-07-09T13:27:25.380482Z",
+ "shell.execute_reply": "2024-07-09T13:27:25.379789Z"
}
},
"outputs": [
@@ -416,10 +416,10 @@
"execution_count": 10,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:18.666269Z",
- "iopub.status.busy": "2024-07-08T14:19:18.666074Z",
- "iopub.status.idle": "2024-07-08T14:19:18.669857Z",
- "shell.execute_reply": "2024-07-08T14:19:18.669188Z"
+ "iopub.execute_input": "2024-07-09T13:27:25.383083Z",
+ "iopub.status.busy": "2024-07-09T13:27:25.382725Z",
+ "iopub.status.idle": "2024-07-09T13:27:25.385884Z",
+ "shell.execute_reply": "2024-07-09T13:27:25.385371Z"
}
},
"outputs": [],
@@ -441,10 +441,10 @@
"execution_count": 11,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:18.672469Z",
- "iopub.status.busy": "2024-07-08T14:19:18.672262Z",
- "iopub.status.idle": "2024-07-08T14:19:18.676241Z",
- "shell.execute_reply": "2024-07-08T14:19:18.675532Z"
+ "iopub.execute_input": "2024-07-09T13:27:25.388228Z",
+ "iopub.status.busy": "2024-07-09T13:27:25.387868Z",
+ "iopub.status.idle": "2024-07-09T13:27:25.391851Z",
+ "shell.execute_reply": "2024-07-09T13:27:25.391164Z"
}
},
"outputs": [
@@ -510,10 +510,10 @@
"execution_count": 12,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:18.678863Z",
- "iopub.status.busy": "2024-07-08T14:19:18.678417Z",
- "iopub.status.idle": "2024-07-08T14:19:18.682345Z",
- "shell.execute_reply": "2024-07-08T14:19:18.681608Z"
+ "iopub.execute_input": "2024-07-09T13:27:25.394094Z",
+ "iopub.status.busy": "2024-07-09T13:27:25.393897Z",
+ "iopub.status.idle": "2024-07-09T13:27:25.397165Z",
+ "shell.execute_reply": "2024-07-09T13:27:25.396508Z"
}
},
"outputs": [
@@ -548,10 +548,10 @@
"execution_count": 13,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:18.684840Z",
- "iopub.status.busy": "2024-07-08T14:19:18.684633Z",
- "iopub.status.idle": "2024-07-08T14:19:18.688452Z",
- "shell.execute_reply": "2024-07-08T14:19:18.687745Z"
+ "iopub.execute_input": "2024-07-09T13:27:25.399613Z",
+ "iopub.status.busy": "2024-07-09T13:27:25.399257Z",
+ "iopub.status.idle": "2024-07-09T13:27:25.402695Z",
+ "shell.execute_reply": "2024-07-09T13:27:25.402051Z"
}
},
"outputs": [
@@ -584,10 +584,10 @@
"execution_count": 14,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:18.690987Z",
- "iopub.status.busy": "2024-07-08T14:19:18.690790Z",
- "iopub.status.idle": "2024-07-08T14:19:18.694530Z",
- "shell.execute_reply": "2024-07-08T14:19:18.693795Z"
+ "iopub.execute_input": "2024-07-09T13:27:25.405242Z",
+ "iopub.status.busy": "2024-07-09T13:27:25.404893Z",
+ "iopub.status.idle": "2024-07-09T13:27:25.408544Z",
+ "shell.execute_reply": "2024-07-09T13:27:25.407900Z"
}
},
"outputs": [
@@ -622,10 +622,10 @@
"execution_count": 15,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:18.696897Z",
- "iopub.status.busy": "2024-07-08T14:19:18.696703Z",
- "iopub.status.idle": "2024-07-08T14:19:18.701003Z",
- "shell.execute_reply": "2024-07-08T14:19:18.700285Z"
+ "iopub.execute_input": "2024-07-09T13:27:25.410988Z",
+ "iopub.status.busy": "2024-07-09T13:27:25.410510Z",
+ "iopub.status.idle": "2024-07-09T13:27:25.414659Z",
+ "shell.execute_reply": "2024-07-09T13:27:25.414021Z"
}
},
"outputs": [
@@ -669,10 +669,10 @@
"execution_count": 16,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:18.703593Z",
- "iopub.status.busy": "2024-07-08T14:19:18.703371Z",
- "iopub.status.idle": "2024-07-08T14:19:18.709089Z",
- "shell.execute_reply": "2024-07-08T14:19:18.708371Z"
+ "iopub.execute_input": "2024-07-09T13:27:25.417169Z",
+ "iopub.status.busy": "2024-07-09T13:27:25.416737Z",
+ "iopub.status.idle": "2024-07-09T13:27:25.422069Z",
+ "shell.execute_reply": "2024-07-09T13:27:25.421431Z"
}
},
"outputs": [
@@ -733,10 +733,10 @@
"execution_count": 17,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:18.711847Z",
- "iopub.status.busy": "2024-07-08T14:19:18.711608Z",
- "iopub.status.idle": "2024-07-08T14:19:18.715630Z",
- "shell.execute_reply": "2024-07-08T14:19:18.714908Z"
+ "iopub.execute_input": "2024-07-09T13:27:25.424400Z",
+ "iopub.status.busy": "2024-07-09T13:27:25.424062Z",
+ "iopub.status.idle": "2024-07-09T13:27:25.427587Z",
+ "shell.execute_reply": "2024-07-09T13:27:25.426950Z"
}
},
"outputs": [],
@@ -761,10 +761,10 @@
"execution_count": 18,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:18.718205Z",
- "iopub.status.busy": "2024-07-08T14:19:18.717990Z",
- "iopub.status.idle": "2024-07-08T14:19:18.728725Z",
- "shell.execute_reply": "2024-07-08T14:19:18.728117Z"
+ "iopub.execute_input": "2024-07-09T13:27:25.429846Z",
+ "iopub.status.busy": "2024-07-09T13:27:25.429512Z",
+ "iopub.status.idle": "2024-07-09T13:27:25.439668Z",
+ "shell.execute_reply": "2024-07-09T13:27:25.439009Z"
}
},
"outputs": [],
@@ -857,10 +857,10 @@
"execution_count": 19,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:18.731260Z",
- "iopub.status.busy": "2024-07-08T14:19:18.731026Z",
- "iopub.status.idle": "2024-07-08T14:19:18.735329Z",
- "shell.execute_reply": "2024-07-08T14:19:18.734631Z"
+ "iopub.execute_input": "2024-07-09T13:27:25.442305Z",
+ "iopub.status.busy": "2024-07-09T13:27:25.441864Z",
+ "iopub.status.idle": "2024-07-09T13:27:25.445493Z",
+ "shell.execute_reply": "2024-07-09T13:27:25.444848Z"
}
},
"outputs": [
@@ -897,10 +897,10 @@
"execution_count": 20,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:18.737758Z",
- "iopub.status.busy": "2024-07-08T14:19:18.737554Z",
- "iopub.status.idle": "2024-07-08T14:19:18.743435Z",
- "shell.execute_reply": "2024-07-08T14:19:18.742749Z"
+ "iopub.execute_input": "2024-07-09T13:27:25.447825Z",
+ "iopub.status.busy": "2024-07-09T13:27:25.447490Z",
+ "iopub.status.idle": "2024-07-09T13:27:25.452827Z",
+ "shell.execute_reply": "2024-07-09T13:27:25.452173Z"
}
},
"outputs": [
diff --git a/notebooks/nmodl-sympy-conductance.ipynb b/notebooks/nmodl-sympy-conductance.ipynb
index 6e10fa6ad..dfc8325fb 100644
--- a/notebooks/nmodl-sympy-conductance.ipynb
+++ b/notebooks/nmodl-sympy-conductance.ipynb
@@ -86,10 +86,10 @@
"execution_count": 1,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:21.317356Z",
- "iopub.status.busy": "2024-07-08T14:19:21.316786Z",
- "iopub.status.idle": "2024-07-08T14:19:22.121495Z",
- "shell.execute_reply": "2024-07-08T14:19:22.120676Z"
+ "iopub.execute_input": "2024-07-09T13:27:27.777219Z",
+ "iopub.status.busy": "2024-07-09T13:27:27.776676Z",
+ "iopub.status.idle": "2024-07-09T13:27:28.520529Z",
+ "shell.execute_reply": "2024-07-09T13:27:28.519763Z"
}
},
"outputs": [],
@@ -103,10 +103,10 @@
"execution_count": 2,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:22.125074Z",
- "iopub.status.busy": "2024-07-08T14:19:22.124482Z",
- "iopub.status.idle": "2024-07-08T14:19:22.153146Z",
- "shell.execute_reply": "2024-07-08T14:19:22.152468Z"
+ "iopub.execute_input": "2024-07-09T13:27:28.523640Z",
+ "iopub.status.busy": "2024-07-09T13:27:28.523224Z",
+ "iopub.status.idle": "2024-07-09T13:27:28.550057Z",
+ "shell.execute_reply": "2024-07-09T13:27:28.549480Z"
}
},
"outputs": [],
@@ -149,10 +149,10 @@
"execution_count": 3,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:22.156578Z",
- "iopub.status.busy": "2024-07-08T14:19:22.156052Z",
- "iopub.status.idle": "2024-07-08T14:19:22.440666Z",
- "shell.execute_reply": "2024-07-08T14:19:22.439889Z"
+ "iopub.execute_input": "2024-07-09T13:27:28.552827Z",
+ "iopub.status.busy": "2024-07-09T13:27:28.552470Z",
+ "iopub.status.idle": "2024-07-09T13:27:28.813885Z",
+ "shell.execute_reply": "2024-07-09T13:27:28.813179Z"
}
},
"outputs": [
@@ -196,10 +196,10 @@
"execution_count": 4,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:22.443723Z",
- "iopub.status.busy": "2024-07-08T14:19:22.443084Z",
- "iopub.status.idle": "2024-07-08T14:19:22.597116Z",
- "shell.execute_reply": "2024-07-08T14:19:22.596399Z"
+ "iopub.execute_input": "2024-07-09T13:27:28.816535Z",
+ "iopub.status.busy": "2024-07-09T13:27:28.816245Z",
+ "iopub.status.idle": "2024-07-09T13:27:28.944724Z",
+ "shell.execute_reply": "2024-07-09T13:27:28.944134Z"
}
},
"outputs": [
@@ -243,10 +243,10 @@
"execution_count": 5,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:22.599924Z",
- "iopub.status.busy": "2024-07-08T14:19:22.599697Z",
- "iopub.status.idle": "2024-07-08T14:19:22.608506Z",
- "shell.execute_reply": "2024-07-08T14:19:22.607749Z"
+ "iopub.execute_input": "2024-07-09T13:27:28.947449Z",
+ "iopub.status.busy": "2024-07-09T13:27:28.947044Z",
+ "iopub.status.idle": "2024-07-09T13:27:28.954909Z",
+ "shell.execute_reply": "2024-07-09T13:27:28.954257Z"
}
},
"outputs": [
@@ -290,10 +290,10 @@
"execution_count": 6,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:22.611253Z",
- "iopub.status.busy": "2024-07-08T14:19:22.611025Z",
- "iopub.status.idle": "2024-07-08T14:19:22.629729Z",
- "shell.execute_reply": "2024-07-08T14:19:22.629073Z"
+ "iopub.execute_input": "2024-07-09T13:27:28.957318Z",
+ "iopub.status.busy": "2024-07-09T13:27:28.956974Z",
+ "iopub.status.idle": "2024-07-09T13:27:28.974112Z",
+ "shell.execute_reply": "2024-07-09T13:27:28.973449Z"
}
},
"outputs": [
@@ -337,10 +337,10 @@
"execution_count": 7,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:22.632430Z",
- "iopub.status.busy": "2024-07-08T14:19:22.632200Z",
- "iopub.status.idle": "2024-07-08T14:19:22.762561Z",
- "shell.execute_reply": "2024-07-08T14:19:22.761830Z"
+ "iopub.execute_input": "2024-07-09T13:27:28.976838Z",
+ "iopub.status.busy": "2024-07-09T13:27:28.976422Z",
+ "iopub.status.idle": "2024-07-09T13:27:29.095599Z",
+ "shell.execute_reply": "2024-07-09T13:27:29.094930Z"
}
},
"outputs": [
@@ -400,10 +400,10 @@
"execution_count": 8,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:22.765393Z",
- "iopub.status.busy": "2024-07-08T14:19:22.765161Z",
- "iopub.status.idle": "2024-07-08T14:19:22.870422Z",
- "shell.execute_reply": "2024-07-08T14:19:22.869740Z"
+ "iopub.execute_input": "2024-07-09T13:27:29.098318Z",
+ "iopub.status.busy": "2024-07-09T13:27:29.097913Z",
+ "iopub.status.idle": "2024-07-09T13:27:29.191411Z",
+ "shell.execute_reply": "2024-07-09T13:27:29.190802Z"
}
},
"outputs": [
@@ -456,10 +456,10 @@
"execution_count": 9,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:22.873175Z",
- "iopub.status.busy": "2024-07-08T14:19:22.872935Z",
- "iopub.status.idle": "2024-07-08T14:19:22.948171Z",
- "shell.execute_reply": "2024-07-08T14:19:22.947424Z"
+ "iopub.execute_input": "2024-07-09T13:27:29.194044Z",
+ "iopub.status.busy": "2024-07-09T13:27:29.193566Z",
+ "iopub.status.idle": "2024-07-09T13:27:29.267305Z",
+ "shell.execute_reply": "2024-07-09T13:27:29.266647Z"
}
},
"outputs": [
diff --git a/notebooks/nmodl-sympy-solver-cnexp.ipynb b/notebooks/nmodl-sympy-solver-cnexp.ipynb
index 012809611..cab0fdb71 100644
--- a/notebooks/nmodl-sympy-solver-cnexp.ipynb
+++ b/notebooks/nmodl-sympy-solver-cnexp.ipynb
@@ -62,10 +62,10 @@
"execution_count": 1,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:24.812751Z",
- "iopub.status.busy": "2024-07-08T14:19:24.812436Z",
- "iopub.status.idle": "2024-07-08T14:19:25.623956Z",
- "shell.execute_reply": "2024-07-08T14:19:25.623195Z"
+ "iopub.execute_input": "2024-07-09T13:27:30.919502Z",
+ "iopub.status.busy": "2024-07-09T13:27:30.918912Z",
+ "iopub.status.idle": "2024-07-09T13:27:31.702525Z",
+ "shell.execute_reply": "2024-07-09T13:27:31.701626Z"
}
},
"outputs": [],
@@ -79,10 +79,10 @@
"execution_count": 2,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:25.627345Z",
- "iopub.status.busy": "2024-07-08T14:19:25.627111Z",
- "iopub.status.idle": "2024-07-08T14:19:25.658122Z",
- "shell.execute_reply": "2024-07-08T14:19:25.657332Z"
+ "iopub.execute_input": "2024-07-09T13:27:31.706530Z",
+ "iopub.status.busy": "2024-07-09T13:27:31.705877Z",
+ "iopub.status.idle": "2024-07-09T13:27:31.741957Z",
+ "shell.execute_reply": "2024-07-09T13:27:31.741225Z"
}
},
"outputs": [],
@@ -123,10 +123,10 @@
"execution_count": 3,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:25.661405Z",
- "iopub.status.busy": "2024-07-08T14:19:25.661126Z",
- "iopub.status.idle": "2024-07-08T14:19:26.125710Z",
- "shell.execute_reply": "2024-07-08T14:19:26.124931Z"
+ "iopub.execute_input": "2024-07-09T13:27:31.745171Z",
+ "iopub.status.busy": "2024-07-09T13:27:31.744648Z",
+ "iopub.status.idle": "2024-07-09T13:27:32.154787Z",
+ "shell.execute_reply": "2024-07-09T13:27:32.154053Z"
}
},
"outputs": [
@@ -165,10 +165,10 @@
"execution_count": 4,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:26.128804Z",
- "iopub.status.busy": "2024-07-08T14:19:26.128316Z",
- "iopub.status.idle": "2024-07-08T14:19:26.268524Z",
- "shell.execute_reply": "2024-07-08T14:19:26.267745Z"
+ "iopub.execute_input": "2024-07-09T13:27:32.157331Z",
+ "iopub.status.busy": "2024-07-09T13:27:32.157083Z",
+ "iopub.status.idle": "2024-07-09T13:27:32.267475Z",
+ "shell.execute_reply": "2024-07-09T13:27:32.266883Z"
}
},
"outputs": [
@@ -207,10 +207,10 @@
"execution_count": 5,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:26.271283Z",
- "iopub.status.busy": "2024-07-08T14:19:26.271054Z",
- "iopub.status.idle": "2024-07-08T14:19:26.510893Z",
- "shell.execute_reply": "2024-07-08T14:19:26.510102Z"
+ "iopub.execute_input": "2024-07-09T13:27:32.270004Z",
+ "iopub.status.busy": "2024-07-09T13:27:32.269616Z",
+ "iopub.status.idle": "2024-07-09T13:27:32.465938Z",
+ "shell.execute_reply": "2024-07-09T13:27:32.465298Z"
}
},
"outputs": [
@@ -255,10 +255,10 @@
"execution_count": 6,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:26.513860Z",
- "iopub.status.busy": "2024-07-08T14:19:26.513445Z",
- "iopub.status.idle": "2024-07-08T14:19:26.712459Z",
- "shell.execute_reply": "2024-07-08T14:19:26.711798Z"
+ "iopub.execute_input": "2024-07-09T13:27:32.468624Z",
+ "iopub.status.busy": "2024-07-09T13:27:32.468244Z",
+ "iopub.status.idle": "2024-07-09T13:27:32.626132Z",
+ "shell.execute_reply": "2024-07-09T13:27:32.625531Z"
}
},
"outputs": [
@@ -266,7 +266,13 @@
"name": "stdout",
"output_type": "stream",
"text": [
- "exact solution:\t m = minf+(m-minf)*exp(dt/mtau)\n",
+ "exact solution:\t m = minf+(m-minf)*exp(dt/mtau)\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
"pade approx:\t m = (-dt*m+2.0*dt*minf-2.0*m*mtau)/(dt-2.0*mtau)\n"
]
}
@@ -297,10 +303,10 @@
"execution_count": 7,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:26.715318Z",
- "iopub.status.busy": "2024-07-08T14:19:26.714907Z",
- "iopub.status.idle": "2024-07-08T14:19:28.190861Z",
- "shell.execute_reply": "2024-07-08T14:19:28.190133Z"
+ "iopub.execute_input": "2024-07-09T13:27:32.628646Z",
+ "iopub.status.busy": "2024-07-09T13:27:32.628279Z",
+ "iopub.status.idle": "2024-07-09T13:27:34.367276Z",
+ "shell.execute_reply": "2024-07-09T13:27:34.366563Z"
}
},
"outputs": [
@@ -345,10 +351,10 @@
"execution_count": 8,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:28.193841Z",
- "iopub.status.busy": "2024-07-08T14:19:28.193380Z",
- "iopub.status.idle": "2024-07-08T14:19:30.056617Z",
- "shell.execute_reply": "2024-07-08T14:19:30.055913Z"
+ "iopub.execute_input": "2024-07-09T13:27:34.370079Z",
+ "iopub.status.busy": "2024-07-09T13:27:34.369583Z",
+ "iopub.status.idle": "2024-07-09T13:27:36.631315Z",
+ "shell.execute_reply": "2024-07-09T13:27:36.630600Z"
}
},
"outputs": [
diff --git a/notebooks/nmodl-sympy-solver-derivimplicit.ipynb b/notebooks/nmodl-sympy-solver-derivimplicit.ipynb
index 4a707599d..09270d192 100644
--- a/notebooks/nmodl-sympy-solver-derivimplicit.ipynb
+++ b/notebooks/nmodl-sympy-solver-derivimplicit.ipynb
@@ -39,10 +39,10 @@
"execution_count": 1,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:32.049185Z",
- "iopub.status.busy": "2024-07-08T14:19:32.048967Z",
- "iopub.status.idle": "2024-07-08T14:19:32.852052Z",
- "shell.execute_reply": "2024-07-08T14:19:32.851318Z"
+ "iopub.execute_input": "2024-07-09T13:27:38.260239Z",
+ "iopub.status.busy": "2024-07-09T13:27:38.259777Z",
+ "iopub.status.idle": "2024-07-09T13:27:39.005106Z",
+ "shell.execute_reply": "2024-07-09T13:27:39.004375Z"
}
},
"outputs": [],
@@ -56,10 +56,10 @@
"execution_count": 2,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:32.855192Z",
- "iopub.status.busy": "2024-07-08T14:19:32.854969Z",
- "iopub.status.idle": "2024-07-08T14:19:32.884763Z",
- "shell.execute_reply": "2024-07-08T14:19:32.883964Z"
+ "iopub.execute_input": "2024-07-09T13:27:39.008134Z",
+ "iopub.status.busy": "2024-07-09T13:27:39.007923Z",
+ "iopub.status.idle": "2024-07-09T13:27:39.035527Z",
+ "shell.execute_reply": "2024-07-09T13:27:39.034845Z"
}
},
"outputs": [],
@@ -100,10 +100,10 @@
"execution_count": 3,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:32.888300Z",
- "iopub.status.busy": "2024-07-08T14:19:32.887833Z",
- "iopub.status.idle": "2024-07-08T14:19:33.384183Z",
- "shell.execute_reply": "2024-07-08T14:19:33.383395Z"
+ "iopub.execute_input": "2024-07-09T13:27:39.038193Z",
+ "iopub.status.busy": "2024-07-09T13:27:39.037988Z",
+ "iopub.status.idle": "2024-07-09T13:27:39.493003Z",
+ "shell.execute_reply": "2024-07-09T13:27:39.492291Z"
}
},
"outputs": [
@@ -165,10 +165,10 @@
"execution_count": 4,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:33.387641Z",
- "iopub.status.busy": "2024-07-08T14:19:33.387030Z",
- "iopub.status.idle": "2024-07-08T14:19:33.615481Z",
- "shell.execute_reply": "2024-07-08T14:19:33.614713Z"
+ "iopub.execute_input": "2024-07-09T13:27:39.495638Z",
+ "iopub.status.busy": "2024-07-09T13:27:39.495386Z",
+ "iopub.status.idle": "2024-07-09T13:27:39.714694Z",
+ "shell.execute_reply": "2024-07-09T13:27:39.714018Z"
}
},
"outputs": [
diff --git a/notebooks/nmodl-sympy-solver-sparse.ipynb b/notebooks/nmodl-sympy-solver-sparse.ipynb
index 558fe9452..8e25af2a8 100644
--- a/notebooks/nmodl-sympy-solver-sparse.ipynb
+++ b/notebooks/nmodl-sympy-solver-sparse.ipynb
@@ -39,10 +39,10 @@
"execution_count": 1,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:35.091365Z",
- "iopub.status.busy": "2024-07-08T14:19:35.091139Z",
- "iopub.status.idle": "2024-07-08T14:19:35.902205Z",
- "shell.execute_reply": "2024-07-08T14:19:35.901295Z"
+ "iopub.execute_input": "2024-07-09T13:27:41.020838Z",
+ "iopub.status.busy": "2024-07-09T13:27:41.020291Z",
+ "iopub.status.idle": "2024-07-09T13:27:41.767497Z",
+ "shell.execute_reply": "2024-07-09T13:27:41.766709Z"
}
},
"outputs": [],
@@ -56,10 +56,10 @@
"execution_count": 2,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:35.906761Z",
- "iopub.status.busy": "2024-07-08T14:19:35.905989Z",
- "iopub.status.idle": "2024-07-08T14:19:35.935381Z",
- "shell.execute_reply": "2024-07-08T14:19:35.934578Z"
+ "iopub.execute_input": "2024-07-09T13:27:41.770825Z",
+ "iopub.status.busy": "2024-07-09T13:27:41.770403Z",
+ "iopub.status.idle": "2024-07-09T13:27:41.800087Z",
+ "shell.execute_reply": "2024-07-09T13:27:41.799399Z"
}
},
"outputs": [],
@@ -100,10 +100,10 @@
"execution_count": 3,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:35.938636Z",
- "iopub.status.busy": "2024-07-08T14:19:35.938316Z",
- "iopub.status.idle": "2024-07-08T14:19:36.446881Z",
- "shell.execute_reply": "2024-07-08T14:19:36.446144Z"
+ "iopub.execute_input": "2024-07-09T13:27:41.803463Z",
+ "iopub.status.busy": "2024-07-09T13:27:41.803241Z",
+ "iopub.status.idle": "2024-07-09T13:27:42.278312Z",
+ "shell.execute_reply": "2024-07-09T13:27:42.277529Z"
}
},
"outputs": [
@@ -165,10 +165,10 @@
"execution_count": 4,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-08T14:19:36.449568Z",
- "iopub.status.busy": "2024-07-08T14:19:36.449291Z",
- "iopub.status.idle": "2024-07-08T14:19:36.672354Z",
- "shell.execute_reply": "2024-07-08T14:19:36.671576Z"
+ "iopub.execute_input": "2024-07-09T13:27:42.281288Z",
+ "iopub.status.busy": "2024-07-09T13:27:42.280840Z",
+ "iopub.status.idle": "2024-07-09T13:27:42.499162Z",
+ "shell.execute_reply": "2024-07-09T13:27:42.498413Z"
}
},
"outputs": [