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 {
42 template <typename ValueType, MemorySpace memorySpace>
44 {
45 public:
47 std::shared_ptr<const MPIPatternP2P<memorySpace>> mpiPatternP2P,
48 const size_type blockSize);
49
50 void
52 const size_type communicationChannel = 0);
53
54 void
57 const size_type communicationChannel = 0);
58
59
60 void
62 const size_type communicationChannel = 0);
63
64 void
66
67 void
70 const size_type communicationChannel = 0);
71
72 void
75
76 std::shared_ptr<const MPIPatternP2P<memorySpace>>
77 getMPIPatternP2P() const;
78
79 int
80 getBlockSize() const;
81
82 private:
83 std::shared_ptr<const MPIPatternP2P<memorySpace>> d_mpiPatternP2P;
84
86
88
90
91
92#ifdef DFTEFE_WITH_DEVICE
94 d_ghostDataCopyHostPinned;
95
97 d_sendRecvBufferHostPinned;
98#endif // DFTEFE_WITH_DEVICE
99
100 std::vector<MPIRequest> d_requestsUpdateGhostValues;
101 std::vector<MPIRequest> d_requestsAccumulateAddLocallyOwned;
103 };
104
105 } // namespace mpi
106 } // namespace utils
107} // namespace dftefe
109#endif // dftefeMPICommunicatorP2P_h
Definition: MemoryStorage.h:38
Definition: MPICommunicatorP2P.h:44
std::shared_ptr< const MPIPatternP2P< memorySpace > > getMPIPatternP2P() const
Definition: MPICommunicatorP2P.t.cpp:473
MemoryStorage< ValueType, memorySpace > d_ghostDataBuffer
Definition: MPICommunicatorP2P.h:89
std::shared_ptr< const MPIPatternP2P< memorySpace > > d_mpiPatternP2P
Definition: MPICommunicatorP2P.h:83
size_type d_blockSize
Definition: MPICommunicatorP2P.h:85
MPIComm d_mpiCommunicator
Definition: MPICommunicatorP2P.h:102
void updateGhostValuesBegin(MemoryStorage< ValueType, memorySpace > &dataArray, const size_type communicationChannel=0)
Definition: MPICommunicatorP2P.t.cpp:89
void updateGhostValuesEnd(MemoryStorage< ValueType, memorySpace > &dataArray)
Definition: MPICommunicatorP2P.t.cpp:226
MemoryStorage< ValueType, memorySpace > d_targetDataBuffer
Definition: MPICommunicatorP2P.h:87
int getBlockSize() const
Definition: MPICommunicatorP2P.t.cpp:480
void accumulateAddLocallyOwnedEnd(MemoryStorage< ValueType, memorySpace > &dataArray)
Definition: MPICommunicatorP2P.t.cpp:425
void accumulateAddLocallyOwned(MemoryStorage< ValueType, memorySpace > &dataArray, const size_type communicationChannel=0)
Definition: MPICommunicatorP2P.t.cpp:278
std::vector< MPIRequest > d_requestsUpdateGhostValues
Definition: MPICommunicatorP2P.h:100
std::vector< MPIRequest > d_requestsAccumulateAddLocallyOwned
Definition: MPICommunicatorP2P.h:101
void accumulateAddLocallyOwnedBegin(MemoryStorage< ValueType, memorySpace > &dataArray, const size_type communicationChannel=0)
Definition: MPICommunicatorP2P.t.cpp:289
void updateGhostValues(MemoryStorage< ValueType, memorySpace > &dataArray, const size_type communicationChannel=0)
Definition: MPICommunicatorP2P.t.cpp:77
A class template to store the communication pattern (i.e., which entries/nodes to receive from which ...
Definition: MPIPatternP2P.h:197
int MPIComm
Definition: MPITypes.h:83
dealii includes
Definition: AtomFieldDataSpherical.cpp:31
unsigned int size_type
Definition: TypeConfig.h:8