35 #ifndef NEKTAR_LIB_UTILITIES_COMMUNICATION_GSLIB_HPP
36 #define NEKTAR_LIB_UTILITIES_COMMUNICATION_GSLIB_HPP
40 #include <boost/core/ignore_unused.hpp>
88 const unsigned int *map[2];
96 unsigned int size_r, size_r1, size_r2;
97 unsigned int size_sk,
size_s, size_total;
111 const unsigned int *map_to_buf[2], *map_from_buf[2];
116 gs_op op,
unsigned transpose,
const void *execdata,
117 const struct comm *
comm,
char *buf);
131 const unsigned int *map_local[2];
171 #ifdef NEKTAR_USE_MPI
172 if (pComm->IsSerial())
177 std::dynamic_pointer_cast<LibUtilities::CommMpi>(pComm);
178 ASSERTL1(vCommMpi,
"Failed to cast MPI Comm object.");
180 MPI_Comm_dup(vCommMpi->GetComm(), &vComm.
c);
181 vComm.
id = vCommMpi->GetRank();
182 vComm.
np = vCommMpi->GetSize();
185 MPI_Comm_free(&vComm.
c);
188 boost::ignore_unused(pId, pComm, verbose);
205 #ifdef NEKTAR_USE_MPI
206 if (pComm->IsSerial())
211 std::dynamic_pointer_cast<LibUtilities::CommMpi>(pComm);
212 ASSERTL1(vCommMpi,
"Failed to cast MPI Comm object.");
214 vComm.
c = vCommMpi->GetComm();
215 vComm.
id = vCommMpi->GetRank();
216 vComm.
np = vCommMpi->GetSize();
219 boost::ignore_unused(pId, pComm);
228 #ifdef NEKTAR_USE_MPI
230 MPI_Finalized(&finalized);
231 if (pGsh && !finalized)
236 boost::ignore_unused(pGsh);
249 #ifdef NEKTAR_USE_MPI
254 if (pBuffer.size() == 0)
261 buf.ptr = &pBuffer[0];
262 buf.n = pBuffer.size();
266 boost::ignore_unused(pU, pOp, pGsh, pBuffer);
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
static void Gather(Nektar::Array< OneD, NekDouble > pU, gs_op pOp, gs_data *pGsh, Nektar::Array< OneD, NekDouble > pBuffer=NullNekDouble1DArray)
Performs a gather-scatter operation of the provided values.
static void Finalise(gs_data *pGsh)
Deallocates the GSLib mapping data.
void nektar_gs_unique(const long *id, unsigned int n, const struct comm *comm)
void nektar_gs(void *u, gs_dom dom, gs_op op, unsigned transpose, gs_data *gsh, buffer *buf)
static gs_data * Init(const Nektar::Array< OneD, long > pId, const LibUtilities::CommSharedPtr &pComm, bool verbose=true)
Initialise Gather-Scatter map.
void exec_fun(void *data, gs_mode mode, unsigned vn, gs_dom dom, gs_op op, unsigned transpose, const void *execdata, const struct comm *comm, char *buf)
gs_data * nektar_gs_setup(const long *id, unsigned int n, const struct comm *comm, int unique, gs_method method, int verbose)
static void Unique(const Nektar::Array< OneD, long > pId, const LibUtilities::CommSharedPtr &pComm)
Updates pId to negate all-but-one references to each universal ID.
void nektar_gs_free(gs_data *gsh)
std::shared_ptr< CommMpi > CommMpiSharedPtr
Pointer to a Communicator object.
std::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
The above copyright notice and this permission notice shall be included.
static Array< OneD, NekDouble > NullNekDouble1DArray
const unsigned int * gather_map
const unsigned int * flagged_primaries