26#include "RedistributorMatrix.h"
29#include <alien/kernels/dok/DoKBackEnd.h>
30#include <alien/kernels/dok/DoKMatrixT.h>
32#include "RedistributorBackEnd.h"
33#include "RedistributorCommPlan.h"
41using namespace Arccore;
42using namespace Arccore::MessagePassing;
44RedistributorMatrix::RedistributorMatrix(
const MultiMatrixImpl* src_impl,
bool use_dok)
51 m_super_pm = IMatrixImpl::distribution().parallelMng();
60void RedistributorMatrix::setSuperPM(IMessagePassingMng* pm)
65void RedistributorMatrix::useCSRRedistributor()
70std::shared_ptr<MultiMatrixImpl>
71RedistributorMatrix::updateTargetPM(
const RedistributorCommPlan* commPlan)
73 if (m_tgt_impl && m_tgt_impl->distribution().parallelMng() == commPlan->tgtParallelMng().get())
76 const MatrixDistribution& src_dist = distribution();
77 m_tgt_dist.reset(
new MatrixDistribution(
78 src_dist.globalRowSize(), src_dist.globalColSize(), commPlan->tgtParallelMng()));
80 new MultiMatrixImpl(rowSpace().clone(), colSpace().clone(), m_tgt_dist));
84 m_distributor.reset(
new DoKDistributor(commPlan));
86 const VectorDistribution& row_src_dist = distribution().rowDistribution();
87 const auto& mat_src = m_multi_impl->get<BackEnd::tag::simplecsr>();
88 m_simple_csr_distibutor = std::make_unique<SimpleCSRDistributor>(commPlan, row_src_dist, &mat_src.getProfile());
90 return redistribute();
93std::shared_ptr<MultiMatrixImpl>
94RedistributorMatrix::redistribute()
97 auto& mat_src = m_multi_impl->get<BackEnd::tag::DoK>();
98 auto& mat_tgt = m_tgt_impl->get<BackEnd::tag::DoK>(
true);
99 m_distributor->distribute(mat_src, mat_tgt);
102 auto& mat_src = m_multi_impl->get<BackEnd::tag::simplecsr>();
103 auto& mat_tgt = m_tgt_impl->get<BackEnd::tag::simplecsr>(
true);
104 m_simple_csr_distibutor->distribute(mat_src, mat_tgt);
Interface to handle abstract matrices implementation.
Multi matrices representation container.
void clear() override
Demande la lib�ration des donn�es.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --