API Reference
Runners Module
-
namespace runners
Functions
-
int Init(int argc, char **argv)
Initializes the testing environment (e.g., MPI, logging).
- Parameters:
argc – Argument count.
argv – Argument vector.
- Returns:
Exit code from RUN_ALL_TESTS or MPI error code if initialization/ finalization fails.
-
int SimpleInit(int argc, char **argv)
Initializes the testing environment only for gtest.
- Parameters:
argc – Argument count.
argv – Argument vector.
- Returns:
Exit code from RUN_ALL_TESTS.
-
class UnreadMessagesDetector : public testing::EmptyTestEventListener
- #include <runners.hpp>
GTest event listener that checks for unread MPI messages after each test.
Note
Used to detect unexpected inter-process communication leftovers.
-
class WorkerTestFailurePrinter : public testing::EmptyTestEventListener
- #include <runners.hpp>
GTest event listener that prints additional information on test failures in worker processes.
Includes MPI rank info in failure output for debugging.
-
int Init(int argc, char **argv)
Task Module
-
namespace task
Typedefs
-
using TaskMapping = std::pair<TypeOfTask, std::string_view>
-
using TaskMappingArray = std::array<TaskMapping, 6>
Enums
-
enum class TypeOfTask : uint8_t
Represents the type of task (parallelization technology).
Used to select the implementation type in tests and execution logic.
Values:
-
enumerator kALL
Use all available implementations.
-
enumerator kMPI
MPI (Message Passing Interface).
-
enumerator kOMP
OpenMP (Open Multi-Processing).
-
enumerator kSEQ
Sequential implementation.
-
enumerator kSTL
Standard Thread Library (STL threads).
-
enumerator kTBB
Intel Threading Building Blocks (TBB).
-
enumerator kUnknown
Unknown task type.
-
enumerator kALL
-
enum class StatusOfTask : uint8_t
Indicates whether a task is enabled or disabled.
Values:
Functions
-
std::string_view TypeOfTaskToString(TypeOfTask type)
-
TypeOfTask TypeOfTaskFromString(std::string_view type)
-
std::string_view StatusOfTaskToString(StatusOfTask status_of_task)
-
inline StatusOfTask StatusOfTaskFromString(std::string_view status_of_task)
-
inline std::string GetStringTaskStatus(StatusOfTask status_of_task)
Returns a string representation of the task status.
- Parameters:
status_of_task – Task status (enabled or disabled).
- Returns:
“enabled” if the task is enabled, otherwise “disabled”.
-
std::string_view TaskCategoryToString(TaskCategory category)
-
TaskCategory TaskCategoryFromSettingsPath(std::string_view settings_task_path)
-
inline StatusOfTask GetTaskStatus(TypeOfTask type_of_task, const std::string &settings_file_path, std::string_view settings_task_path = {})
Returns a string representation of the task type based on the JSON settings file.
- Parameters:
type_of_task – Type of the task.
settings_file_path – Path to the JSON file containing task type strings.
settings_task_path – Optional dot-separated nested path inside the
tasksobject.
- Throws:
std::runtime_error – If the file cannot be opened or the requested settings key is missing.
- Returns:
Formatted string combining the task type and its corresponding value from the file.
-
inline std::string GetStringTaskType(TypeOfTask type_of_task, const std::string &settings_file_path, std::string_view settings_task_path = {})
-
template<typename TaskType, typename InType>
std::unique_ptr<TaskType> TaskGetter(const InType &in) Constructs and returns a pointer to a task with the given input.
- Template Parameters:
TaskType – Type of the task to create.
InType – Type of the input.
- Parameters:
in – Input to pass to the task constructor.
- Returns:
Unique pointer to the newly created task.
Variables
-
TaskMappingArray kTaskTypeMappings = {{{TypeOfTask::kALL, "all"}, {TypeOfTask::kMPI, "mpi"}, {TypeOfTask::kOMP, "omp"}, {TypeOfTask::kSEQ, "seq"}, {TypeOfTask::kSTL, "stl"}, {TypeOfTask::kTBB, "tbb"}}}
-
struct TaskDescriptor
- #include <task.hpp>
-
template<typename InType, typename OutType>
class Task - #include <task.hpp>
Base abstract class representing a generic task with a defined pipeline.
- Template Parameters:
InType – Input data type.
OutType – Output data type.
-
using TaskMapping = std::pair<TypeOfTask, std::string_view>
Utility Module
-
namespace util
Typedefs
-
template<typename InType, typename OutType, typename TestType = void>
using FuncTestParam = std::tuple<std::function<ppc::task::TaskPtr<InType, OutType>(InType)>, std::string, TestType, ppc::task::TaskDescriptor>
-
template<typename InType, typename OutType, typename TestType = void>
using GTestFuncParam = ::testing::TestParamInfo<FuncTestParam<InType, OutType, TestType>>
-
template<typename InType, typename OutType>
using PerfTestParam = std::tuple<std::function<ppc::task::TaskPtr<InType, OutType>(InType)>, std::string, ppc::task::TaskCategory, ppc::task::TaskDescriptor>
Enums
Functions
-
template<typename TestTasksList, typename RunTestCase>
void RunTestCasesWithTag(const TestTasksList &test_tasks_list, std::string_view task_tag, RunTestCase run_test_case)
-
template<typename Tuple, std::size_t... Is>
auto ExpandToValuesImpl(const Tuple &t, std::index_sequence<Is...>)
-
template<typename Task, typename InType, typename SizesContainer, std::size_t... Is>
auto GenTaskTuplesImpl(const SizesContainer &sizes, const std::string &settings_path, std::string_view settings_task_path, std::index_sequence<Is...>)
-
template<typename Task, typename InType, typename SizesContainer>
auto TaskListGenerator(const SizesContainer &sizes, const std::string &settings_path, std::string_view settings_task_path = {})
-
template<typename Task, typename InType, typename SizesContainer>
auto AddFuncTask(const SizesContainer &sizes, const std::string &settings_path, std::string_view settings_task_path = {})
-
inline double DefaultTimer()
-
template<typename TaskType, typename InputType>
auto MakePerfTaskTuples(const std::string &settings_path, std::string_view settings_task_path = {})
-
template<typename Tuple, std::size_t... I>
auto TupleToGTestValuesImpl(const Tuple &tup, std::index_sequence<I...>)
-
template<typename InputType, typename ...TaskTypes>
auto MakeAllPerfTasks(const std::string &settings_path, std::string_view settings_task_path = {})
-
inline ppc::task::TaskDescriptor MakeTaskDescriptor(std::string_view task_namespace, ppc::task::TypeOfTask task_type, const std::string &settings_path, std::string_view settings_task_path = {})
-
template<typename TestParam>
const ppc::task::TaskDescriptor &GetTaskDescriptor(const TestParam &test_param)
-
inline bool IsMpiTaskType(ppc::task::TypeOfTask type)
-
std::string GetAbsoluteTaskPath(const std::string &id_path, const std::string &relative_path)
-
int GetNumThreads()
-
int GetNumProc()
-
double GetTaskMaxTime()
-
double GetPerfMaxTime()
-
double GetTimeMPI()
-
int GetMPIRank()
-
void ConfigureMpiEnvironment()
-
void SynchronizeMpiRanks()
-
template<typename T>
std::string GetNamespace()
-
inline std::shared_ptr<nlohmann::json> InitJSONPtr()
-
bool IsUnderMpirun()
-
template<typename InType, typename OutType, typename TestType = void>
class BaseRunFuncTests : public testing::TestWithParam<FuncTestParam<InType, OutType, void>> - #include <func_test_util.hpp>
Base class for running functional tests on parallel tasks.
- Template Parameters:
InType – Type of input data.
OutType – Type of output data.
TestType – Type of the test case or parameter.
-
struct PerfAttr
- #include <perf_test_util.hpp>
-
template<typename InType, typename OutType>
class BaseRunPerfTests : public testing::TestWithParam<PerfTestParam<InType, OutType>> - #include <perf_test_util.hpp>
Base class for performance testing of parallel tasks.
- Template Parameters:
InType – Input data type.
OutType – Output data type.
-
class DestructorFailureFlag
- #include <util.hpp>
Utility class for tracking destructor failure across tests.
Provides thread-safe methods to set, unset, and check the failure flag.
-
class PerformanceFailureFlag
- #include <util.hpp>
-
namespace detail
Functions
-
inline ppc::task::TypeOfTask TaskTypeFromFuncTestTag(std::string_view task_tag)
-
inline bool ContainsDescriptorToken(std::string_view filter, std::string_view descriptor_token)
-
inline bool ShouldRunBenchmark(const ppc::task::TaskDescriptor &descriptor)
-
template<typename InType, typename OutType>
void RunTaskForValidation(const ppc::task::TaskPtr<InType, OutType> &task)
-
inline std::function<double()> MakeTechnologyTimer(ppc::task::TypeOfTask task_type)
-
inline double MaxElapsedTimeAcrossMpiRanks(double elapsed, ppc::task::TypeOfTask task_type)
-
inline void SkipBenchmarkWithError(benchmark::State &state, const char *message) noexcept
-
inline void CheckPerfTimeLimit(double elapsed)
-
template<typename InType, typename OutType>
double RunTaskForBenchmark(const ppc::task::TaskPtr<InType, OutType> &task)
-
template<typename TaskGetter, typename InType>
void RunBenchmarkBody(const TaskGetter &task_getter, const InType &input_data, const std::string &test_env_token, benchmark::State &state) noexcept
-
template<typename TaskGetter, typename InType>
class BenchmarkTaskBody - #include <perf_test_util.hpp>
-
inline ppc::task::TypeOfTask TaskTypeFromFuncTestTag(std::string_view task_tag)
-
template<typename InType, typename OutType, typename TestType = void>