Alien  1.3.0
Developer documentation
Loading...
Searching...
No Matches
BlockSizes.h
1// -*- C++ -*-
2#pragma once
3
4#include <alien/utils/Precomp.h>
5#include <alien/utils/VMap.h>
6
7/*---------------------------------------------------------------------------*/
8/*---------------------------------------------------------------------------*/
9
10namespace Alien
11{
12
13/*---------------------------------------------------------------------------*/
14/*---------------------------------------------------------------------------*/
15
16class IIndexManager;
17
18/*---------------------------------------------------------------------------*/
19/*---------------------------------------------------------------------------*/
20
21class ALIEN_EXPORT BlockSizes
22{
23 public:
24 typedef VMap<Alien::Integer, Alien::Integer> ValuePerBlock;
25
26 BlockSizes();
27
28 ~BlockSizes() {}
29
30 void prepare(const IIndexManager& index_mng, Alien::ConstArrayView<Alien::Integer> block_sizes);
31
32 const ValuePerBlock& sizes() const { return m_sizes; }
33
34 public:
35 Alien::Integer size(Alien::Integer index) const;
36 Alien::Integer sizeFromLocalIndex(Alien::Integer index) const;
37
38 Alien::Integer offset(Alien::Integer index) const;
39 Alien::Integer offsetFromLocalIndex(Alien::Integer index) const;
40
41 Alien::Integer localSize() const;
42
43 Alien::Integer maxSize() const;
44
45 Alien::ConstArrayView<Alien::Integer> sizeOfLocalIndex() const;
46 Alien::ConstArrayView<Alien::Integer> offsetOfLocalIndex() const;
47
48 private:
49 struct EntrySendRequest;
50 struct EntryRecvRequest;
51
52 private:
53 bool m_is_prepared = false;
54 Alien::IMessagePassingMng* m_parallel_mng = nullptr;
55
56 Alien::Integer m_local_size = 0;
57 Alien::Integer m_max_size = 0;
58
59 ValuePerBlock m_sizes;
60 ValuePerBlock m_offsets;
61
62 SharedArray<Alien::Integer> m_local_sizes;
63 SharedArray<Alien::Integer> m_local_offsets;
64};
65} // namespace Alien
66/*---------------------------------------------------------------------------*/
67/*---------------------------------------------------------------------------*/
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Definition BackEnd.h:17