24#ifndef ALIEN_CORE_BLOCK_COMPUTEBLOCKOFFSETS_H
25#define ALIEN_CORE_BLOCK_COMPUTEBLOCKOFFSETS_H
30#include <alien/utils/Precomp.h>
34#include <arccore/message_passing/IMessagePassingMng.h>
57template <
typename T = std::vector<std::
size_t>>
60 IMessagePassingMng* parallel_mng = dist.
parallelMng();
61 const Integer block_size = block.
size();
62 if (parallel_mng && parallel_mng->commSize() > 1) {
63 const Integer nproc = parallel_mng->commSize();
64 offsets.resize(nproc + 1);
65 for (Integer i = 0; i < nproc; ++i)
66 offsets[i] = dist.
offset(i) * block_size;
67 offsets[nproc] = dist.
globalSize() * block_size;
86template <
typename T = std::vector<std::
size_t>>
89 IMessagePassingMng* parallel_mng = dist.
parallelMng();
90 const Integer block_size = block.
size();
91 if (parallel_mng && parallel_mng->commSize() > 1) {
92 const Integer nproc = parallel_mng->commSize();
93 offsets.resize(nproc + 1);
94 for (Integer i = 0; i < nproc; ++i)
95 offsets[i] = dist.
rowOffset(i) * block_size;
Block elements for block matrices.
Arccore::Integer size() const
Get square block size.
Computes a matrix distribution.
Arccore::Integer globalRowSize() const
Get the global row size.
Arccore::Integer rowOffset() const
Get the row offset.
Arccore::MessagePassing::IMessagePassingMng * parallelMng() const
Get the parallel manager.
Computes a vector distribution.
Arccore::Integer offset() const
Get the offset.
Arccore::Integer globalSize() const
Get the global size.
Arccore::MessagePassing::IMessagePassingMng * parallelMng() const
Get the parallel manager.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
void computeBlockOffsets(const VectorDistribution &dist, const Block &block, T &offsets)
Compute block offsets for an uniform block vector.