Namespaces | |
| namespace | detail |
Classes | |
| struct | Ok |
| class | Result |
| class | Table |
| Table class for storing and manipulating tabular data. More... | |
| class | Timer |
| Timer supporting RAII scope or manual stop. More... | |
| class | TimerNode |
| Node representing a timed region in the hierarchy. More... | |
| class | TimerTree |
| Singleton tree managing all timer nodes per MPI rank. More... | |
| class | XML |
Concepts | |
| concept | FlagLike |
| Concept for types that behave like bitmask flags. | |
Functions | |
| template<FlagLike E> | |
| constexpr E | operator| (E a, E b) |
| template<FlagLike E> | |
| constexpr E | operator& (E a, E b) |
| template<FlagLike E> | |
| constexpr bool | has_flag (E mask_value, E flag) noexcept |
| Checks if a bitmask value contains a specific flag. | |
| CLI::Option * | add_option_with_default (CLI::App &app, const std::string &name, auto &field, std::string desc="") |
| Just a small wrapper to set the default of the option to the value of the variable where it shall be stored. | |
| CLI::Option * | add_flag_with_default (CLI::App &app, const std::string &name, bool &field, std::string desc="") |
| Just a small wrapper to set the default of the flag to the value of the variable where it shall be stored. | |
| void | print_cli_summary (const CLI::App &app, std::ostream &os=std::cout) |
| Prints an overview of the available flags, the passed arguments, defaults, etc. | |
| bool | prepare_empty_directory (const std::string &path_str, bool root_only=true) |
| Prepares an empty directory with the passed path. | |
| void | prepare_empty_directory_or_abort (const std::string &path_str, bool root_only=true) |
Like prepare_empty_directory() but aborts if empty directory could not be prepared successfully. | |
| void | print_general_info (int argc, char **argv, std::ostream &out=logroot) |
| Prints some general information for this run to out. | |
| void | terra_initialize (int *argc, char ***argv) |
| RAII approach to safely initialize MPI and Kokkos. | |
| double | interpolate_linear_1D (const double pos_a, const double pos_b, const double val_a, const double val_b, const double pos, const bool clamp) |
| Computes the linearly interpolated value at a specified point using two surrounding data points. | |
| Result< Table > | read_table_from_csv (const std::string &filename) |
| Attempts to read a csv file and converts that into a Table instance. | |
| std::string | current_timestamp () |
| Get the current timestamp as a string. | |
Variables | |
| detail::PrefixCout | logroot ([]() { return detail::log_prefix();}) |
| std::ostream subclass that just logs on root and adds a timestamp for each line. | |
| detail::PrefixCout | logall ([]() { return detail::log_prefix();}, false) |
| std::ostream subclass that just logs on any process and adds a timestamp for each line. | |
|
inline |
Just a small wrapper to set the default of the flag to the value of the variable where it shall be stored.
Equivalent to
but with this you do not have to pass 'field' twice :)
| CLI::Option * terra::util::add_option_with_default | ( | CLI::App & | app, |
| const std::string & | name, | ||
| auto & | field, | ||
| std::string | desc = "" |
||
| ) |
Just a small wrapper to set the default of the option to the value of the variable where it shall be stored.
Equivalent to
but with this you do not have to pass 'field' twice :)
|
inline |
Get the current timestamp as a string.
|
constexprnoexcept |
Checks if a bitmask value contains a specific flag.
This function checks if the bitmask value mask_value has the flag flag set. If flag is E::NO_FLAG, it checks if mask_value is exactly E::NO_FLAG.
| E | The enum type representing the bitmask. |
| mask_value | The bitmask value to check. |
| flag | The flag to check for in mask_value. |
true if mask_value contains flag or whether mask_value == flag if flag == E::NO_FLAG, otherwise false. | double terra::util::interpolate_linear_1D | ( | const double | pos_a, |
| const double | pos_b, | ||
| const double | val_a, | ||
| const double | val_b, | ||
| const double | pos, | ||
| const bool | clamp | ||
| ) |
Computes the linearly interpolated value at a specified point using two surrounding data points.
| pos_a | coordinate of the first data point |
| pos_b | coordinate of the first data point |
| val_a | value at pos_a |
| val_b | value at pos_b |
| pos | where to evaluate |
| clamp | if true, clamps to [val_a, val_b] |
|
constexpr |
|
constexpr |
|
inline |
Prepares an empty directory with the passed path.
If the directory does not exist: will create a directory
Returns true for all non-zero ranks if root_only == true.
|
inline |
Like prepare_empty_directory() but aborts if empty directory could not be prepared successfully.
|
inline |
Prints an overview of the available flags, the passed arguments, defaults, etc.
|
inline |
Prints some general information for this run to out.
|
inline |
RAII approach to safely initialize MPI and Kokkos.
At the start of your main(), create this object to run MPI_Init/Finalize and to start the Kokkos scope.
Like this:
int main( int argc, char** argv)
{
// Make sure to not destroy it right away!
// TerraScopeGuard( &argc, &argv );
// will not work! Name the thing!
TerraScopeGuard terra_scope_guard( &argc, &argv );
// Here goes your cool app/test. MPI and Kokkos are finalized automatically (even if you throw an
// exception).
// ...
} // Destructor handles stuff here.
|
inline |
std::ostream subclass that just logs on any process and adds a timestamp for each line.
You should be able to use this as a plugin replacement for std::cout.
|
inline |
std::ostream subclass that just logs on root and adds a timestamp for each line.
You should be able to use this as a plugin replacement for std::cout.