14 #ifdef ENABLE_SONATA_REPORTS
15 #include "bbp/sonata/reports.h"
16 #endif // ENABLE_SONATA_REPORTS
24 #ifdef ENABLE_SONATA_REPORTS
25 sonata_set_atomic_step(
dt);
26 #endif // ENABLE_SONATA_REPORTS
30 #ifdef ENABLE_SONATA_REPORTS
31 void SonataReportHandler::register_section_report(
const NrnThread& nt,
33 const VarsToReport& vars_to_report,
34 bool is_soma_target) {
35 register_report(nt, config, vars_to_report);
38 void SonataReportHandler::register_custom_report(
const NrnThread& nt,
39 const ReportConfiguration& config,
40 const VarsToReport& vars_to_report) {
41 register_report(nt, config, vars_to_report);
44 std::pair<std::string, int> SonataReportHandler::get_population_info(
int gid) {
46 return std::make_pair(
"All", 0);
50 std::string pop_name = name_offset.first;
51 int pop_offset = name_offset.second;
52 if (pop_offset > gid) {
60 void SonataReportHandler::register_report(
const NrnThread& nt,
61 const ReportConfiguration& config,
62 const VarsToReport& vars_to_report) {
63 sonata_create_report(config.output_path.data(),
68 config.type_str.data());
69 sonata_set_report_max_buffer_size_hint(config.output_path.data(), config.buffer_size);
71 for (
const auto& kv: vars_to_report) {
72 uint64_t gid = kv.first;
73 const std::vector<VarWithMapping>& vars = kv.second;
77 const auto& pop_info = get_population_info(gid);
78 std::string population_name = pop_info.first;
79 int population_offset = pop_info.second;
80 sonata_add_node(config.output_path.data(), population_name.data(), population_offset, gid);
81 sonata_set_report_max_buffer_size_hint(config.output_path.data(), config.buffer_size);
82 for (
const auto& variable: vars) {
83 sonata_add_element(config.output_path.data(),
84 population_name.data(),
91 #endif // ENABLE_SONATA_REPORTS