| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #pragma once | ||
| 2 | |||
| 3 | #include <utility> | ||
| 4 | #include <vector> | ||
| 5 | |||
| 6 | #include "artyushkina_string_matrix/common/include/common.hpp" | ||
| 7 | #include "task/include/task.hpp" | ||
| 8 | |||
| 9 | namespace artyushkina_string_matrix { | ||
| 10 | |||
| 11 | ✗ | class ArtyushkinaStringMatrixMPI : public BaseTask { | |
| 12 | public: | ||
| 13 | static constexpr ppc::task::TypeOfTask GetStaticTypeOfTask() { | ||
| 14 | return ppc::task::TypeOfTask::kMPI; | ||
| 15 | } | ||
| 16 | explicit ArtyushkinaStringMatrixMPI(const InType &in); | ||
| 17 | |||
| 18 | static std::vector<int> FlattenMatrix(const std::vector<std::vector<int>> &matrix); | ||
| 19 | |||
| 20 | private: | ||
| 21 | bool ValidationImpl() override; | ||
| 22 | bool PreProcessingImpl() override; | ||
| 23 | bool RunImpl() override; | ||
| 24 | bool PostProcessingImpl() override; | ||
| 25 | |||
| 26 | static std::pair<int, int> PrepareDimensions(const std::vector<std::vector<int>> &matrix, int rank, int &size); | ||
| 27 | static std::pair<int, int> CalculateProcessInfo(int total_rows, int size, int rank); | ||
| 28 | static std::vector<int> ScatterData(const std::vector<std::vector<int>> &matrix, int total_rows, int total_cols, | ||
| 29 | int size, int rank, int my_rows); | ||
| 30 | static std::vector<int> ComputeLocalMinima(const std::vector<int> &local_data, int my_rows, int total_cols); | ||
| 31 | static std::vector<int> GatherResults(const std::vector<int> &local_minima, int total_rows, int size, int rank, | ||
| 32 | int my_rows); | ||
| 33 | }; | ||
| 34 | |||
| 35 | } // namespace artyushkina_string_matrix | ||
| 36 |