DFT-EFE
 
Loading...
Searching...
No Matches
MPICommunicatorP2P.h
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (c) 2021. *
3 * The Regents of the University of Michigan and DFT-EFE developers. *
4 * *
5 * This file is part of the DFT-EFE code. *
6 * *
7 * DFT-EFE is free software: you can redistribute it and/or modify *
8 * it under the terms of the Lesser GNU General Public License as *
9 * published by the Free Software Foundation, either version 3 of *
10 * the License, or (at your option) any later version. *
11 * *
12 * DFT-EFE is distributed in the hope that it will be useful, but *
13 * WITHOUT ANY WARRANTY; without even the implied warranty *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
15 * See the Lesser GNU General Public License for more details. *
16 * *
17 * You should have received a copy of the GNU Lesser General Public *
18 * License at the top level of DFT-EFE distribution. If not, see *
19 * <https://www.gnu.org/licenses/>. *
20 ******************************************************************************/
21
22/*
23 * @author Sambit Das
24 */
25
26#ifndef dftefeMPICommunicatorP2P_h
27#define dftefeMPICommunicatorP2P_h
28
30#include <utils/MPITypes.h>
31#include <utils/MPIPatternP2P.h>
32#include <utils/TypeConfig.h>
33#include <utils/MemoryStorage.h>
34
35
36namespace dftefe
37{
38 namespace utils
39 {
40 namespace mpi
41 {
43 {
44 mpiHost,
46 };
47
49 {
50 standard // same as valueType
51 };
52
53 template <typename ValueType, MemorySpace memorySpace>
55 {
56 public:
58 std::shared_ptr<const MPIPatternP2P<memorySpace>> mpiPatternP2P,
59 const size_type blockSize);
60
61 void
63 const size_type communicationChannel = 0);
64
65 void
68 const size_type communicationChannel = 0);
69
70
71 void
73 const size_type communicationChannel = 0);
74
75 void
77
78 void
81 const size_type communicationChannel = 0);
82
83 void
86
87 std::shared_ptr<const MPIPatternP2P<memorySpace>>
88 getMPIPatternP2P() const;
89
90 int
91 getBlockSize() const;
92
93 void
95
96 private:
97 std::shared_ptr<const MPIPatternP2P<memorySpace>> d_mpiPatternP2P;
98
100
102
104
105
106#ifdef DFTEFE_WITH_DEVICE
108 d_ghostDataCopyHostPinned;
109
111 d_sendRecvBufferHostPinned;
112#endif // DFTEFE_WITH_DEVICE
113
114 std::vector<MPIRequest> d_requestsUpdateGhostValues;
115 std::vector<MPIRequest> d_requestsAccumulateAddLocallyOwned;
117
120 };
121
122 } // namespace mpi
123 } // namespace utils
124} // namespace dftefe
126#endif // dftefeMPICommunicatorP2P_h
Definition: MemoryStorage.h:38
Definition: MPICommunicatorP2P.h:55
std::shared_ptr< const MPIPatternP2P< memorySpace > > getMPIPatternP2P() const
Definition: MPICommunicatorP2P.t.cpp:617
MemoryStorage< ValueType, memorySpace > d_ghostDataBuffer
Definition: MPICommunicatorP2P.h:103
communicationProtocol d_commProtocol
Definition: MPICommunicatorP2P.h:118
std::shared_ptr< const MPIPatternP2P< memorySpace > > d_mpiPatternP2P
Definition: MPICommunicatorP2P.h:97
size_type d_blockSize
Definition: MPICommunicatorP2P.h:99
MPIComm d_mpiCommunicator
Definition: MPICommunicatorP2P.h:116
void setCommunicationPrecision(communicationPrecision precision)
Definition: MPICommunicatorP2P.t.cpp:82
void updateGhostValuesBegin(MemoryStorage< ValueType, memorySpace > &dataArray, const size_type communicationChannel=0)
Definition: MPICommunicatorP2P.t.cpp:145
communicationPrecision d_commPrecision
Definition: MPICommunicatorP2P.h:119
void updateGhostValuesEnd(MemoryStorage< ValueType, memorySpace > &dataArray)
Definition: MPICommunicatorP2P.t.cpp:310
MemoryStorage< ValueType, memorySpace > d_targetDataBuffer
Definition: MPICommunicatorP2P.h:101
int getBlockSize() const
Definition: MPICommunicatorP2P.t.cpp:624
void accumulateAddLocallyOwnedEnd(MemoryStorage< ValueType, memorySpace > &dataArray)
Definition: MPICommunicatorP2P.t.cpp:554
void accumulateAddLocallyOwned(MemoryStorage< ValueType, memorySpace > &dataArray, const size_type communicationChannel=0)
Definition: MPICommunicatorP2P.t.cpp:376
std::vector< MPIRequest > d_requestsUpdateGhostValues
Definition: MPICommunicatorP2P.h:114
std::vector< MPIRequest > d_requestsAccumulateAddLocallyOwned
Definition: MPICommunicatorP2P.h:115
void accumulateAddLocallyOwnedBegin(MemoryStorage< ValueType, memorySpace > &dataArray, const size_type communicationChannel=0)
Definition: MPICommunicatorP2P.t.cpp:387
void updateGhostValues(MemoryStorage< ValueType, memorySpace > &dataArray, const size_type communicationChannel=0)
Definition: MPICommunicatorP2P.t.cpp:133
A class template to store the communication pattern (i.e., which entries/nodes to receive from which ...
Definition: MPIPatternP2P.h:197
communicationPrecision
Definition: MPICommunicatorP2P.h:49
int MPIComm
Definition: MPITypes.h:84
communicationProtocol
Definition: MPICommunicatorP2P.h:43
dealii includes
Definition: AtomFieldDataSpherical.cpp:31
std::uint64_t size_type
Definition: TypeConfig.h:9