Справочник API

Модуль выполнения

namespace runners

Функции

int Init(int argc, char **argv)

Initializes the testing environment (e.g., MPI, logging).

Параметры:
  • argc – Argument count.

  • argv – Argument vector.

Результат:

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.

Параметры:
  • argc – Argument count.

  • argv – Argument vector.

Результат:

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.

Примечание

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.

Модуль задач

namespace task

Псевдонимы типов

using TaskMapping = std::pair<TypeOfTask, std::string>
using TaskMappingArray = std::array<TaskMapping, 6>
template<typename InType, typename OutType>
using TaskPtr = std::shared_ptr<Task<InType, OutType>>

Smart pointer alias for Task.

Параметры шаблона:
  • InType – Input data type.

  • OutType – Output data type.

Перечисления

enum TypeOfTask

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.

enum StatusOfTask

Indicates whether a task is enabled or disabled.

Values:

enumerator kEnabled

Task is enabled and should be executed.

enumerator kDisabled

Task is disabled and will be skipped.

enum StateOfTesting

Values:

enumerator kFunc
enumerator kPerf

Функции

inline std::string TypeOfTaskToString(TypeOfTask type)
inline std::string GetStringTaskStatus(StatusOfTask status_of_task)

Returns a string representation of the task status.

Параметры:

status_of_taskTask status (enabled or disabled).

Результат:

«enabled» if the task is enabled, otherwise «disabled».

inline std::string GetStringTaskType(TypeOfTask type_of_task, const std::string &settings_file_path)

Returns a string representation of the task type based on the JSON settings file.

Параметры:
  • type_of_task – Type of the task.

  • settings_file_path – Path to the JSON file containing task type strings.

Бросает исключение:

std::runtime_error – If the file cannot be opened.

Результат:

Formatted string combining the task type and its corresponding value from the file.

template<typename TaskType, typename InType>
std::shared_ptr<TaskType> TaskGetter(InType in)

Constructs and returns a shared pointer to a task with the given input.

Параметры шаблона:
  • TaskType – Type of the task to create.

  • InType – Type of the input.

Параметры:

in – Input to pass to the task constructor.

Результат:

Shared a pointer to the newly created task.

Переменные

const TaskMappingArray kTaskTypeMappings = {{{TypeOfTask::kALL, "all"}, {TypeOfTask::kMPI, "mpi"}, {TypeOfTask::kOMP, "omp"}, {TypeOfTask::kSEQ, "seq"}, {TypeOfTask::kSTL, "stl"}, {TypeOfTask::kTBB, "tbb"}}}
template<typename InType, typename OutType>
class Task
#include <task.hpp>

Base abstract class representing a generic task with a defined pipeline.

Параметры шаблона:
  • InType – Input data type.

  • OutType – Output data type.

Вспомогательный модуль (модуль с утилитами)

namespace util

Псевдонимы типов

template<typename InType, typename OutType, typename TestType = void>
using FuncTestParam = std::tuple<std::function<ppc::task::TaskPtr<InType, OutType>(InType)>, std::string, TestType>
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::performance::PerfResults::TypeOfRunning>

Перечисления

enum GTestParamIndex

Values:

enumerator kTaskGetter
enumerator kNameTest
enumerator kTestParams

Функции

template<typename Tuple, std::size_t... Is>
auto ExpandToValuesImpl(const Tuple &t, std::index_sequence<Is...>)
template<typename Tuple>
auto ExpandToValues(const Tuple &t)
template<typename Task, typename InType, typename SizesContainer, std::size_t... Is>
auto GenTaskTuplesImpl(const SizesContainer &sizes, const std::string &settings_path, std::index_sequence<Is...>)
template<typename Task, typename InType, typename SizesContainer>
auto TaskListGenerator(const SizesContainer &sizes, const std::string &settings_path)
template<typename Task, typename InType, typename SizesContainer>
constexpr auto AddFuncTask(const SizesContainer &sizes, const std::string &settings_path)
double GetTimeMPI()
int GetMPIRank()
template<typename TaskType, typename InputType>
auto MakePerfTaskTuples(const std::string &settings_path)
template<typename Tuple, std::size_t... I>
auto TupleToGTestValuesImpl(const Tuple &tup, std::index_sequence<I...>)
template<typename Tuple>
auto TupleToGTestValues(Tuple &&tup)
template<typename InputType, typename ...TaskTypes>
auto MakeAllPerfTasks(const std::string &settings_path)
std::string GetAbsoluteTaskPath(const std::string &id_path, const std::string &relative_path)
int GetNumThreads()
int GetNumProc()
double GetTaskMaxTime()
double GetPerfMaxTime()
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.

Параметры шаблона:
  • InType – Type of input data.

  • OutType – Type of output data.

  • TestType – Type of the test case or parameter.

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.

Параметры шаблона:
  • 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.

Модуль измерения производительности

namespace performance

Функции

inline double DefaultTimer()
inline std::string GetStringParamName(PerfResults::TypeOfRunning type_of_running)
template<typename InType, typename OutType>
class Perf
#include <performance.hpp>
struct PerfAttr
#include <performance.hpp>
struct PerfResults
#include <performance.hpp>