| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #pragma once | ||
| 2 | |||
| 3 | #include <vector> | ||
| 4 | |||
| 5 | #include "ilin_a_alternations_signs_of_val_vec/common/include/common.hpp" | ||
| 6 | #include "task/include/task.hpp" | ||
| 7 | |||
| 8 | namespace ilin_a_alternations_signs_of_val_vec { | ||
| 9 | |||
| 10 |
1/2✓ Branch 0 taken 36 times.
✗ Branch 1 not taken.
|
36 | struct BoundaryInfo { |
| 11 | std::vector<int> all_edges; | ||
| 12 | }; | ||
| 13 | |||
| 14 | class IlinAAlternationsSignsOfValVecMPI : public BaseTask { | ||
| 15 | public: | ||
| 16 | static constexpr ppc::task::TypeOfTask GetStaticTypeOfTask() { | ||
| 17 | return ppc::task::TypeOfTask::kMPI; | ||
| 18 | } | ||
| 19 | explicit IlinAAlternationsSignsOfValVecMPI(const InType &in); | ||
| 20 | |||
| 21 | private: | ||
| 22 | bool ValidationImpl() override; | ||
| 23 | bool PreProcessingImpl() override; | ||
| 24 | bool RunImpl() override; | ||
| 25 | bool PostProcessingImpl() override; | ||
| 26 | |||
| 27 | static int CountLocalSignChanges(const std::vector<int> &segment); | ||
| 28 | static BoundaryInfo GatherEdgeValues(const std::vector<int> &segment); | ||
| 29 | static int CountEdgeAlternations(const BoundaryInfo &edges, int total_processes); | ||
| 30 | static void CalculateDistribution(int data_size, int world_size, std::vector<int> &counts, std::vector<int> &offsets); | ||
| 31 | static void DistributeData(const std::vector<int> &global_data, std::vector<int> &local_data, int world_rank, | ||
| 32 | int world_size); | ||
| 33 | }; | ||
| 34 | |||
| 35 | } // namespace ilin_a_alternations_signs_of_val_vec | ||
| 36 |