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