Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
experimental_features.cpp
Go to the documentation of this file.
1// -------------------------------------------------------//
2//
3// SHAMROCK code for hydrodynamics
4// Copyright (c) 2021-2026 Timothée David--Cléris <tim.shamrock@proton.me>
5// SPDX-License-Identifier: CeCILL Free Software License Agreement v2.1
6// Shamrock is licensed under the CeCILL 2.1 License, see LICENSE for more information
7//
8// -------------------------------------------------------//
9
18#include "shamcmdopt/env.hpp"
19#include "shamcomm/logs.hpp"
22
23namespace {
24 bool _env_allow_experimental_features
26 "SHAM_EXPERIMENTAL", "0", "Allow the use of experimental features")
27 == "1";
28
29 bool warning_printed = false;
30} // namespace
31
32namespace shamrock {
34 if (!warning_printed && _env_allow_experimental_features) {
35 if (shamcomm::world_rank() == 0) {
36
37 std::string color = shambase::term_colors::col8b_yellow();
38 std::string reset = shambase::term_colors::reset();
39
40 shamcomm::logs::raw_ln(
41 "\n" + color
42 + "---------------------------- WARNING ----------------------------" + reset
43 + "\n" + color + "Warning:" + reset + " Experimental features are enabled\n"
44 + color + "-----------------------------------------------------------------"
45 + reset);
46 }
47 warning_printed = true;
48 }
49
50 return _env_allow_experimental_features;
51 }
52
53 void enable_experimental_features() { _env_allow_experimental_features = true; }
54
55} // namespace shamrock
std::string getenv_str_default_register(const char *env_var, std::string default_val, std::string desc)
Get the content of the environment variable if it exist and register it documentation,...
Definition env.hpp:88
i32 world_rank()
Gives the rank of the current process in the MPI communicator.
Definition worldInfo.cpp:40
namespace for the main framework
Definition __init__.py:1
bool are_experimental_features_allowed()
Allow the use of experimental features.
void enable_experimental_features()
Allow the use of experimental features.
Functions related to the MPI communicator.