Nektar++
Loading...
Searching...
No Matches
CommSerial.h
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: CommSerial.h
4//
5// For more information, please see: http://www.nektar.info
6//
7// The MIT License
8//
9// Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
10// Department of Aeronautics, Imperial College London (UK), and Scientific
11// Computing and Imaging Institute, University of Utah (USA).
12//
13// Permission is hereby granted, free of charge, to any person obtaining a
14// copy of this software and associated documentation files (the "Software"),
15// to deal in the Software without restriction, including without limitation
16// the rights to use, copy, modify, merge, publish, distribute, sublicense,
17// and/or sell copies of the Software, and to permit persons to whom the
18// Software is furnished to do so, subject to the following conditions:
19//
20// The above copyright notice and this permission notice shall be included
21// in all copies or substantial portions of the Software.
22//
23// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29// DEALINGS IN THE SOFTWARE.
30//
31// Description: CommSerial header
32//
33///////////////////////////////////////////////////////////////////////////////
34#ifndef NEKTAR_LIB_UTILITIES_COMMSERIAL_H
35#define NEKTAR_LIB_UTILITIES_COMMSERIAL_H
36
37#include <string>
38
42
44{
45// Forward declarations
46class CommSerial;
47
48/// Pointer to a Communicator object.
49typedef std::shared_ptr<CommSerial> CommSerialSharedPtr;
50
51/// A global linear system.
52class CommSerial : public Comm
53{
54public:
55 /// Creates an instance of this class
56 LIB_UTILITIES_EXPORT static CommSharedPtr create(int narg, char *arg[])
57 {
59 }
60
61 /// Name of class
62 LIB_UTILITIES_EXPORT static std::string className;
63
64 LIB_UTILITIES_EXPORT CommSerial(int argc, char *argv[]);
66
67protected:
69 LIB_UTILITIES_EXPORT int v_GetRank() override;
71 LIB_UTILITIES_EXPORT bool v_IsSerial() override;
72 LIB_UTILITIES_EXPORT std::tuple<int, int, int> v_GetVersion() final;
73 LIB_UTILITIES_EXPORT void v_Block() final;
75
76 LIB_UTILITIES_EXPORT void v_Send(const void *buf, int count,
77 CommDataType dt, int dest) final;
78 LIB_UTILITIES_EXPORT void v_Recv(void *buf, int count, CommDataType dt,
79 int source) final;
80 LIB_UTILITIES_EXPORT void v_SendRecv(const void *sendbuf, int sendcount,
81 CommDataType sendtype, int dest,
82 void *recvbuf, int recvcount,
83 CommDataType recvtype,
84 int source) final;
85
86 LIB_UTILITIES_EXPORT void v_AllReduce(void *buf, int count, CommDataType dt,
87 enum ReduceOperator pOp) final;
88
89 LIB_UTILITIES_EXPORT void v_AlltoAll(const void *sendbuf, int sendcount,
90 CommDataType sendtype, void *recvbuf,
91 int recvcount,
92 CommDataType recvtype) final;
94 const void *sendbuf, const int *sendcounts, const int *senddispls,
95 CommDataType sendtype, void *recvbuf, const int *recvcounts,
96 const int *recvdispls, CommDataType recvtype) final;
97
98 LIB_UTILITIES_EXPORT void v_AllGather(const void *sendbuf, int sendcount,
99 CommDataType sendtype, void *recvbuf,
100 int recvcount,
101 CommDataType recvtype) final;
102 LIB_UTILITIES_EXPORT void v_AllGatherv(const void *sendbuf, int sendcount,
103 CommDataType sendtype, void *recvbuf,
104 const int *recvcounts,
105 const int *recvdispls,
106 CommDataType recvtype) final;
107 LIB_UTILITIES_EXPORT void v_AllGatherv(void *recvbuf, const int *recvcounts,
108 const int *recvdispls,
109 CommDataType recvtype) final;
110
111 LIB_UTILITIES_EXPORT void v_Bcast(void *buffer, int count, CommDataType dt,
112 int root) final;
113 LIB_UTILITIES_EXPORT void v_Gather(const void *sendbuf, int sendcount,
114 CommDataType sendtype, void *recvbuf,
115 int recvcount, CommDataType recvtype,
116 int root) final;
117 LIB_UTILITIES_EXPORT void v_Scatter(const void *sendbuf, int sendcount,
118 CommDataType sendtype, void *recvbuf,
119 int recvcount, CommDataType recvtype,
120 int root) final;
121
123 int indegree, const int *sources, const int *sourceweights,
124 int reorder) final;
126 const void *sendbuf, const int *sendcounts, const int *senddispls,
127 CommDataType sendtype, void *recvbuf, const int *recvcounts,
128 const int *recvdispls, CommDataType recvtype) final;
129
130 LIB_UTILITIES_EXPORT void v_Irsend(const void *buf, int count,
131 CommDataType dt, int dest,
132 CommRequestSharedPtr request,
133 int loc) final;
134 LIB_UTILITIES_EXPORT void v_Isend(const void *buf, int count,
135 CommDataType dt, int dest,
136 CommRequestSharedPtr request,
137 int loc) final;
138 LIB_UTILITIES_EXPORT void v_SendInit(const void *buf, int count,
139 CommDataType dt, int dest,
140 CommRequestSharedPtr request,
141 int loc) final;
142 LIB_UTILITIES_EXPORT void v_Irecv(void *buf, int count, CommDataType dt,
143 int source, CommRequestSharedPtr request,
144 int loc) final;
145 LIB_UTILITIES_EXPORT void v_RecvInit(void *buf, int count, CommDataType dt,
146 int source,
147 CommRequestSharedPtr request,
148 int loc) final;
149
152
154 LIB_UTILITIES_EXPORT void v_SplitComm(int pRows, int pColumns,
155 int pTime) override;
157};
158} // namespace Nektar::LibUtilities
159
160#endif
#define LIB_UTILITIES_EXPORT
Base communications class.
Definition Comm.h:88
A global linear system.
Definition CommSerial.h:53
std::tuple< int, int, int > v_GetVersion() final
void v_AllGather(const void *sendbuf, int sendcount, CommDataType sendtype, void *recvbuf, int recvcount, CommDataType recvtype) final
void v_AlltoAllv(const void *sendbuf, const int *sendcounts, const int *senddispls, CommDataType sendtype, void *recvbuf, const int *recvcounts, const int *recvdispls, CommDataType recvtype) final
void v_SendInit(const void *buf, int count, CommDataType dt, int dest, CommRequestSharedPtr request, int loc) final
CommSharedPtr v_CommCreateIf(int flag) final
void v_Scatter(const void *sendbuf, int sendcount, CommDataType sendtype, void *recvbuf, int recvcount, CommDataType recvtype, int root) final
void v_Bcast(void *buffer, int count, CommDataType dt, int root) final
CommRequestSharedPtr v_CreateRequest(int num) final
void v_Irecv(void *buf, int count, CommDataType dt, int source, CommRequestSharedPtr request, int loc) final
void v_AllGatherv(const void *sendbuf, int sendcount, CommDataType sendtype, void *recvbuf, const int *recvcounts, const int *recvdispls, CommDataType recvtype) final
void v_DistGraphCreateAdjacent(int indegree, const int *sources, const int *sourceweights, int reorder) final
void v_AllReduce(void *buf, int count, CommDataType dt, enum ReduceOperator pOp) final
void v_AlltoAll(const void *sendbuf, int sendcount, CommDataType sendtype, void *recvbuf, int recvcount, CommDataType recvtype) final
static CommSharedPtr create(int narg, char *arg[])
Creates an instance of this class.
Definition CommSerial.h:56
void v_SplitComm(int pRows, int pColumns, int pTime) override
void v_RecvInit(void *buf, int count, CommDataType dt, int source, CommRequestSharedPtr request, int loc) final
void v_SendRecv(const void *sendbuf, int sendcount, CommDataType sendtype, int dest, void *recvbuf, int recvcount, CommDataType recvtype, int source) final
void v_StartAll(CommRequestSharedPtr request) final
void v_Send(const void *buf, int count, CommDataType dt, int dest) final
static std::string className
Name of class.
Definition CommSerial.h:62
void v_Isend(const void *buf, int count, CommDataType dt, int dest, CommRequestSharedPtr request, int loc) final
void v_Gather(const void *sendbuf, int sendcount, CommDataType sendtype, void *recvbuf, int recvcount, CommDataType recvtype, int root) final
void v_WaitAll(CommRequestSharedPtr request) final
void v_Irsend(const void *buf, int count, CommDataType dt, int dest, CommRequestSharedPtr request, int loc) final
void v_NeighborAlltoAllv(const void *sendbuf, const int *sendcounts, const int *senddispls, CommDataType sendtype, void *recvbuf, const int *recvcounts, const int *recvdispls, CommDataType recvtype) final
void v_Recv(void *buf, int count, CommDataType dt, int source) final
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
unsigned int CommDataType
std::shared_ptr< CommRequest > CommRequestSharedPtr
Definition Comm.h:84
ReduceOperator
Type of operation to perform in AllReduce.
Definition Comm.h:65
std::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
Definition Comm.h:55
std::shared_ptr< CommSerial > CommSerialSharedPtr
Pointer to a Communicator object.
Definition CommSerial.h:49
STL namespace.