29inline std::string shamrock_title_bar_big =
"\n\
30 █████████ █████ █████ █████████ ██████ ██████ ███████████ ███████ █████████ █████ ████\n\
31 ███░░░░░███░░███ ░░███ ███░░░░░███ ░░██████ ██████ ░░███░░░░░███ ███░░░░░███ ███░░░░░███░░███ ███░ \n\
32░███ ░░░ ░███ ░███ ░███ ░███ ░███░█████░███ ░███ ░███ ███ ░░███ ███ ░░░ ░███ ███ \n\
33░░█████████ ░███████████ ░███████████ ░███░░███ ░███ ░██████████ ░███ ░███░███ ░███████ \n\
34 ░░░░░░░░███ ░███░░░░░███ ░███░░░░░███ ░███ ░░░ ░███ ░███░░░░░███ ░███ ░███░███ ░███░░███ \n\
35 ███ ░███ ░███ ░███ ░███ ░███ ░███ ░███ ░███ ░███ ░░███ ███ ░░███ ███ ░███ ░░███ \n\
36░░█████████ █████ █████ █████ █████ █████ █████ █████ █████ ░░░███████░ ░░█████████ █████ ░░████\n\
37 ░░░░░░░░░ ░░░░░ ░░░░░ ░░░░░ ░░░░░ ░░░░░ ░░░░░ ░░░░░ ░░░░░ ░░░░░░░ ░░░░░░░░░ ░░░░░ ░░░░ \n\
42inline std::string very_rare_title_bar =
"\n\
43█▀▀▀▀▀█ ▀▄▄███▄▀ █▄ ▀ █▀▀▀▀▀█\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\
65 std::optional<std::string> get_banner_pic_path() {
66 constexpr const char *kitty_banner_path
67 =
"../doc/mkdocs/docs/assets/no_background_nocolor.png";
68 if (std::filesystem::exists(kitty_banner_path)) {
69 return kitty_banner_path;
74 bool try_print_picture() {
79 const char *term = std::getenv(
"TERM");
80 if (term ==
nullptr || std::string(term) !=
"xterm-kitty") {
84 if (std::optional<std::string> banner_path = get_banner_pic_path()) {
85 std::system((
"kitten icat " + *banner_path).c_str());
92 void print_standard_title_bar() {
102 std::string get_date_hour_string() {
103 auto now = std::chrono::system_clock::now();
104 auto in_time_t = std::chrono::system_clock::to_time_t(now);
105 std::stringstream ss;
106 ss << std::put_time(std::localtime(&in_time_t),
"%Y-%m-%d %H:%M:%S");
110 u64 pure_random_number() {
return std::random_device{}(); }
112 void print_title_bar() {
113 if (pure_random_number() % 100 == 0) {
114 logger::raw_ln(very_rare_title_bar);
116 print_standard_title_bar();
120 shambase::term_colors::col8b_cyan()
121 +
"Copyright (c) 2021-2026 Timothée David--Cléris (tim.shamrock@proton.me)"
122 + shambase::term_colors::reset());
124 shambase::term_colors::col8b_cyan() +
"SPDX-License-Identifier"
125 + shambase::term_colors::reset() +
" : CeCILL Free Software License Agreement v2.1");
127 shambase::term_colors::col8b_cyan() +
"Start time" + shambase::term_colors::reset()
128 +
" : " + get_date_hour_string());
130 logger::print_faint_row();
133 "\n" + shambase::term_colors::col8b_cyan() +
"Shamrock version "
134 + shambase::term_colors::reset() +
": " + version_string +
"\n");
138 shambase::term_colors::col8b_cyan() +
"Git infos " + shambase::term_colors::reset()
143 void code_init_done_log() {
146 auto lines = std::vector<std::string>{
150 "Shamrock rolls - no time for moss.",
151 "Shamrock's live - go with the flow.",
152 "Shamrock - as solid as a rock.",
153 "Shamrock's stable and steady as a rock.",
154 "Shamrock initialized - no cracks in this rock.",
155 "Shamrock is ready to eat cheese (melted) and bread.",
156 "Are you sure you want to work today?",
157 "No holidays for the Shamrock ... (yeah, this was a PhD at some point)",
158 "-[--->+<]>--.>+[----->+++<]>+.-------.++++++++++++.+++++.---.------------.++++++++.",
159 "CPU hours to burn? We don't do such thing here.",
160 "Are you burning GPUs or CPUs today?",
162While you wait for this simulation to run, give that cat a hug!
170 "Shamrock your way to a brighter day!",
171 "Node hours to burn? Leaf it to me.",
172 "Ready for some shamazing simulations?",
177 "We're not here to make seagulls laugh",
181 "Pretty sure Aussies use that too, mate."};
184 auto get_sentence = [&]() {
186 u64 idx =
static_cast<u64>(std::floor(
194 logger::print_faint_row();
197 shambase::term_colors::col8b_green() +
"DONE" + shambase::term_colors::reset()
200 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.