| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #pragma once | ||
| 2 | |||
| 3 | #include <vector> | ||
| 4 | |||
| 5 | #include "badanov_a_sparse_matrix_mult_double_ccs/common/include/common.hpp" | ||
| 6 | #include "task/include/task.hpp" | ||
| 7 | |||
| 8 | namespace badanov_a_sparse_matrix_mult_double_ccs { | ||
| 9 | |||
| 10 | class BadanovASparseMatrixMultDoubleCcsMPI : public BaseTask { | ||
| 11 | public: | ||
| 12 | static constexpr ppc::task::TypeOfTask GetStaticTypeOfTask() { | ||
| 13 | return ppc::task::TypeOfTask::kMPI; | ||
| 14 | } | ||
| 15 | explicit BadanovASparseMatrixMultDoubleCcsMPI(const InType &in); | ||
| 16 | |||
| 17 | private: | ||
| 18 | bool ValidationImpl() override; | ||
| 19 | bool PreProcessingImpl() override; | ||
| 20 | bool RunImpl() override; | ||
| 21 | bool PostProcessingImpl() override; | ||
| 22 | |||
| 23 | 30 | struct LocalData { | |
| 24 | SparseMatrix a_local; | ||
| 25 | SparseMatrix b_local; | ||
| 26 | int global_rows{}; | ||
| 27 | int global_inner_dim{}; | ||
| 28 | int global_cols{}; | ||
| 29 | }; | ||
| 30 | |||
| 31 | static LocalData DistributeDataHorizontal(int world_rank, int world_size, const SparseMatrix &a, | ||
| 32 | const SparseMatrix &b); | ||
| 33 | static SparseMatrix MultiplyLocal(const LocalData &local); | ||
| 34 | static void GatherResults(int world_rank, int world_size, const SparseMatrix &local_c, SparseMatrix &global_c); | ||
| 35 | static std::vector<double> SparseDotProduct(const SparseMatrix &a, const SparseMatrix &b, int col_b); | ||
| 36 | }; | ||
| 37 | |||
| 38 | } // namespace badanov_a_sparse_matrix_mult_double_ccs | ||
| 39 |