36 #ifndef NEKTAR_LIB_UTILITIES_COMMUNICATION_GSLIB_HPP
37 #define NEKTAR_LIB_UTILITIES_COMMUNICATION_GSLIB_HPP
47 using namespace Nektar;
55 typedef struct {
void *
ptr;
size_t n,max; }
array;
80 const unsigned int *map[2];
100 const unsigned int *map_to_buf[2], *map_from_buf[2];
106 unsigned transpose,
const void *execdata,
const struct comm *
comm,
char *buf);
118 const unsigned int *map_local[2];
129 gs_data *gsh,
buffer *buf);
130 gs_data *
nektar_gs_setup(
const long *
id,
unsigned int n,
const struct comm *comm,
131 int unique,
gs_method method,
int verbose);
133 void nektar_gs_unique(
const long *
id,
unsigned int n,
const struct comm *comm);
150 static inline gs_data*
Init (
const Nektar::Array<OneD, long> pId,
153 #ifdef NEKTAR_USE_MPI
154 if (pComm->GetSize() == 1)
159 ASSERTL1(vCommMpi,
"Failed to cast MPI Comm object.");
161 MPI_Comm_dup(vCommMpi->GetComm(), &vComm.
c);
162 vComm.
id = vCommMpi->GetRank();
163 vComm.
np = vCommMpi->GetSize();
180 static inline void Unique(
const Nektar::Array<OneD, long> pId,
183 #ifdef NEKTAR_USE_MPI
184 if (pComm->GetSize() == 1)
189 ASSERTL1(vCommMpi,
"Failed to cast MPI Comm object.");
191 vComm.
c = vCommMpi->GetComm();
192 vComm.
id = vCommMpi->GetRank();
193 vComm.
np = vCommMpi->GetSize();
204 #ifdef NEKTAR_USE_MPI
218 static inline void Gather(Nektar::Array<OneD, NekDouble> pU,
gs_op pOp,
219 gs_data *pGsh, Nektar::Array<OneD, NekDouble> pBuffer
222 #ifdef NEKTAR_USE_MPI
227 if (pBuffer.num_elements() == 0)
234 buf.
ptr = &pBuffer[0];
235 buf.
n = pBuffer.num_elements();