Alien  1.3.0
Developer documentation
Loading...
Searching...
No Matches
Redistributor.cc
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7
8#include "Redistributor.h"
9
10#include <arccore/message_passing/Messages.h>
11
14
15#include <memory>
16
17#include "RedistributorBackEnd.h"
18#include "RedistributorMatrix.h"
19#include "RedistributorVector.h"
20
21using namespace Arccore::MessagePassing;
22using namespace Arccore;
23
24namespace Alien
25{
26
27Redistributor::Redistributor(
28int globalSize, Arccore::MessagePassing::IMessagePassingMng* super, Arccore::MessagePassing::IMessagePassingMng* target, Method method)
29: m_super_pm(super)
30, m_distributor(std::make_unique<RedistributorCommPlan>(globalSize, m_super_pm, target))
31, m_method(method)
32{
33}
34
35std::shared_ptr<MultiMatrixImpl>
37{
38 auto& red_mat = mat->get<BackEnd::tag::redistributor>(true);
39 if (m_method == Method::csr) {
40 red_mat.useCSRRedistributor();
41 }
42 return red_mat.updateTargetPM(m_distributor.get());
43}
44
45std::shared_ptr<MultiVectorImpl>
47{
48 auto& red_vect = vect->get<BackEnd::tag::redistributor>(false);
49 return red_vect.updateTargetPM(m_distributor.get());
50}
51
53{
54 /*
55 auto& dst_vect = vect->get<BackEnd::tag::redistributor>(true);
56 dst_vect.updateSuperPM(vect, m_distributor.get());
57 */
58}
59
61Redistributor::commPlan() const
62{
63 return m_distributor.get();
64}
65
66} // namespace Alien
MultiMatrixImpl.h.
MultiVectorImpl.h.
Multi matrices representation container.
const AlgebraTraits< tag >::matrix_type & get() const
Get a specific matrix implementation.
const AlgebraTraits< tag >::vector_type & get() const
Get a specific vector implementation.
void redistributeBack(MultiVectorImpl *vect)
Convert back a Vector : from the target to its original communicator. Vector original communicator mu...
std::shared_ptr< MultiMatrixImpl > redistribute(MultiMatrixImpl *mat)
Convert a Matrix from its communicator to the target communicator. Matrix initial communicator must b...
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Definition BackEnd.h:17