NEURON
utils.cpp
Go to the documentation of this file.
1 /*
2 # =============================================================================
3 # Copyright (c) 2021-22 Blue Brain Project/EPFL
4 #
5 # See top-level LICENSE file for details.
6 # =============================================================================.
7 */
8 #include <chrono>
9 #include "utils.hpp"
11 
12 namespace coreneuron {
13 [[noreturn]] void nrn_abort(int errcode) {
14 #if NRNMPI
15  if (corenrn_param.mpi_enable && nrnmpi_initialized()) {
16  nrnmpi_abort(errcode);
17  }
18 #endif
19  std::abort();
20 }
21 
22 double nrn_wtime() {
23 #if NRNMPI
25  return nrnmpi_wtime();
26  } else
27 #endif
28  {
29  const auto now = std::chrono::time_point_cast<std::chrono::duration<double>>(
30  std::chrono::system_clock::now());
31  return now.time_since_epoch().count();
32  }
33 }
34 
35 extern "C" {
36 void (*nrn2core_subworld_info_)(int&, int&, int&);
37 }
38 
39 
40 } // namespace coreneuron
static double nrnmpi_wtime()
Definition: multisplit.cpp:48
THIS FILE IS AUTO GENERATED DONT MODIFY IT.
void nrn_abort(int errcode)
Definition: utils.cpp:13
void(* nrn2core_subworld_info_)(int &, int &, int &, int &, int &)
Definition: utils.cpp:36
double nrn_wtime()
Definition: utils.cpp:22
corenrn_parameters corenrn_param
Printing method.
void nrnmpi_abort(int errcode)
Definition: nrnmpi.cpp:209
bool mpi_enable
Initialization seed for random number generator (int)