36 #ifndef NEKTAR_LIB_UTILITIES_COMMUNICATION_GSLIB_HPP
37 #define NEKTAR_LIB_UTILITIES_COMMUNICATION_GSLIB_HPP
56 typedef struct {
void *
ptr;
size_t n,max; } array;
81 const unsigned int *map[2];
101 const unsigned int *map_to_buf[2], *map_from_buf[2];
107 unsigned transpose,
const void *execdata,
const struct comm *
comm,
char *buf);
119 const unsigned int *map_local[2];
130 gs_data *gsh, buffer *buf);
131 gs_data *
nektar_gs_setup(
const long *
id,
unsigned int n,
const struct comm *comm,
132 int unique,
gs_method method,
int verbose);
134 void nektar_gs_unique(
const long *
id,
unsigned int n,
const struct comm *comm);
154 #ifdef NEKTAR_USE_MPI
155 if (pComm->GetSize() == 1)
160 ASSERTL1(vCommMpi,
"Failed to cast MPI Comm object.");
162 MPI_Comm_dup(vCommMpi->GetComm(), &vComm.
c);
163 vComm.
id = vCommMpi->GetRank();
164 vComm.
np = vCommMpi->GetSize();
167 MPI_Comm_free(&vComm.
c);
187 #ifdef NEKTAR_USE_MPI
188 if (pComm->GetSize() == 1)
193 ASSERTL1(vCommMpi,
"Failed to cast MPI Comm object.");
195 vComm.
c = vCommMpi->GetComm();
196 vComm.
id = vCommMpi->GetRank();
197 vComm.
np = vCommMpi->GetSize();
208 #ifdef NEKTAR_USE_MPI
210 MPI_Finalized(&finalized);
211 if (pGsh && !finalized)
228 #ifdef NEKTAR_USE_MPI
233 if (pBuffer.num_elements() == 0)
240 buf.ptr = &pBuffer[0];
241 buf.n = pBuffer.num_elements();
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 Array< OneD, NekDouble > NullNekDouble1DArray
static void Finalise(gs_data *pGsh)
Deallocates the GSLib mapping data.
static gs_data * Init(const Nektar::Array< OneD, long > pId, const LibUtilities::CommSharedPtr &pComm)
Initialise Gather-Scatter map.
void nektar_gs_unique(const long *id, unsigned int n, const struct comm *comm)
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)
boost::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
gs_data * nektar_gs_setup(const long *id, unsigned int n, const struct comm *comm, int unique, gs_method method, int verbose)
boost::shared_ptr< CommMpi > CommMpiSharedPtr
Pointer to a Communicator object.
unsigned int stage_buffer_size
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)
const unsigned int * scatter_map
const unsigned int * flagged_primaries
void nektar_gs(void *u, gs_dom dom, gs_op op, unsigned transpose, gs_data *gsh, buffer *buf)
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...