|
LBANN
0.103.0
LivermoreBigArtificialNeuralNetworkToolkit
|
Namespaces | |
| expert | |
| Expert-only methods. | |
Classes | |
| struct | BadPointer |
| struct | BadSubstitutionPattern |
| Indicates that an invalid pattern is detected. More... | |
Functions | |
| lbann::lbann_comm & | current_world_comm () |
| Get the world communicator for this MPI session. More... | |
| template<typename T > | |
| size_t | as_size (T const &size) noexcept |
| std::string | replace_escapes (std::string const &str, lbann::utils::SystemInfo const &sys_info) |
| Substitute basic escape sequences in a string. More... | |
| template<typename T > | |
| bool | IsValidPtr (std::unique_ptr< T > const &ptr) noexcept |
| template<typename T > | |
| bool | IsValidPtr (std::shared_ptr< T > const &ptr) noexcept |
| template<typename T > | |
| bool | IsValidPtr (T const *ptr) noexcept |
| lbann::default_arg_parser_type & | reset_global_argument_parser () |
| Return the global LBANN argument parser reset to its default condition. More... | |
| void | mock_data_reader (lbann::trainer &trainer, const std::vector< El::Int > &sample_size, int num_classes) |
|
noexcept |
Definition at line 61 of file MPITestHelpers.hpp.
| lbann::lbann_comm& unit_test::utilities::current_world_comm | ( | ) |
Get the world communicator for this MPI session.
|
noexcept |
Definition at line 40 of file TestHelpers.hpp.
|
noexcept |
Definition at line 46 of file TestHelpers.hpp.
|
noexcept |
Definition at line 52 of file TestHelpers.hpp.
|
inline |
| std::string unit_test::utilities::replace_escapes | ( | std::string const & | str, |
| lbann::utils::SystemInfo const & | sys_info | ||
| ) |
Substitute basic escape sequences in a string.
The following patterns are supported:
| Pattern | Replacement |
|---|---|
| %% | A literal percent sign ("%") |
| %h | The hostname of the current process |
| %p | The PID of the current process |
| %r | The MPI rank of the current process, if available, or 0 |
| %s | The MPI size of the current job, if available, or 1 |
| %env{<NAME>} | The value of ${NAME} in the current environment |
The MPI runtime is queried if available for MPI information. After that, environment variables are checked for common libraries (SLURM, Open-MPI, MVAPICH2). If neither of these methods gives the required information, default information consistent with a sequential job is returned: the rank will be 0 and the size will be 1.
If the "%env{<NAME>}" substitution fails to find NAME in the current environment, the replacement will be the empty string.
The double-percent sequence is extracted first, so "%%r" will return "%r" and "%%%r" will return "%<mpi-rank>".
| str | The string to which substitutions should be applied. |
| sys_info | The source of system information. This is primarily exposed for stubbing the functionality to test this function. |
| BadSubstitutionPattern | An escape sequence is found in the string that has no valid substitution. |
|
inline |
Return the global LBANN argument parser reset to its default condition.
With respect to testing, this means that the options have been added as with lbann::construct_all_options().
Definition at line 63 of file TestHelpers.hpp.