27#ifndef MPISYNC_H_INCLUDED
28#define MPISYNC_H_INCLUDED
31#error MPI not available
91 const std::string mask,
92 const std::vector<std::string>
fields,
93 const std::vector<unsigned int> procs,
109 cl_event
_execute(
const std::vector<cl_event> events);
139 void setupReceivers();
142 std::string _mask_name;
147 std::vector<std::string> _field_names;
149 std::vector<InputOutput::ArrayVariable*> _fields;
151 std::vector<InputOutput::ArrayVariable*> _fields_sorted;
154 std::vector<unsigned int> _procs;
170 std::vector<UnSort*> _field_sorters;
197 const std::vector<InputOutput::ArrayVariable*>
fields,
198 const std::vector<void*> field_hosts,
199 const unsigned int proc);
208 const std::string
name() {
return _name; }
237 std::vector<InputOutput::ArrayVariable*>
_fields;
277 const std::vector<InputOutput::ArrayVariable*>
fields,
278 const std::vector<void*> field_hosts,
279 const unsigned int proc);
292 void setupSubMaskMems();
298 void setupOpenCL(
const std::string kernel_name);
303 void setupReduction(
const std::string var_name);
312 cl_kernel _n_offset_kernel;
324 cl_kernel _n_send_kernel;
330 size_t _global_work_size;
332 size_t _local_work_size;
357 const std::vector<InputOutput::ArrayVariable*>
fields,
358 const std::vector<void*> field_hosts,
359 const unsigned int proc,
382 size_t _local_work_size;
387 std::vector<void*> _fields_send;
390 std::vector<Sender*> _senders;
402 std::vector<void*> _fields_recv;
405 std::vector<Receiver*> _receivers;
The calculation main entry point. (See Aqua::CalcServer::CalcServer for details)
Methods to perform a radix sort using the GPU (or any device supported by OpenCL)....
Reductions, like scans, prefix sums, maximum or minimum, etc... (See Aqua::CalcServer::Reduction for ...
Set a scalar variable. (See Aqua::CalcServer::SetScalar for details)
Set all the components of an array with the desired value. (See Aqua::CalcServer::Set for details)
UnSort Recover the original id of each particle. (See Aqua::CalcServer::UnSort for details)
Interprocess array synchronization base class.
Definition: MPISync.h:183
static const MPIType typeToMPI(std::string t)
MPI type descriptor.
const std::string name()
Parent tool name.
Definition: MPISync.h:208
std::vector< InputOutput::ArrayVariable * > _fields
Field.
Definition: MPISync.h:237
unsigned int _proc
Processor.
Definition: MPISync.h:240
InputOutput::ArrayVariable * _mask
Mask.
Definition: MPISync.h:234
Exchanger(const std::string name, InputOutput::ArrayVariable *mask, const std::vector< InputOutput::ArrayVariable * > fields, const std::vector< void * > field_hosts, const unsigned int proc)
std::vector< void * > _fields_host
Host memory arrays to download, send, receive and upload the data.
Definition: MPISync.h:246
unsigned int _n
Total number of elements.
Definition: MPISync.h:243
Synchronize arrays between processes.
Definition: MPISync.h:341
Receiver(const std::string name, InputOutput::ArrayVariable *mask, const std::vector< InputOutput::ArrayVariable * > fields, const std::vector< void * > field_hosts, const unsigned int proc, InputOutput::UIntVariable *n_offset)
void execute(void)
Receive the information.
Synchronize arrays between processes.
Definition: MPISync.h:259
void execute(void)
Send the information.
Sender(const std::string name, InputOutput::ArrayVariable *mask, const std::vector< InputOutput::ArrayVariable * > fields, const std::vector< void * > field_hosts, const unsigned int proc)
Synchronize arrays between processes.
Definition: MPISync.h:74
MPISync(const std::string name, const std::string mask, const std::vector< std::string > fields, const std::vector< unsigned int > procs, bool once=false)
cl_event _execute(const std::vector< cl_event > events)
Methods to perform a radix sort using the GPU (or any device supported by OpenCL)....
Definition: RadixSort.h:97
Reductions, like scans, prefix sums, maximum or minimum, etc...
Definition: Reduction.h:43
Set a scalar variable.
Definition: SetScalar.h:37
Set all the components of an array with the desired value.
Definition: Set.h:39
__kernel void fields(__global const unsigned int *iset, __global const uint *isplit, __global const uint *mybuffer, __global const unsigned int *ilevel, __global const float *split_weight, __global float *m0, __global float *m, __global vec *r, __global vec *u, __global vec *dudt, __global float *rho, __global float *drhodt, __global const uint *icell, __global const uint *ihoc, __constant float *dr_level0, unsigned int N, uivec4 n_cells)
Collect the children, and the seed itself, in order to compute the field values of the buffer partner...
Definition: Coalesce.cl:435
OpenCL kernel kernel based tool. (see Aqua::CalcServer::Kernel for details)
Main AQUAgpusph namespace.
Definition: ArgumentsManager.cpp:45
Data structure to store the type information required by MPI.
Definition: MPISync.h:218
MPI_Datatype t
Underlying type, in MPI format.
Definition: MPISync.h:222
unsigned int n
Number of components.
Definition: MPISync.h:220