BioCMAMC-ST
rt_init.hpp
1#ifndef __RUNTIME_INIT_HPP__
2#define __RUNTIME_INIT_HPP__
3
4#include <chrono>
5#include <common/execinfo.hpp>
6#include <core/simulation_parameters.hpp>
7#include <ctime>
8#include <iomanip>
9#include <string>
10#include <string_view>
11
12// [[deprecated]]void set_n_thread_current_rank(int rank,
13// int size,
14// ExecInfo &info,
15// const Core::UserControlParameters &params) noexcept;
16
25template <typename Stream> void append_date_time(Stream& stream) noexcept
26{
27 auto now = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now());
28 stream << std::put_time(std::localtime(&now), "%Y-%m-%d %H:%M:%S");
29}
30
31// /**
32// * @brief Appends the current date and time to a given string.
33// *
34// * @param string The string view to which the date and time will be appended.
35// * @return A `std::string` containing the original string with the appended date
36// * and time.
37// */
38// std::string sappend_date_time(std::string_view string) noexcept;
39
40// /**
41// * @brief Initializes the runtime environment based on command-line arguments
42// * and simulation parameters.
43// *
44// * This function sets up the necessary runtime environment for the simulation
45// * by:
46// * - Initializing MPI (Message Passing Interface) if applicable.
47// * - Setting up Kokkos for parallel programming.
48// * - Configuring functions to be executed upon program exit.
49// * - Handling signals to ensure proper shutdown and resource cleanup.
50// *
51// * The function uses the provided command-line arguments and simulation
52// * parameters to configure the runtime environment accordingly.
53// *
54// * @param argc The number of command-line arguments.
55// * @param argv The array of command-line arguments.
56// * @param params The `UserControlParameters` object containing configuration
57// * settings for the simulation.
58// * @return An `ExecInfo` object containing details about the initialized runtime
59// * environment, including execution context and other relevant metadata.
60// */
61// ExecInfo
62// runtime_init(int argc, char **argv, Core::UserControlParameters &params) noexcept;
63
66void register_run(const ExecInfo& exec, const Core::UserControlParameters& params) noexcept;
67
68#endif //__RUNTIME_INIT_HPP__
A structure to hold user-defined control parameters for simulation settings.
Definition simulation_parameters.hpp:23
Definition execinfo.hpp:12