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