1#include "Grid/grid_dist_id.hpp"
2#include "data_type/aggregate.hpp"
3#include "Decomposition/CartDecomposition.hpp"
4#include "VCluster/VCluster.hpp"
23int main(
int argc,
char* argv[])
41 openfpm_init(&argc,&argv);
82 for (
size_t i = 0, m = 0 ; i < N_NEXT ; i++, m++)
85 prc_send.add(openfpm::math::positive_modulo(proc_id + i + 1,n_proc));
88 for (
size_t j = 0 ; j < N_NUMBERS ; j++)
89 messages_send.get(m).add(j+N_NUMBERS*proc_id);
102 v_cl.
SSendRecv(messages_send,messages_recv2,prc_send,prc_recv2,sz_recv2);
106 std::cout <<
"Processor " << proc_id <<
" received ";
107 for (
size_t i = 0 ; i < messages_recv2.
size() ; i++)
108 std::cout << messages_recv2.get(i) <<
" ";
110 std::cout << std::endl;
size_t getProcessUnitID()
Get the process unit id.
size_t getProcessingUnits()
Get the total number of processors.
Implementation of VCluster class.
bool SSendRecv(openfpm::vector< T > &send, S &recv, openfpm::vector< size_t > &prc_send, openfpm::vector< size_t > &prc_recv, openfpm::vector< size_t > &sz_recv, size_t opt=NONE)
Semantic Send and receive, send the data to processors and receive from the other processors.
Implementation of 1-D std::vector like structure.