CoreNEURON
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 <sys/time.h>
9 #include "utils.hpp"
11 
12 namespace coreneuron {
13 [[noreturn]] void nrn_abort(int errcode) {
14 #if NRNMPI
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  struct timeval time1;
30  gettimeofday(&time1, nullptr);
31  return (time1.tv_sec + time1.tv_usec / 1.e6);
32  }
33 }
34 } // namespace coreneuron
utils.hpp
coreneuron
THIS FILE IS AUTO GENERATED DONT MODIFY IT.
Definition: corenrn_parameters.cpp:12
coreneuron::nrnmpi_initialized
mpi_function< cnrn_make_integral_constant_t(nrnmpi_initialized_impl)> nrnmpi_initialized
Definition: nrnmpidec.cpp:50
corenrn_parameters.hpp
coreneuron::corenrn_param
corenrn_parameters corenrn_param
Printing method.
Definition: corenrn_parameters.cpp:268
coreneuron::nrn_abort
void nrn_abort(int errcode)
Definition: utils.cpp:13
coreneuron::nrnmpi_wtime
mpi_function< cnrn_make_integral_constant_t(nrnmpi_wtime_impl)> nrnmpi_wtime
Definition: nrnmpidec.cpp:53
coreneuron::nrn_wtime
double nrn_wtime()
Definition: utils.cpp:22
coreneuron::corenrn_parameters_data::mpi_enable
bool mpi_enable
Initialization seed for random number generator (int)
Definition: corenrn_parameters.hpp:59
coreneuron::nrnmpi_abort
mpi_function< cnrn_make_integral_constant_t(nrnmpi_abort_impl)> nrnmpi_abort
Definition: nrnmpidec.cpp:52