Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
d51431a
refactor CMake scripts: centralize target linking functionality
allnes Jul 2, 2025
b0c18d4
Merge branch 'master' of https://github.com/learning-process/parallel…
allnes Jul 2, 2025
ab3303f
Merge branch 'master' of https://github.com/learning-process/parallel…
allnes Jul 3, 2025
1f9bb76
Merge branch 'master' of https://github.com/learning-process/parallel…
allnes Jul 30, 2025
7bbec06
Merge branch 'master' of https://github.com/learning-process/parallel…
allnes Sep 9, 2025
68516b1
Merge branch 'master' of https://github.com/learning-process/parallel…
allnes Oct 8, 2025
e329437
split HTML scoreboard into threads and processes views; add a menu in…
allnes Oct 8, 2025
05f2264
refactor scoreboard: improve code formatting and HTML consistency
allnes Oct 8, 2025
6f65278
extend scoreboard: add group-specific views, student variants, and en…
allnes Oct 9, 2025
6d01e07
add processes view: introduce detailed layout for processes scoreboard
allnes Oct 9, 2025
48e9803
Merge upstream/master; keep local versions for scoreboard files
allnes Oct 9, 2025
8261acd
Update pages.yml
allnes Oct 9, 2025
47c4e0e
comment out dependencies for perf workflow in main.yml
allnes Oct 9, 2025
e3848bc
uncomment dependencies for perf workflow in main.yml
allnes Oct 9, 2025
c03fa17
refactor scoreboard: improve code formatting and ensure consistent in…
allnes Oct 9, 2025
6ad024c
refactor scoreboard: replace threads-config.yml with points-info.yml;…
allnes Oct 9, 2025
1c4be32
add processes tasks: implement processes module, extend scoring syste…
allnes Oct 9, 2025
e7022bb
Merge upstream/master into an/scoreboard-update-2; keep branch versio…
allnes Oct 9, 2025
7f87f06
Update main.yml
allnes Oct 9, 2025
f7b7544
chore(pre-commit): autofix formatting and lint for changes since upst…
allnes Oct 9, 2025
fedbe81
reduce performance test iteration count to 50 across processes tests
allnes Oct 9, 2025
49b52f7
scoreboard: make generation robust across Python versions; add PyYAML…
allnes Oct 9, 2025
025ca86
chore: enforce consistent pointer/reference formatting across codebase
allnes Oct 9, 2025
76e5e39
increase performance test iterations to 100; adjust threshold for per…
allnes Oct 9, 2025
f5fc04d
update namespace and file paths for `example_processes` to version-sp…
allnes Oct 10, 2025
1f9d8f9
Merge branch 'master' into an/scoreboard-update-2
allnes Oct 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions modules/performance/include/performance.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ template <typename InType, typename OutType>
class Perf {
public:
// Init performance analysis with an initialized task and initialized data
explicit Perf(const ppc::task::TaskPtr<InType, OutType>& task_ptr) : task_(task_ptr) {
explicit Perf(const ppc::task::TaskPtr<InType, OutType> &task_ptr) : task_(task_ptr) {
task_ptr->GetStateOfTesting() = ppc::task::StateOfTesting::kPerf;
}
// Check performance of full task's pipeline: PreProcessing() ->
// Validation() -> Run() -> PostProcessing()
void PipelineRun(const PerfAttr& perf_attr) {
void PipelineRun(const PerfAttr &perf_attr) {
perf_results_.type_of_running = PerfResults::TypeOfRunning::kPipeline;

CommonRun(perf_attr, [&] {
Expand All @@ -55,7 +55,7 @@ class Perf {
}, perf_results_);
}
// Check performance of task's Run() function
void TaskRun(const PerfAttr& perf_attr) {
void TaskRun(const PerfAttr &perf_attr) {
perf_results_.type_of_running = PerfResults::TypeOfRunning::kTaskRun;

task_->Validation();
Expand All @@ -69,7 +69,7 @@ class Perf {
task_->PostProcessing();
}
// Print results for automation checkers
void PrintPerfStatistic(const std::string& test_id) const {
void PrintPerfStatistic(const std::string &test_id) const {
std::string type_test_name;
if (perf_results_.type_of_running == PerfResults::TypeOfRunning::kTaskRun) {
type_test_name = "task_run";
Expand Down Expand Up @@ -106,7 +106,7 @@ class Perf {
private:
PerfResults perf_results_;
std::shared_ptr<ppc::task::Task<InType, OutType>> task_;
static void CommonRun(const PerfAttr& perf_attr, const std::function<void()>& pipeline, PerfResults& perf_results) {
static void CommonRun(const PerfAttr &perf_attr, const std::function<void()> &pipeline, PerfResults &perf_results) {
auto begin = perf_attr.current_timer();
for (uint64_t i = 0; i < perf_attr.num_running; i++) {
pipeline();
Expand Down
16 changes: 8 additions & 8 deletions modules/performance/tests/perf_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace ppc::test {
template <typename InType, typename OutType>
class TestPerfTask : public ppc::task::Task<InType, OutType> {
public:
explicit TestPerfTask(const InType& in) {
explicit TestPerfTask(const InType &in) {
this->GetInput() = in;
}

Expand Down Expand Up @@ -53,7 +53,7 @@ class TestPerfTask : public ppc::task::Task<InType, OutType> {
template <typename InType, typename OutType>
class FakePerfTask : public TestPerfTask<InType, OutType> {
public:
explicit FakePerfTask(const InType& in) : TestPerfTask<InType, OutType>(in) {}
explicit FakePerfTask(const InType &in) : TestPerfTask<InType, OutType>(in) {}

bool RunImpl() override {
std::this_thread::sleep_for(std::chrono::seconds(11));
Expand Down Expand Up @@ -164,31 +164,31 @@ TEST(PerfTests, CheckPerfTaskFloat) {
struct ParamTestCase {
PerfResults::TypeOfRunning input;
std::string expected_output;
friend void PrintTo(const ParamTestCase& param, std::ostream* os) {
friend void PrintTo(const ParamTestCase &param, std::ostream *os) {
*os << "{ input = " << static_cast<int>(param.input) << ", expected = " << param.expected_output << " }";
}
};

class GetStringParamNameParamTest : public ::testing::TestWithParam<ParamTestCase> {};

TEST_P(GetStringParamNameParamTest, ReturnsExpectedString) {
const auto& param = GetParam();
const auto &param = GetParam();
EXPECT_EQ(GetStringParamName(param.input), param.expected_output);
}

INSTANTIATE_TEST_SUITE_P(ParamTests, GetStringParamNameParamTest,
::testing::Values(ParamTestCase{PerfResults::TypeOfRunning::kTaskRun, "task_run"},
ParamTestCase{PerfResults::TypeOfRunning::kPipeline, "pipeline"},
ParamTestCase{PerfResults::TypeOfRunning::kNone, "none"}),
[](const ::testing::TestParamInfo<ParamTestCase>& info) {
[](const ::testing::TestParamInfo<ParamTestCase> &info) {
return info.param.expected_output;
});

struct TaskTypeTestCase {
TypeOfTask type;
std::string expected;
std::string label;
friend void PrintTo(const TaskTypeTestCase& param, std::ostream* os) {
friend void PrintTo(const TaskTypeTestCase &param, std::ostream *os) {
*os << "{ type = " << static_cast<int>(param.type) << ", expected = " << param.expected
<< ", label = " << param.label << " }";
}
Expand Down Expand Up @@ -217,7 +217,7 @@ class GetStringTaskTypeTest : public ::testing::TestWithParam<TaskTypeTestCase>
};

TEST_P(GetStringTaskTypeTest, ReturnsExpectedString) {
const auto& param = GetParam();
const auto &param = GetParam();
EXPECT_EQ(GetStringTaskType(param.type, temp_path), param.expected) << "Failed on: " << param.label;
}

Expand All @@ -236,7 +236,7 @@ TEST(GetStringTaskTypeStandaloneTest, ThrowsIfFileMissing) {

TEST(GetStringTaskTypeStandaloneTest, ExceptionMessageContainsPath) {
const std::string missing_path = "non_existent_settings.json";
EXPECT_THROW(try { GetStringTaskType(TypeOfTask::kSEQ, missing_path); } catch (const std::runtime_error& e) {
EXPECT_THROW(try { GetStringTaskType(TypeOfTask::kSEQ, missing_path); } catch (const std::runtime_error &e) {
EXPECT_NE(std::string(e.what()).find(missing_path), std::string::npos);
throw;
},
Expand Down
10 changes: 5 additions & 5 deletions modules/runners/include/runners.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class UnreadMessagesDetector : public ::testing::EmptyTestEventListener {
public:
UnreadMessagesDetector() = default;
/// @brief Called by GTest after a test ends. Checks for unread messages.
void OnTestEnd(const ::testing::TestInfo& /*test_info*/) override;
void OnTestEnd(const ::testing::TestInfo & /*test_info*/) override;

private:
};
Expand All @@ -26,9 +26,9 @@ class WorkerTestFailurePrinter : public ::testing::EmptyTestEventListener {
/// @param base A shared pointer to another GTest event listener.
explicit WorkerTestFailurePrinter(std::shared_ptr<::testing::TestEventListener> base) : base_(std::move(base)) {}
/// @brief Called after a test ends. Passes call base listener and print failures with rank.
void OnTestEnd(const ::testing::TestInfo& test_info) override;
void OnTestEnd(const ::testing::TestInfo &test_info) override;
/// @brief Called when a test part fails. Prints MPI rank info along with the failure.
void OnTestPartResult(const ::testing::TestPartResult& test_part_result) override;
void OnTestPartResult(const ::testing::TestPartResult &test_part_result) override;

private:
/// @brief Prints the MPI rank of the current process to stderr.
Expand All @@ -41,12 +41,12 @@ class WorkerTestFailurePrinter : public ::testing::EmptyTestEventListener {
/// @param argv Argument vector.
/// @return Exit code from RUN_ALL_TESTS or MPI error code if initialization/
/// finalization fails.
int Init(int argc, char** argv);
int Init(int argc, char **argv);

/// @brief Initializes the testing environment only for gtest.
/// @param argc Argument count.
/// @param argv Argument vector.
/// @return Exit code from RUN_ALL_TESTS.
int SimpleInit(int argc, char** argv);
int SimpleInit(int argc, char **argv);

} // namespace ppc::runners
14 changes: 7 additions & 7 deletions modules/runners/src/runners.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

namespace ppc::runners {

void UnreadMessagesDetector::OnTestEnd(const ::testing::TestInfo& /*test_info*/) {
void UnreadMessagesDetector::OnTestEnd(const ::testing::TestInfo & /*test_info*/) {
int rank = -1;
MPI_Comm_rank(MPI_COMM_WORLD, &rank);

Expand All @@ -42,15 +42,15 @@ void UnreadMessagesDetector::OnTestEnd(const ::testing::TestInfo& /*test_info*/)
MPI_Barrier(MPI_COMM_WORLD);
}

void WorkerTestFailurePrinter::OnTestEnd(const ::testing::TestInfo& test_info) {
void WorkerTestFailurePrinter::OnTestEnd(const ::testing::TestInfo &test_info) {
if (test_info.result()->Passed()) {
return;
}
PrintProcessRank();
base_->OnTestEnd(test_info);
}

void WorkerTestFailurePrinter::OnTestPartResult(const ::testing::TestPartResult& test_part_result) {
void WorkerTestFailurePrinter::OnTestPartResult(const ::testing::TestPartResult &test_part_result) {
if (test_part_result.passed() || test_part_result.skipped()) {
return;
}
Expand All @@ -75,7 +75,7 @@ int RunAllTests() {
}
} // namespace

int Init(int argc, char** argv) {
int Init(int argc, char **argv) {
const int init_res = MPI_Init(&argc, &argv);
if (init_res != MPI_SUCCESS) {
std::cerr << std::format("[ ERROR ] MPI_Init failed with code {}", init_res) << '\n';
Expand All @@ -88,11 +88,11 @@ int Init(int argc, char** argv) {

::testing::InitGoogleTest(&argc, argv);

auto& listeners = ::testing::UnitTest::GetInstance()->listeners();
auto &listeners = ::testing::UnitTest::GetInstance()->listeners();
int rank = -1;
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
if (rank != 0 && (argc < 2 || argv[1] != std::string("--print-workers"))) {
auto* listener = listeners.Release(listeners.default_result_printer());
auto *listener = listeners.Release(listeners.default_result_printer());
listeners.Append(new WorkerTestFailurePrinter(std::shared_ptr<::testing::TestEventListener>(listener)));
}
listeners.Append(new UnreadMessagesDetector());
Expand All @@ -108,7 +108,7 @@ int Init(int argc, char** argv) {
return status;
}

int SimpleInit(int argc, char** argv) {
int SimpleInit(int argc, char **argv) {
// Limit the number of threads in TBB
tbb::global_control control(tbb::global_control::max_allowed_parallelism, ppc::util::GetNumThreads());

Expand Down
12 changes: 6 additions & 6 deletions modules/task/tests/task_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace ppc::test {
template <typename InType, typename OutType>
class TestTask : public ppc::task::Task<InType, OutType> {
public:
explicit TestTask(const InType& in) {
explicit TestTask(const InType &in) {
this->GetInput() = in;
}

Expand Down Expand Up @@ -69,7 +69,7 @@ class TestTask : public ppc::task::Task<InType, OutType> {
template <typename InType, typename OutType>
class FakeSlowTask : public TestTask<InType, OutType> {
public:
explicit FakeSlowTask(const InType& in) : TestTask<InType, OutType>(in) {}
explicit FakeSlowTask(const InType &in) : TestTask<InType, OutType>(in) {}

bool RunImpl() override {
std::this_thread::sleep_for(std::chrono::seconds(2));
Expand Down Expand Up @@ -230,7 +230,7 @@ TEST(TaskTest, TaskDestructorThrowsIfStageIncomplete) {
{
std::vector<int32_t> in(20, 1);
struct LocalTask : Task<std::vector<int32_t>, int32_t> {
explicit LocalTask(const std::vector<int32_t>& in) {
explicit LocalTask(const std::vector<int32_t> &in) {
this->GetInput() = in;
}
bool ValidationImpl() override {
Expand All @@ -256,7 +256,7 @@ TEST(TaskTest, TaskDestructorThrowsIfEmpty) {
{
std::vector<int32_t> in(20, 1);
struct LocalTask : Task<std::vector<int32_t>, int32_t> {
explicit LocalTask(const std::vector<int32_t>& in) {
explicit LocalTask(const std::vector<int32_t> &in) {
this->GetInput() = in;
}
bool ValidationImpl() override {
Expand All @@ -279,7 +279,7 @@ TEST(TaskTest, TaskDestructorThrowsIfEmpty) {

TEST(TaskTest, InternalTimeTestThrowsIfTimeoutExceeded) {
struct SlowTask : Task<std::vector<int32_t>, int32_t> {
explicit SlowTask(const std::vector<int32_t>& in) {
explicit SlowTask(const std::vector<int32_t> &in) {
this->GetInput() = in;
}
bool ValidationImpl() override {
Expand Down Expand Up @@ -346,6 +346,6 @@ TEST(TaskTest, PostProcessingThrowsIfCalledBeforeRun) {
EXPECT_THROW(task->PostProcessing(), std::runtime_error);
}

int main(int argc, char** argv) {
int main(int argc, char **argv) {
return ppc::runners::SimpleInit(argc, argv);
}
26 changes: 13 additions & 13 deletions modules/util/include/func_test_util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ template <typename InType, typename OutType, typename TestType = void>
/// @tparam TestType Type of the test case or parameter.
class BaseRunFuncTests : public ::testing::TestWithParam<FuncTestParam<InType, OutType, TestType>> {
public:
virtual bool CheckTestOutputData(OutType& output_data) = 0;
virtual bool CheckTestOutputData(OutType &output_data) = 0;
/// @brief Provides input data for the task.
/// @return Initialized input data.
virtual InType GetTestInputData() = 0;
Expand All @@ -48,7 +48,7 @@ class BaseRunFuncTests : public ::testing::TestWithParam<FuncTestParam<InType, O
}

template <typename Derived>
static std::string PrintFuncTestName(const GTestFuncParam<InType, OutType, TestType>& info) {
static std::string PrintFuncTestName(const GTestFuncParam<InType, OutType, TestType> &info) {
RequireStaticInterface<Derived>();
TestType test_param = std::get<static_cast<std::size_t>(ppc::util::GTestParamIndex::kTestParams)>(info.param);
return std::get<static_cast<std::size_t>(GTestParamIndex::kNameTest)>(info.param) + "_" +
Expand All @@ -57,7 +57,7 @@ class BaseRunFuncTests : public ::testing::TestWithParam<FuncTestParam<InType, O

protected:
void ExecuteTest(FuncTestParam<InType, OutType, TestType> test_param) {
const std::string& test_name = std::get<static_cast<std::size_t>(GTestParamIndex::kNameTest)>(test_param);
const std::string &test_name = std::get<static_cast<std::size_t>(GTestParamIndex::kNameTest)>(test_param);

ValidateTestName(test_name);

Expand All @@ -73,24 +73,24 @@ class BaseRunFuncTests : public ::testing::TestWithParam<FuncTestParam<InType, O
InitializeAndRunTask(test_param);
}

void ValidateTestName(const std::string& test_name) {
void ValidateTestName(const std::string &test_name) {
EXPECT_FALSE(test_name.find("unknown") != std::string::npos);
}

bool IsTestDisabled(const std::string& test_name) {
bool IsTestDisabled(const std::string &test_name) {
return test_name.find("disabled") != std::string::npos;
}

bool ShouldSkipNonMpiTask(const std::string& test_name) {
auto contains_substring = [&](const std::string& substring) {
bool ShouldSkipNonMpiTask(const std::string &test_name) {
auto contains_substring = [&](const std::string &substring) {
return test_name.find(substring) != std::string::npos;
};

return !ppc::util::IsUnderMpirun() && (contains_substring("_all") || contains_substring("_mpi"));
}

/// @brief Initializes task instance and runs it through the full pipeline.
void InitializeAndRunTask(const FuncTestParam<InType, OutType, TestType>& test_param) {
void InitializeAndRunTask(const FuncTestParam<InType, OutType, TestType> &test_param) {
task_ = std::get<static_cast<std::size_t>(GTestParamIndex::kTaskGetter)>(test_param)(GetTestInputData());
ExecuteTaskPipeline();
}
Expand All @@ -110,18 +110,18 @@ class BaseRunFuncTests : public ::testing::TestWithParam<FuncTestParam<InType, O
};

template <typename Tuple, std::size_t... Is>
auto ExpandToValuesImpl(const Tuple& t, std::index_sequence<Is...> /*unused*/) {
auto ExpandToValuesImpl(const Tuple &t, std::index_sequence<Is...> /*unused*/) {
return ::testing::Values(std::get<Is>(t)...);
}

template <typename Tuple>
auto ExpandToValues(const Tuple& t) {
auto ExpandToValues(const Tuple &t) {
constexpr std::size_t kN = std::tuple_size_v<Tuple>;
return ExpandToValuesImpl(t, std::make_index_sequence<kN>{});
}

template <typename Task, typename InType, typename SizesContainer, std::size_t... Is>
auto GenTaskTuplesImpl(const SizesContainer& sizes, const std::string& settings_path,
auto GenTaskTuplesImpl(const SizesContainer &sizes, const std::string &settings_path,
std::index_sequence<Is...> /*unused*/) {
return std::make_tuple(std::make_tuple(ppc::task::TaskGetter<Task, InType>,
std::string(GetNamespace<Task>()) + "_" +
Expand All @@ -130,13 +130,13 @@ auto GenTaskTuplesImpl(const SizesContainer& sizes, const std::string& settings_
}

template <typename Task, typename InType, typename SizesContainer>
auto TaskListGenerator(const SizesContainer& sizes, const std::string& settings_path) {
auto TaskListGenerator(const SizesContainer &sizes, const std::string &settings_path) {
return GenTaskTuplesImpl<Task, InType>(sizes, settings_path,
std::make_index_sequence<std::tuple_size_v<std::decay_t<SizesContainer>>>{});
}

template <typename Task, typename InType, typename SizesContainer>
constexpr auto AddFuncTask(const SizesContainer& sizes, const std::string& settings_path) {
constexpr auto AddFuncTask(const SizesContainer &sizes, const std::string &settings_path) {
return TaskListGenerator<Task, InType>(sizes, settings_path);
}

Expand Down
Loading
Loading