CoreNEURON
phase2.hpp
Go to the documentation of this file.
1 /*
2 # =============================================================================
3 # Copyright (c) 2016 - 2022 Blue Brain Project/EPFL
4 #
5 # See top-level LICENSE file for details.
6 # =============================================================================
7 */
8 
9 #pragma once
10 
14 
15 #include <memory>
16 
17 namespace coreneuron {
18 struct NrnThread;
19 struct NrnThreadMembList;
20 struct Memb_func;
21 struct Memb_list;
22 struct NrnThreadChkpnt;
23 
24 class Phase2 {
25  public:
26  void read_file(FileHandler& F, const NrnThread& nt);
27  void read_direct(int thread_id, const NrnThread& nt);
28  void populate(NrnThread& nt, const UserParams& userParams);
29 
30  std::vector<int> preSynConditionEventFlags;
31 
32  // All of this is public for nrn_checkpoint
33  struct EventTypeBase {
34  double time;
35  };
36  struct NetConType_: public EventTypeBase {
38  };
39  struct SelfEventType_: public EventTypeBase {
43  double flag;
44  int movable;
46  };
47  struct PreSynType_: public EventTypeBase {
49  };
50  struct NetParEvent_: public EventTypeBase {};
54  };
55 
57  int vtype;
58  int mtype;
59  int ix;
62 
66  };
67  std::vector<VecPlayContinuous_> vec_play_continuous;
69 
70  std::vector<std::pair<int, std::shared_ptr<EventTypeBase>>> events;
71 
72  private:
73  void check_mechanism();
74  void transform_int_data(int elem0,
75  int nodecount,
76  int* pdata,
77  int i,
78  int dparam_size,
79  int layout,
80  int n_node_);
81  void set_net_send_buffer(Memb_list** ml_list, const std::vector<int>& pnt_offset);
82  void restore_events(FileHandler& F);
83  void fill_before_after_lists(NrnThread& nt, const std::vector<Memb_func>& memb_func);
84  void pdata_relocation(const NrnThread& nt, const std::vector<Memb_func>& memb_func);
85  void set_dependencies(const NrnThread& nt, const std::vector<Memb_func>& memb_func);
86  void handle_weights(NrnThread& nt, int n_netcon, NrnThreadChkpnt& ntc);
88  const std::vector<Memb_func>& memb_func,
89  NrnThreadChkpnt& ntc);
90  void set_vec_play(NrnThread& nt, NrnThreadChkpnt& ntc);
91 
93  int n_output;
95  int n_node;
96  int n_diam; // 0 if not needed, else n_node
97  int n_mech;
98  std::vector<int> mech_types;
99  std::vector<int> nodecounts;
100  int n_idata;
101  int n_vdata;
103  /* TO DO: when this is fixed use it like that
104  std::vector<double> actual_a;
105  std::vector<double> actual_b;
106  std::vector<double> actual_area;
107  std::vector<double> actual_v;
108  std::vector<double> actual_diam;
109  */
110  double* _data;
111  struct TML {
112  std::vector<int> nodeindices;
113  std::vector<int> pdata;
114  int type;
115  std::vector<int> iArray;
116  std::vector<double> dArray;
117  std::vector<int> pointer2type;
118  };
119  std::vector<TML> tmls;
120  std::vector<int> output_vindex;
121  std::vector<double> output_threshold;
122  std::vector<int> pnttype;
123  std::vector<int> pntindex;
124  std::vector<double> weights;
125  std::vector<double> delay;
127 };
128 } // namespace coreneuron
coreneuron::Phase2
Definition: phase2.hpp:24
coreneuron::Phase2::EventTypeBase::time
double time
Definition: phase2.hpp:34
coreneuron::Phase2::NetConType_
Definition: phase2.hpp:36
coreneuron::Phase2::patstim_index
int patstim_index
Definition: phase2.hpp:68
coreneuron::Phase2::delay
std::vector< double > delay
Definition: phase2.hpp:125
coreneuron::Phase2::n_vdata
int n_vdata
Definition: phase2.hpp:101
coreneuron::Phase2::TML::pointer2type
std::vector< int > pointer2type
Definition: phase2.hpp:117
coreneuron::Phase2::read_direct
void read_direct(int thread_id, const NrnThread &nt)
Definition: phase2.cpp:256
coreneuron::Phase2::output_vindex
std::vector< int > output_vindex
Definition: phase2.hpp:120
coreneuron::Phase2::n_real_cell
int n_real_cell
Definition: phase2.hpp:92
coreneuron::Phase2::EventTypeBase
Definition: phase2.hpp:33
coreneuron::Phase2::n_mech
int n_mech
Definition: phase2.hpp:97
coreneuron::Phase2::TML::dArray
std::vector< double > dArray
Definition: phase2.hpp:116
coreneuron::Phase2::mech_types
std::vector< int > mech_types
Definition: phase2.hpp:98
coreneuron::Phase2::SelfEventType_::movable
int movable
Definition: phase2.hpp:44
coreneuron::Phase2::TML::nodeindices
std::vector< int > nodeindices
Definition: phase2.hpp:112
coreneuron::Phase2::set_dependencies
void set_dependencies(const NrnThread &nt, const std::vector< Memb_func > &memb_func)
Definition: phase2.cpp:718
coreneuron::Phase2::tmls
std::vector< TML > tmls
Definition: phase2.hpp:119
coreneuron::Phase2::PlayRecordEventType_::play_record_type
int play_record_type
Definition: phase2.hpp:52
coreneuron::Phase2::NetConType_::netcon_index
int netcon_index
Definition: phase2.hpp:37
coreneuron::Memb_list
Definition: mechanism.hpp:131
coreneuron::Phase2::weights
std::vector< double > weights
Definition: phase2.hpp:124
coreneuron::Phase2::VecPlayContinuous_::discon_index
int discon_index
Definition: phase2.hpp:64
coreneuron::Phase2::NetParEvent_
Definition: phase2.hpp:50
coreneuron::Phase2::n_diam
int n_diam
Definition: phase2.hpp:96
coreneuron::Phase2::pdata_relocation
void pdata_relocation(const NrnThread &nt, const std::vector< Memb_func > &memb_func)
Definition: phase2.cpp:603
pdata
#define pdata
Definition: md1redef.h:37
user_params.hpp
coreneuron::Phase2::_data
double * _data
Definition: phase2.hpp:110
coreneuron
THIS FILE IS AUTO GENERATED DONT MODIFY IT.
Definition: corenrn_parameters.cpp:12
coreneuron::UserParams
This structure is data needed is several part of nrn_setup, phase1 and phase2.
Definition: user_params.hpp:18
coreneuron::Phase2::PreSynType_::presyn_index
int presyn_index
Definition: phase2.hpp:48
coreneuron::Phase2::v_parent_index
int * v_parent_index
Definition: phase2.hpp:102
coreneuron::Phase2::handle_weights
void handle_weights(NrnThread &nt, int n_netcon, NrnThreadChkpnt &ntc)
Definition: phase2.cpp:788
coreneuron::Phase2::VecPlayContinuous_::vtype
int vtype
Definition: phase2.hpp:57
coreneuron::i
int i
Definition: cellorder.cpp:485
coreneuron::Phase2::get_info_from_bbcore
void get_info_from_bbcore(NrnThread &nt, const std::vector< Memb_func > &memb_func, NrnThreadChkpnt &ntc)
Definition: phase2.cpp:820
coreneuron::Phase2::n_node
int n_node
Definition: phase2.hpp:95
ivocvect.hpp
coreneuron::Phase2::pnttype
std::vector< int > pnttype
Definition: phase2.hpp:122
coreneuron::Phase2::SelfEventType_::weight_index
int weight_index
Definition: phase2.hpp:45
coreneuron::Phase2::VecPlayContinuous_::ubound_index
int ubound_index
Definition: phase2.hpp:65
coreneuron::Phase2::n_real_output
int n_real_output
Definition: phase2.hpp:94
coreneuron::Phase2::vec_play_continuous
std::vector< VecPlayContinuous_ > vec_play_continuous
Definition: phase2.hpp:67
coreneuron::FileHandler
Definition: nrn_filehandler.hpp:32
coreneuron::Phase2::transform_int_data
void transform_int_data(int elem0, int nodecount, int *pdata, int i, int dparam_size, int layout, int n_node_)
Perform in memory transformation between AoS<>SoA for integer data.
Definition: phase2.cpp:460
coreneuron::Phase2::n_idata
int n_idata
Definition: phase2.hpp:100
coreneuron::Phase2::set_vec_play
void set_vec_play(NrnThread &nt, NrnThreadChkpnt &ntc)
Definition: phase2.cpp:878
coreneuron::Phase2::SelfEventType_::target_type
int target_type
Definition: phase2.hpp:40
coreneuron::Phase2::set_net_send_buffer
void set_net_send_buffer(Memb_list **ml_list, const std::vector< int > &pnt_offset)
Definition: phase2.cpp:475
coreneuron::Phase2::output_threshold
std::vector< double > output_threshold
Definition: phase2.hpp:121
coreneuron::NrnThread
Definition: multicore.hpp:75
coreneuron::Phase2::VecPlayContinuous_::mtype
int mtype
Definition: phase2.hpp:58
coreneuron::fixed_vector< double >
coreneuron::Phase2::pntindex
std::vector< int > pntindex
Definition: phase2.hpp:123
coreneuron::Phase2::TML::pdata
std::vector< int > pdata
Definition: phase2.hpp:113
nodecount
#define nodecount
Definition: md1redef.h:39
coreneuron::Phase2::restore_events
void restore_events(FileHandler &F)
Definition: phase2.cpp:512
coreneuron::Phase2::n_output
int n_output
Definition: phase2.hpp:93
coreneuron::Phase2::preSynConditionEventFlags
std::vector< int > preSynConditionEventFlags
Definition: phase2.hpp:30
coreneuron::Phase2::num_point_process
int num_point_process
Definition: phase2.hpp:126
coreneuron::Phase2::TML
Definition: phase2.hpp:111
coreneuron::Phase2::check_mechanism
void check_mechanism()
Check if MOD file used between NEURON and CoreNEURON is same.
Definition: phase2.cpp:434
coreneuron::Phase2::VecPlayContinuous_::ix
int ix
Definition: phase2.hpp:59
coreneuron::Phase2::TML::iArray
std::vector< int > iArray
Definition: phase2.hpp:115
coreneuron::Phase2::populate
void populate(NrnThread &nt, const UserParams &userParams)
Definition: phase2.cpp:918
coreneuron::Phase2::VecPlayContinuous_::tvec
IvocVect tvec
Definition: phase2.hpp:61
coreneuron::Phase2::TML::type
int type
Definition: phase2.hpp:114
coreneuron::Phase2::VecPlayContinuous_::yvec
IvocVect yvec
Definition: phase2.hpp:60
coreneuron::NrnThreadChkpnt
Definition: nrn_checkpoint.hpp:87
coreneuron::Phase2::fill_before_after_lists
void fill_before_after_lists(NrnThread &nt, const std::vector< Memb_func > &memb_func)
Definition: phase2.cpp:570
coreneuron::Phase2::PreSynType_
Definition: phase2.hpp:47
coreneuron::Phase2::events
std::vector< std::pair< int, std::shared_ptr< EventTypeBase > > > events
Definition: phase2.hpp:70
coreneuron::Phase2::read_file
void read_file(FileHandler &F, const NrnThread &nt)
Definition: phase2.cpp:110
coreneuron::Phase2::SelfEventType_::target_instance
int target_instance
Definition: phase2.hpp:42
coreneuron::Phase2::PlayRecordEventType_::vecplay_index
int vecplay_index
Definition: phase2.hpp:53
coreneuron::Phase2::SelfEventType_::flag
double flag
Definition: phase2.hpp:43
coreneuron::Phase2::SelfEventType_
Definition: phase2.hpp:39
coreneuron::Phase2::nodecounts
std::vector< int > nodecounts
Definition: phase2.hpp:99
coreneuron::Phase2::VecPlayContinuous_
Definition: phase2.hpp:56
coreneuron::Phase2::SelfEventType_::point_proc_instance
int point_proc_instance
Definition: phase2.hpp:41
coreneuron::Phase2::VecPlayContinuous_::last_index
int last_index
Definition: phase2.hpp:63
coreneuron::Phase2::PlayRecordEventType_
Definition: phase2.hpp:51
nrn_filehandler.hpp