NEURON
report_event.hpp
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 
9 #pragma once
10 
11 #include <algorithm>
12 #include <unordered_map>
13 #include <vector>
14 #include <string>
15 
18 
19 namespace coreneuron {
20 
21 #ifdef ENABLE_SONATA_REPORTS
22 struct VarWithMapping {
23  uint32_t id;
24  double* var_value;
25  VarWithMapping(int id_, double* v_)
26  : id(id_)
27  , var_value(v_) {}
28 };
29 
30 // mapping the set of variables pointers to report to its gid
31 using VarsToReport = std::unordered_map<uint64_t, std::vector<VarWithMapping>>;
32 
33 class ReportEvent: public DiscreteEvent {
34  public:
35  ReportEvent(double dt,
36  double tstart,
37  const VarsToReport& filtered_gids,
38  const char* name,
39  double report_dt,
41 
42  /** on deliver, call libsonata and setup next event */
43  void deliver(double t, NetCvode* nc, NrnThread* nt) override;
44  bool require_checkpoint() override;
45  void summation_alu(NrnThread* nt);
46  void lfp_calc(NrnThread* nt);
47  int type() const override {
48  return ReportEventType;
49  }
50 
51  private:
52  double dt;
53  double step;
54  std::string report_path;
55  double report_dt;
56  int reporting_period;
57  std::vector<int> gids_to_report;
58  double tstart;
59  VarsToReport vars_to_report;
60  ReportType report_type;
61 };
62 #endif
63 
64 } // Namespace coreneuron
#define id
Definition: md1redef.h:41
step
Definition: extdef.h:7
const char * name
Definition: init.cpp:16
THIS FILE IS AUTO GENERATED DONT MODIFY IT.
#define ReportEventType
Definition: netcon.hpp:29
short type
Definition: cabvars.h:10
static N_Vector id_
Represent main neuron object computed by single thread.
Definition: multicore.h:58