CoreNEURON
cvodestb.cpp
Go to the documentation of this file.
1 /*
2 # =============================================================================
3 # Copyright (c) 2016 - 2021 Blue Brain Project/EPFL
4 #
5 # See top-level LICENSE file for details.
6 # =============================================================================.
7 */
8 
10 #include "coreneuron/nrnconf.h"
12 // solver CVode stub to allow cvode as dll for mswindows version.
13 
16 
18 
19 namespace coreneuron {
20 
21 // for fixed step thread
22 // check thresholds and deliver all (including binqueue) events
23 // up to t+dt/2
25  if (net_cvode_instance) {
28  }
29 }
30 
31 // deliver events (but not binqueue) up to nt->_t
33  double tsav = nt->_t;
34  if (net_cvode_instance) {
36  }
37  nt->_t = tsav;
38 
39  /*before executing on gpu, we have to update the NetReceiveBuffer_t on GPU */
41 
42  for (auto& net_buf_receive: corenrn.get_net_buf_receive()) {
43  (*net_buf_receive.first)(nt);
44  }
45 }
46 
48  if (net_cvode_instance) {
50  }
51 }
52 
54  if (net_cvode_instance) {
56  }
57 
58 #ifdef CORENEURON_ENABLE_GPU
59  /* weight vectors could be updated (from INITIAL block of NET_RECEIVE, update those on GPU's */
60  for (int ith = 0; ith < nrn_nthread; ++ith) {
61  NrnThread* nt = nrn_threads + ith;
62  double* weights = nt->weights;
63  int n_weight = nt->n_weight;
64  if (n_weight && nt->compute_gpu) {
65  nrn_pragma_acc(update device(weights [0:n_weight]))
66  nrn_pragma_omp(target update to(weights [0:n_weight]))
67  }
68  }
69 #endif
70 }
71 
72 void nrn_play_init() {
73  for (int ith = 0; ith < nrn_nthread; ++ith) {
74  NrnThread* nt = nrn_threads + ith;
75  for (int i = 0; i < nt->n_vecplay; ++i) {
76  ((PlayRecord*) nt->_vecplay[i])->play_init();
77  }
78  }
79 }
80 
82  for (int i = 0; i < nt->n_vecplay; ++i) {
83  ((PlayRecord*) nt->_vecplay[i])->continuous(nt->_t);
84  }
85 }
86 
87 } // namespace coreneuron
coreneuron::NetCvode::deliver_net_events
void deliver_net_events(NrnThread *)
Definition: netcvode.cpp:631
coreneuron::nrn_nthread
int nrn_nthread
Definition: multicore.cpp:55
coreneuron::NrnThread::_t
double _t
Definition: multicore.hpp:76
coreneuron::NetCvode::check_thresh
void check_thresh(NrnThread *)
Definition: netcvode.cpp:525
nrn_acc_manager.hpp
nrn_pragma_omp
nrn_pragma_acc(routine seq) nrn_pragma_omp(declare target) philox4x32_ctr_t coreneuron_random123_philox4x32_helper(coreneuron nrn_pragma_omp(end declare target) namespace coreneuron
Provide a helper function in global namespace that is declared target for OpenMP offloading to functi...
Definition: nrnran123.h:69
netcvode.hpp
coreneuron::NrnThread::compute_gpu
int compute_gpu
Definition: multicore.hpp:136
coreneuron.hpp
coreneuron
THIS FILE IS AUTO GENERATED DONT MODIFY IT.
Definition: corenrn_parameters.cpp:12
coreneuron::NrnThread::n_weight
int n_weight
Definition: multicore.hpp:91
coreneuron::i
int i
Definition: cellorder.cpp:485
coreneuron::update
void update(NrnThread *_nt)
Definition: fadvance_core.cpp:201
coreneuron::NetCvode::clear_events
void clear_events()
Definition: netcvode.cpp:225
coreneuron::NrnThread
Definition: multicore.hpp:75
coreneuron::nrn_threads
NrnThread * nrn_threads
Definition: multicore.cpp:56
coreneuron::corenrn
CoreNeuron corenrn
Definition: multicore.cpp:53
coreneuron::deliver_net_events
void deliver_net_events(NrnThread *nt)
Definition: cvodestb.cpp:24
coreneuron::CoreNeuron::get_net_buf_receive
auto & get_net_buf_receive()
Definition: coreneuron.hpp:154
coreneuron::init_net_events
void init_net_events()
Definition: cvodestb.cpp:53
coreneuron::update_net_receive_buffer
void update_net_receive_buffer(NrnThread *nt)
Definition: nrn_acc_manager.cpp:928
nrnconf.h
coreneuron::NrnThread::_vecplay
void ** _vecplay
Definition: multicore.hpp:109
coreneuron::NetCvode::deliver_events
void deliver_events(double til, NrnThread *)
Definition: netcvode.cpp:331
weights
#define weights
Definition: md1redef.h:42
coreneuron::nrn_play_init
void nrn_play_init()
Definition: cvodestb.cpp:72
coreneuron::NrnThread::weights
double * weights
Definition: multicore.hpp:88
coreneuron::net_cvode_instance
NetCvode * net_cvode_instance
Definition: netcvode.cpp:35
coreneuron::PlayRecord
Definition: vrecitem.h:37
vrecitem.h
multicore.hpp
coreneuron::nrn_pragma_acc
nrn_pragma_acc(routine vector) static void triang_interleaved2(NrnThread *nt
Definition: ivocvect.cpp:30
coreneuron::nrn_deliver_events
void nrn_deliver_events(NrnThread *nt)
Definition: cvodestb.cpp:32
coreneuron::NetCvode::init_events
void init_events()
Definition: netcvode.cpp:240
coreneuron::fixed_play_continuous
void fixed_play_continuous(NrnThread *nt)
Definition: cvodestb.cpp:81
coreneuron::clear_event_queue
void clear_event_queue()
Definition: cvodestb.cpp:47
coreneuron::NrnThread::n_vecplay
int n_vecplay
Definition: multicore.hpp:101