DFT-EFE
 
Loading...
Searching...
No Matches
MPICommunicatorP2PKernels.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 dftefeMPICommunicatorP2PKernels_h
27#define dftefeMPICommunicatorP2PKernels_h
28
30#include <utils/MemoryStorage.h>
31#include <utils/TypeConfig.h>
32
33namespace dftefe
34{
35 namespace utils
36 {
37 template <typename ValueType, dftefe::utils::MemorySpace memorySpace>
39 {
40 public:
42
52 static void
55 const SizeTypeVector & ownedLocalIndicesForTargetProcs,
56 const size_type blockSize,
58
68 static void
70 const ValueType * dataArray,
71 const SizeTypeVector & ghostLocalIndicesForGhostProcs,
72 const size_type blockSize,
74
84 static void
87 const SizeTypeVector & ownedLocalIndicesForTargetProcs,
88 const size_type blockSize,
90
100 static void
103 const SizeTypeVector & ghostLocalIndices,
104 const size_type blockSize,
105 ValueType * dataArray);
106 };
107
108#ifdef DFTEFE_WITH_DEVICE
109 template <typename ValueType>
110 class MPICommunicatorP2PKernels<ValueType,
112 {
113 public:
114 static void
117 &dataArray,
119 & ownedLocalIndicesForTargetProcs,
120 const size_type blockSize,
122 &sendBuffer);
123
124 static void
126 const ValueType *dataArray,
128 & ghostLocalIndicesForGhostProcs,
129 const size_type blockSize,
131 &sendBuffer);
132
133 static void
136 &recvBuffer,
138 & ownedLocalIndicesForTargetProcs,
139 const size_type blockSize,
141 &dataArray);
142
143 static void
146 &recvBuffer,
148 & ghostLocalIndices,
149 const size_type blockSize,
150 ValueType * dataArray);
151 };
152#endif
153 } // namespace utils
154} // namespace dftefe
155
156
157#endif
Definition: MPICommunicatorP2PKernels.h:39
static void accumAddLocallyOwnedContrRecvBufferFromTargetProcs(const MemoryStorage< ValueType, memorySpace > &recvBuffer, const SizeTypeVector &ownedLocalIndicesForTargetProcs, const size_type blockSize, MemoryStorage< ValueType, memorySpace > &dataArray)
Function template for architecture adaptable accumlate kernel from recv buffer.
Definition: MPICommunicatorP2PKernels.cpp:71
static void gatherLocallyGhostEntriesSendBufferToGhostProcs(const ValueType *dataArray, const SizeTypeVector &ghostLocalIndicesForGhostProcs, const size_type blockSize, MemoryStorage< ValueType, memorySpace > &sendBuffer)
Function template for architecture adaptable gather kernel to send buffer.
Definition: MPICommunicatorP2PKernels.cpp:56
static void insertLocalGhostValuesRecvBufferFromGhostProcs(const MemoryStorage< ValueType, memorySpace > &recvBuffer, const SizeTypeVector &ghostLocalIndices, const size_type blockSize, ValueType *dataArray)
Function template for architecture adaptable insert kernel from recv buffer.
Definition: MPICommunicatorP2PKernels.cpp:88
static void gatherLocallyOwnedEntriesSendBufferToTargetProcs(const MemoryStorage< ValueType, memorySpace > &dataArray, const SizeTypeVector &ownedLocalIndicesForTargetProcs, const size_type blockSize, MemoryStorage< ValueType, memorySpace > &sendBuffer)
Function template for architecture adaptable gather kernel to send buffer.
Definition: MPICommunicatorP2PKernels.cpp:39
dealii includes
Definition: AtomFieldDataSpherical.cpp:31
unsigned int size_type
Definition: TypeConfig.h:8