30inline std::string shamrock_title_bar_big =
"\n\
31 █████████ █████ █████ █████████ ██████ ██████ ███████████ ███████ █████████ █████ ████\n\
32 ███░░░░░███░░███ ░░███ ███░░░░░███ ░░██████ ██████ ░░███░░░░░███ ███░░░░░███ ███░░░░░███░░███ ███░ \n\
33░███ ░░░ ░███ ░███ ░███ ░███ ░███░█████░███ ░███ ░███ ███ ░░███ ███ ░░░ ░███ ███ \n\
34░░█████████ ░███████████ ░███████████ ░███░░███ ░███ ░██████████ ░███ ░███░███ ░███████ \n\
35 ░░░░░░░░███ ░███░░░░░███ ░███░░░░░███ ░███ ░░░ ░███ ░███░░░░░███ ░███ ░███░███ ░███░░███ \n\
36 ███ ░███ ░███ ░███ ░███ ░███ ░███ ░███ ░███ ░███ ░░███ ███ ░░███ ███ ░███ ░░███ \n\
37░░█████████ █████ █████ █████ █████ █████ █████ █████ █████ ░░░███████░ ░░█████████ █████ ░░████\n\
38 ░░░░░░░░░ ░░░░░ ░░░░░ ░░░░░ ░░░░░ ░░░░░ ░░░░░ ░░░░░ ░░░░░ ░░░░░░░ ░░░░░░░░░ ░░░░░ ░░░░ \n\
43inline std::string very_rare_title_bar =
"\n\
44█▀▀▀▀▀█ ▀▄▄███▄▀ █▄ ▀ █▀▀▀▀▀█\n\
45█ ███ █ ▄▄▀▄█ ▀▀██▀▀ █▄▀ █ ███ █\n\
46█ ▀▀▀ █ ██▄ ▄ ▄▀█ ▀▄██▄▄ █ ▀▀▀ █\n\
47▀▀▀▀▀▀▀ █ ▀▄▀ █ ▀▄█▄█▄▀ █ ▀▀▀▀▀▀▀\n\
48▀▄ ▀▄▀█▀ █▄▀ █▄█▄ ▀███ █▀▀▀█▄ █\n\
49▀ █ █▀▀█▀ ▄ ▄█▀▀▄ ▀▄▄ ▄▀▄█▄ ▀ ▀ \n\
50█ ██▄▄▀▄▀ █▄▀▀▄ ▀▄▄▄▄ ▀▀█▄▀█ ▀▄ ▀\n\
51▄▄█▄█▀▀▄ ██▀▄██▄██ ▀█ █▀██▄▀ ▀ \n\
52██ ▀██▀▄██▄ ▀ ▄▄▀█▀█▀█▄█ ▀ ▀█▄█ \n\
53▀▄█▀█ ▀█ █ ██ █▀█▄ ██▀▀██▄█ ▀ █ \n\
54█ ▀▄ █▀▀ ▀ ▀▄▀▀ ▄▄▀█▀ ▄ █▀▀█▄▄ \n\
55 ▄██▀█▄ ▄▀▀▄▀ ▀▄██▄█▄▀▀█▄ ▄▄▀█▄\n\
56▀▀▀ ▀ ▀▀▄ ██ █████ ▀██▄█▀▀▀█▀▄▀ \n\
57█▀▀▀▀▀█ ▀▀▀▄ ██▄ ▀▄ ▄ █ ▀ █▀ ▄\n\
58█ ███ █ ▀▄▄▀██▀ ▀ ▄█▄ ▀▄▀▀████▄▄▀\n\
59█ ▀▀▀ █ ▀ ▄█▄▀█▄▄█ ▀█ ▄▄▀█▀▀▀ \n\
60▀▀▀▀▀▀▀ ▀ ▀ ▀ ▀▀▀▀▀▀▀▀ ▀ ▀\n\
66 std::optional<std::string> get_banner_pic_path() {
67 constexpr const char *kitty_banner_path
68 =
"../doc/mkdocs/docs/assets/no_background_nocolor.png";
69 if (std::filesystem::exists(kitty_banner_path)) {
70 return kitty_banner_path;
75 bool try_print_picture() {
80 const char *term = std::getenv(
"TERM");
81 if (term ==
nullptr || std::string(term) !=
"xterm-kitty") {
85 if (std::optional<std::string> banner_path = get_banner_pic_path()) {
86 std::system((
"kitten icat " + *banner_path).c_str());
93 void print_standard_title_bar() {
103 std::string get_date_hour_string() {
104 auto now = std::chrono::system_clock::now();
105 auto in_time_t = std::chrono::system_clock::to_time_t(now);
106 std::stringstream ss;
107 ss << std::put_time(std::localtime(&in_time_t),
"%Y-%m-%d %H:%M:%S");
111 u64 pure_random_number() {
return std::random_device{}(); }
113 void print_title_bar() {
114 if (pure_random_number() % 100 == 0) {
115 logger::raw_ln(very_rare_title_bar);
117 print_standard_title_bar();
121 shambase::term_colors::col8b_cyan()
122 +
"Copyright (c) 2021-2026 Timothée David--Cléris (tim.shamrock@proton.me)"
123 + shambase::term_colors::reset());
125 shambase::term_colors::col8b_cyan() +
"SPDX-License-Identifier"
126 + shambase::term_colors::reset() +
" : CeCILL Free Software License Agreement v2.1");
128 shambase::term_colors::col8b_cyan() +
"Start time" + shambase::term_colors::reset()
129 +
" : " + get_date_hour_string());
131 logger::print_faint_row();
134 "\n" + shambase::term_colors::col8b_cyan() +
"Shamrock version "
135 + shambase::term_colors::reset() +
": " + version_string +
"\n");
139 shambase::term_colors::col8b_cyan() +
"Git infos " + shambase::term_colors::reset()
144 void code_init_done_log() {
147 auto lines = std::vector<std::string>{
151 "Shamrock rolls - no time for moss.",
152 "Shamrock's live - go with the flow.",
153 "Shamrock - as solid as a rock.",
154 "Shamrock's stable and steady as a rock.",
155 "Shamrock initialized - no cracks in this rock.",
156 "Shamrock is ready to eat cheese (melted) and bread.",
157 "Are you sure you want to work today?",
158 "No holidays for the Shamrock ... (yeah, this was a PhD at some point)",
159 "-[--->+<]>--.>+[----->+++<]>+.-------.++++++++++++.+++++.---.------------.++++++++.",
160 "CPU hours to burn? We don't do such thing here.",
161 "Are you burning GPUs or CPUs today?",
163While you wait for this simulation to run, give that cat a hug!
171 "Shamrock your way to a brighter day!",
172 "Node hours to burn? Leaf it to me.",
173 "Ready for some shamazing simulations?",
178 "We're not here to make seagulls laugh",
182 "Pretty sure Aussies use that too, mate."};
185 auto get_sentence = [&]() {
187 u64 idx =
static_cast<u64>(std::floor(
195 logger::print_faint_row();
198 shambase::term_colors::col8b_green() +
"DONE" + shambase::term_colors::reset()
201 logger::print_faint_row();
double f64
Alias for double.
std::uint64_t u64
64 bit unsigned integer
std::string trunc_str(std::string s, u32 max_len)
Truncate a string to a specified length, adding an ellipsis if necessary.
i32 world_rank()
Gives the rank of the current process in the MPI communicator.
namespace for the main framework
void raw_ln(Types... var2)
Prints a log message with multiple arguments followed by a newline.
This file contains the definition for the stacktrace related functionality.
f64 get_wtime()
Returns the current wall clock time in seconds.
const std::string reset()
Get the reset terminal escape char.
const std::string blink()
Get the blink terminal escape char.
const std::string col8b_cyan()
Get the cyan terminal escape char.
This file contains tty info getters.
bool is_a_tty()
Test if current terminal is a tty.
Functions related to the MPI communicator.