Commit ec95a342 authored by incardon's avatar incardon

Fixing VCluster template parameter

parent 03255a6d
......@@ -8,7 +8,7 @@
#include "util/print_stack.hpp"
#include "util/math_util_complex.hpp"
Vcluster * global_v_cluster_private = NULL;
Vcluster<> * global_v_cluster_private = NULL;
//
std::vector<int> sieve_spf;
......
......@@ -35,8 +35,11 @@ void bt_sighandler(int sig, siginfo_t * info, void * ctx);
* \snippet VCluster_unit_test_util.hpp message alloc
*
*/
class Vcluster: public Vcluster_base
template<typename InternalMemory = HeapMemory>
class Vcluster: public Vcluster_base<InternalMemory>
{
typedef Vcluster_base<InternalMemory> self_base;
template<typename T>
struct index_gen {};
......@@ -125,10 +128,10 @@ class Vcluster: public Vcluster_base
pack_unpack_cond_with_prp<has_max_prop<T, has_value_type<T>::value>::value, op, T, S, layout_base>::packing(mem, send.get(i), sts, send_buf,opt);
}
tags.clear();
self_base::tags.clear();
// receive information
base_info bi(&recv_buf,prc_recv,sz_recv_byte,tags,opt);
base_info bi(&this->recv_buf,prc_recv,sz_recv_byte,this->tags,opt);
// Send and recv multiple messages
if (opt & RECEIVE_KNOWN)
......@@ -145,24 +148,24 @@ class Vcluster: public Vcluster_base
else
{std::cout << __FILE__ << ":" << __LINE__ << " Error " << demangle(typeid(T).name()) << " the type does not work with the option or NO_CHANGE_ELEMENTS" << std::endl;}
Vcluster_base::sendrecvMultipleMessagesNBX(prc_send.size(),(size_t *)send_sz_byte.getPointer(),(size_t *)prc_send.getPointer(),(void **)send_buf.getPointer(),
self_base::sendrecvMultipleMessagesNBX(prc_send.size(),(size_t *)send_sz_byte.getPointer(),(size_t *)prc_send.getPointer(),(void **)send_buf.getPointer(),
prc_recv.size(),(size_t *)prc_recv.getPointer(),(size_t *)sz_recv_byte.getPointer(),msg_alloc_known,(void *)&bi);
}
else
{
Vcluster_base::sendrecvMultipleMessagesNBX(prc_send.size(),(size_t *)send_sz_byte.getPointer(),(size_t *)prc_send.getPointer(),(void **)send_buf.getPointer(),
self_base::sendrecvMultipleMessagesNBX(prc_send.size(),(size_t *)send_sz_byte.getPointer(),(size_t *)prc_send.getPointer(),(void **)send_buf.getPointer(),
prc_recv.size(),(size_t *)prc_recv.getPointer(),msg_alloc_known,(void *)&bi);
sz_recv_byte = sz_recv_tmp;
sz_recv_byte = self_base::sz_recv_tmp;
}
}
else
{
prc_recv.clear();
sendrecvMultipleMessagesNBX(prc_send_.size(),(size_t *)send_sz_byte.getPointer(),(size_t *)prc_send_.getPointer(),(void **)send_buf.getPointer(),msg_alloc,(void *)&bi);
self_base::sendrecvMultipleMessagesNBX(prc_send_.size(),(size_t *)send_sz_byte.getPointer(),(size_t *)prc_send_.getPointer(),(void **)send_buf.getPointer(),msg_alloc,(void *)&bi);
}
// Reorder the buffer
reorder_buffer(prc_recv,tags,sz_recv_byte);
reorder_buffer(prc_recv,self_base::tags,sz_recv_byte);
mem.decRef();
delete &mem;
......@@ -175,10 +178,10 @@ class Vcluster: public Vcluster_base
*/
void reset_recv_buf()
{
for (size_t i = 0 ; i < recv_buf.size() ; i++)
recv_buf.get(i).resize(0);
for (size_t i = 0 ; i < self_base::recv_buf.size() ; i++)
{self_base::recv_buf.get(i).resize(0);}
recv_buf.resize(0);
self_base::recv_buf.resize(0);
}
/*! \brief Base info
......@@ -191,7 +194,7 @@ class Vcluster: public Vcluster_base
struct base_info
{
//! Receive buffer
openfpm::vector<BHeapMemory> * recv_buf;
openfpm::vector<BMemory<HeapMemory>> * recv_buf;
//! receiving processor list
openfpm::vector<size_t> & prc;
//! size of each message
......@@ -203,7 +206,7 @@ class Vcluster: public Vcluster_base
size_t opt;
//! constructor
base_info(openfpm::vector<BHeapMemory> * recv_buf, openfpm::vector<size_t> & prc, openfpm::vector<size_t> & sz, openfpm::vector<size_t> & tags,size_t opt)
base_info(openfpm::vector<BMemory<HeapMemory>> * recv_buf, openfpm::vector<size_t> & prc, openfpm::vector<size_t> & sz, openfpm::vector<size_t> & tags,size_t opt)
:recv_buf(recv_buf),prc(prc),sz(sz),tags(tags),opt(opt)
{}
};
......@@ -308,9 +311,9 @@ class Vcluster: public Vcluster_base
size_t opt)
{
if (sz != NULL)
sz->resize(recv_buf.size());
{sz->resize(self_base::recv_buf.size());}
pack_unpack_cond_with_prp<has_max_prop<T, has_value_type<T>::value>::value,op, T, S, layout_base, prp... >::unpacking(recv, recv_buf, sz, sz_byte, op_param,opt);
pack_unpack_cond_with_prp<has_max_prop<T, has_value_type<T>::value>::value,op, T, S, layout_base, prp... >::unpacking(recv, self_base::recv_buf, sz, sz_byte, op_param,opt);
}
public:
......@@ -322,7 +325,7 @@ class Vcluster: public Vcluster_base
*
*/
Vcluster(int *argc, char ***argv)
:Vcluster_base(argc,argv)
:Vcluster_base<InternalMemory>(argc,argv)
{
}
......@@ -413,19 +416,19 @@ class Vcluster: public Vcluster_base
reset_recv_buf();
// If we are on master collect the information
if (getProcessUnitID() == root)
if (self_base::getProcessUnitID() == root)
{
// send buffer (master does not send anything) so send req and send_buf
// remain buffer with size 0
openfpm::vector<size_t> send_req;
tags.clear();
self_base::tags.clear();
// receive information
base_info bi(&recv_buf,prc,sz,tags,0);
base_info bi(&this->recv_buf,prc,sz,this->tags,0);
// Send and recv multiple messages
sendrecvMultipleMessagesNBX(send_req.size(),NULL,NULL,NULL,msg_alloc,&bi);
self_base::sendrecvMultipleMessagesNBX(send_req.size(),NULL,NULL,NULL,msg_alloc,&bi);
// we generate the list of the properties to unpack
typedef typename ::generate_indexes<int, has_max_prop<T, has_value_type<T>::value>::number, MetaFuncOrd>::result ind_prop_to_pack;
......@@ -434,7 +437,7 @@ class Vcluster: public Vcluster_base
op_ssend_recv_add<void> opa;
// Reorder the buffer
reorder_buffer(prc,tags,sz);
reorder_buffer(prc,self_base::tags,sz);
index_gen<ind_prop_to_pack>::template process_recv<op_ssend_recv_add<void>,T,S,layout_base>(*this,recv,&sz,NULL,opa,0);
......@@ -473,13 +476,13 @@ class Vcluster: public Vcluster_base
pack_unpack_cond_with_prp_inte_lin<T>::construct_prc(send_prc,send_prc_);
tags.clear();
self_base::tags.clear();
// receive information
base_info bi(NULL,prc,sz,tags,0);
base_info bi(NULL,prc,sz,self_base::tags,0);
// Send and recv multiple messages
sendrecvMultipleMessagesNBX(send_prc_.size(),(size_t *)sz.getPointer(),(size_t *)send_prc_.getPointer(),(void **)send_buf.getPointer(),msg_alloc,(void *)&bi,NONE);
self_base::sendrecvMultipleMessagesNBX(send_prc_.size(),(size_t *)sz.getPointer(),(size_t *)send_prc_.getPointer(),(void **)send_buf.getPointer(),msg_alloc,(void *)&bi,NONE);
mem.decRef();
delete &mem;
......@@ -520,7 +523,7 @@ class Vcluster: public Vcluster_base
reset_recv_buf();
// If we are on master scatter the information
if (getProcessUnitID() == root)
if (self_base::getProcessUnitID() == root)
{
// Prepare the sending buffer
openfpm::vector<const void *> send_buf;
......@@ -538,13 +541,13 @@ class Vcluster: public Vcluster_base
ptr += sz.get(i);
}
tags.clear();
self_base::tags.clear();
// receive information
base_info bi(&recv_buf,prc,sz,tags,0);
base_info bi(&this->recv_buf,prc,sz,this->tags,0);
// Send and recv multiple messages
sendrecvMultipleMessagesNBX(prc.size(),(size_t *)sz_byte.getPointer(),(size_t *)prc.getPointer(),(void **)send_buf.getPointer(),msg_alloc,(void *)&bi);
self_base::sendrecvMultipleMessagesNBX(prc.size(),(size_t *)sz_byte.getPointer(),(size_t *)prc.getPointer(),(void **)send_buf.getPointer(),msg_alloc,(void *)&bi);
// we generate the list of the properties to pack
typedef typename ::generate_indexes<int, has_max_prop<T, has_value_type<T>::value>::number, MetaFuncOrd>::result ind_prop_to_pack;
......@@ -559,13 +562,13 @@ class Vcluster: public Vcluster_base
// The non-root receive
openfpm::vector<size_t> send_req;
tags.clear();
self_base::tags.clear();
// receive information
base_info bi(&recv_buf,prc,sz,tags,0);
base_info bi(&this->recv_buf,prc,sz,this->tags,0);
// Send and recv multiple messages
sendrecvMultipleMessagesNBX(send_req.size(),NULL,NULL,NULL,msg_alloc,&bi);
self_base::sendrecvMultipleMessagesNBX(send_req.size(),NULL,NULL,NULL,msg_alloc,&bi);
// we generate the list of the properties to pack
typedef typename ::generate_indexes<int, has_max_prop<T, has_value_type<T>::value>::number, MetaFuncOrd>::result ind_prop_to_pack;
......@@ -615,7 +618,7 @@ class Vcluster: public Vcluster_base
openfpm::vector<recv_buff_reorder> rcv;
rcv.resize(recv_buf.size());
rcv.resize(self_base::recv_buf.size());
for (size_t i = 0 ; i < rcv.size() ; i++)
{
......@@ -627,7 +630,7 @@ class Vcluster: public Vcluster_base
// we sort based on processor
rcv.sort();
openfpm::vector<BHeapMemory> recv_ord;
openfpm::vector<BMemory<HeapMemory>> recv_ord;
recv_ord.resize(rcv.size());
openfpm::vector<size_t> prc_ord;
......@@ -639,13 +642,13 @@ class Vcluster: public Vcluster_base
// Now we reorder rcv
for (size_t i = 0 ; i < rcv.size() ; i++)
{
recv_ord.get(i).swap(recv_buf.get(rcv.get(i).pos));
recv_ord.get(i).swap(self_base::recv_buf.get(rcv.get(i).pos));
prc_ord.get(i) = rcv.get(i).proc;
sz_recv_ord.get(i) = sz_recv.get(rcv.get(i).pos);
}
// move rcv into recv
recv_buf.swap(recv_ord);
self_base::recv_buf.swap(recv_ord);
prc.swap(prc_ord);
sz_recv.swap(sz_recv_ord);
......@@ -859,7 +862,7 @@ class Vcluster: public Vcluster_base
// Function to initialize the global VCluster //
extern Vcluster * global_v_cluster_private;
extern Vcluster<> * global_v_cluster_private;
/*! \brief Initialize a global instance of Runtime Virtual Cluster Machine
*
......@@ -870,7 +873,7 @@ extern Vcluster * global_v_cluster_private;
static inline void init_global_v_cluster_private(int *argc, char ***argv)
{
if (global_v_cluster_private == NULL)
global_v_cluster_private = new Vcluster(argc,argv);
{global_v_cluster_private = new Vcluster<>(argc,argv);}
}
static inline void delete_global_v_cluster_private()
......@@ -878,7 +881,7 @@ static inline void delete_global_v_cluster_private()
delete global_v_cluster_private;
}
static inline Vcluster & create_vcluster()
static inline Vcluster<> & create_vcluster()
{
#ifdef SE_CLASS1
......
......@@ -104,7 +104,7 @@ union red
* \snippet VCluster_unit_test_util.hpp allGather numbers
*
*/
template<typename InternalMemory>
class Vcluster_base
{
//! log file
......@@ -198,7 +198,7 @@ class Vcluster_base
protected:
//! Receive buffers
openfpm::vector<BHeapMemory> recv_buf;
openfpm::vector<BMemory<InternalMemory>> recv_buf;
//! tags receiving
openfpm::vector<size_t> tags;
......
......@@ -17,7 +17,7 @@ struct unpack_selector_with_prp
template<typename op,
int ... prp>
static void call_unpack(S & recv,
openfpm::vector<BHeapMemory> & recv_buf,
openfpm::vector<BMemory<HeapMemory>> & recv_buf,
openfpm::vector<size_t> * sz,
openfpm::vector<size_t> * sz_byte,
op & op_param,
......@@ -60,7 +60,7 @@ struct unpack_each_prop_buffer
{
S & recv;
openfpm::vector<BHeapMemory> & recv_buf;
openfpm::vector<BMemory<HeapMemory>> & recv_buf;
size_t i;
......@@ -76,7 +76,7 @@ struct unpack_each_prop_buffer
*
*/
inline unpack_each_prop_buffer(S & recv,
openfpm::vector<BHeapMemory> & recv_buf,
openfpm::vector<BMemory<HeapMemory>> & recv_buf,
op & op_param,
size_t i,
openfpm::vector<size_t> * sz,
......@@ -141,22 +141,26 @@ struct process_receive_mem_traits_inte
size_t i;
//! Receive buffer
openfpm::vector<BHeapMemory> & recv_buf;
openfpm::vector<BMemory<HeapMemory>> & recv_buf;
//! Fake vector that map over received memory
openfpm::vector<typename sT::value_type,PtrMemory,typename layout_base<typename sT::value_type>::type,layout_base,openfpm::grow_policy_identity> & v2;
size_t n_ele = 0;
// options
size_t opt;
/*! \brief constructor
*
* \param v set of pointer buffers to set
*
*/
inline process_receive_mem_traits_inte(openfpm::vector<typename sT::value_type,PtrMemory,typename layout_base<typename sT::value_type>::type,layout_base,openfpm::grow_policy_identity> & v2,
openfpm::vector<BHeapMemory> & recv_buf,
size_t i)
:i(i),recv_buf(recv_buf),v2(v2)
openfpm::vector<BMemory<HeapMemory>> & recv_buf,
size_t i,
size_t opt)
:i(i),recv_buf(recv_buf),v2(v2),opt(opt)
{};
//! It call the copy function for each property
......@@ -168,8 +172,23 @@ struct process_receive_mem_traits_inte
// calculate the number of received elements
this->n_ele = recv_buf.get(i).size() / sizeof(type_prp);
// add the received particles to the vector
PtrMemory * ptr1 = new PtrMemory(recv_buf.get(i).getPointer(),recv_buf.get(i).size());
PtrMemory * ptr1;
if (opt == MPI_GPU_DIRECT)
{
#if defined(MPIX_CUDA_AWARE_SUPPORT) && MPIX_CUDA_AWARE_SUPPORT
// add the received particles to the vector
ptr1 = new PtrMemory(recv_buf.get(i).getDevicePointer(),recv_buf.get(i).size());
#else
// add the received particles to the vector
ptr1 = new PtrMemory(recv_buf.get(i).getPointer(),recv_buf.get(i).size());
#endif
}
else
{
// add the received particles to the vector
ptr1 = new PtrMemory(recv_buf.get(i).getPointer(),recv_buf.get(i).size());
}
v2.template setMemory<T::value>(*ptr1);
......@@ -181,7 +200,7 @@ template<bool inte_or_lin,typename T, typename S, template<typename> class layou
struct unpack_selector_with_prp_lin
{
template<typename op, unsigned int ... prp> static int call_unpack_impl(S & recv,
openfpm::vector<BHeapMemory> & recv_buf,
openfpm::vector<BMemory<HeapMemory>> & recv_buf,
openfpm::vector<size_t> * sz,
openfpm::vector<size_t> * sz_byte,
op & op_param,
......@@ -191,7 +210,7 @@ struct unpack_selector_with_prp_lin
// create vector representation to a piece of memory already allocated
openfpm::vector<typename T::value_type,PtrMemory,typename layout_base<typename T::value_type>::type,layout_base,openfpm::grow_policy_identity> v2;
process_receive_mem_traits_inte<T,layout_base> prmti(v2,recv_buf,i);
process_receive_mem_traits_inte<T,layout_base> prmti(v2,recv_buf,i,opt);
boost::mpl::for_each_ref<boost::mpl::range_c<int,0,T::value_type::max_prop>>(prmti);
......@@ -218,7 +237,7 @@ template<typename T, typename S, template<typename> class layout_base>
struct unpack_selector_with_prp_lin<true,T,S,layout_base>
{
template<typename op, unsigned int ... prp> static int call_unpack_impl(S & recv,
openfpm::vector<BHeapMemory> & recv_buf,
openfpm::vector<BMemory<HeapMemory>> & recv_buf,
openfpm::vector<size_t> * sz,
openfpm::vector<size_t> * sz_byte,
op & op_param,
......@@ -263,7 +282,7 @@ template<typename T, typename S, template<typename> class layout_base>
struct unpack_selector_with_prp<true,T,S,layout_base>
{
template<typename op, unsigned int ... prp> static void call_unpack(S & recv,
openfpm::vector<BHeapMemory> & recv_buf,
openfpm::vector<BMemory<HeapMemory>> & recv_buf,
openfpm::vector<size_t> * sz,
openfpm::vector<size_t> * sz_byte,
op & op_param,
......@@ -298,7 +317,7 @@ struct call_serialize_variadic<index_tuple<prp...>>
template<typename op, typename T, typename S, template<typename> class layout_base>
inline static void call_unpack(S & recv,
openfpm::vector<BHeapMemory> & recv_buf,
openfpm::vector<BMemory<HeapMemory>> & recv_buf,
openfpm::vector<size_t> * sz,
openfpm::vector<size_t> * sz_byte,
op & op_param,
......@@ -487,7 +506,7 @@ struct pack_unpack_cond_with_prp
}
static void unpacking(S & recv,
openfpm::vector<BHeapMemory> & recv_buf,
openfpm::vector<BMemory<HeapMemory>> & recv_buf,
openfpm::vector<size_t> * sz,
openfpm::vector<size_t> * sz_byte,
op & op_param,
......
......@@ -32,7 +32,7 @@ BOOST_AUTO_TEST_CASE (Vcluster_semantic_gather)
{
for (size_t i = 0 ; i < 100 ; i++)
{
Vcluster & vcl = create_vcluster();
Vcluster<> & vcl = create_vcluster();
if (vcl.getProcessUnitID() == 0 && i == 0)
std::cout << "Semantic gather test start" << std::endl;
......@@ -72,7 +72,7 @@ BOOST_AUTO_TEST_CASE (Vcluster_semantic_gather_2)
{
for (size_t i = 0 ; i < 100 ; i++)
{
Vcluster & vcl = create_vcluster();
Vcluster<> & vcl = create_vcluster();
if (vcl.getProcessingUnits() >= 32)
return;
......@@ -131,7 +131,7 @@ BOOST_AUTO_TEST_CASE (Vcluster_semantic_gather_3)
{
for (size_t i = 0 ; i < 100 ; i++)
{
Vcluster & vcl = create_vcluster();
Vcluster<> & vcl = create_vcluster();
if (vcl.getProcessingUnits() >= 32)
{return;}
......@@ -208,7 +208,7 @@ BOOST_AUTO_TEST_CASE (Vcluster_semantic_gather_4)
{
for (size_t i = 0 ; i < 100 ; i++)
{
Vcluster & vcl = create_vcluster();
Vcluster<> & vcl = create_vcluster();
if (vcl.getProcessingUnits() >= 32)
{return;}
......@@ -271,7 +271,7 @@ BOOST_AUTO_TEST_CASE (Vcluster_semantic_gather_5)
{
for (size_t i = 0 ; i < 100 ; i++)
{
Vcluster & vcl = create_vcluster();
Vcluster<> & vcl = create_vcluster();
if (vcl.getProcessingUnits() >= 32)
{return;}
......@@ -338,7 +338,7 @@ BOOST_AUTO_TEST_CASE (Vcluster_semantic_gather_6)
{
for (size_t i = 0 ; i < 100 ; i++)
{
Vcluster & vcl = create_vcluster();
Vcluster<> & vcl = create_vcluster();
if (vcl.getProcessingUnits() >= 32)
{return;}
......@@ -387,7 +387,7 @@ BOOST_AUTO_TEST_CASE (Vcluster_semantic_gather_7)
{
for (size_t i = 0 ; i < 100 ; i++)
{
Vcluster & vcl = create_vcluster();
Vcluster<> & vcl = create_vcluster();
if (vcl.getProcessingUnits() >= 32)
{return;}
......@@ -451,7 +451,7 @@ BOOST_AUTO_TEST_CASE (Vcluster_semantic_gather_8)
{
for (size_t i = 0 ; i < 100 ; i++)
{
Vcluster & vcl = create_vcluster();
Vcluster<> & vcl = create_vcluster();
if (vcl.getProcessingUnits() >= 32)
{return;}
......@@ -497,7 +497,7 @@ BOOST_AUTO_TEST_CASE (Vcluster_semantic_struct_gather)
{
for (size_t i = 0 ; i < 100 ; i++)
{
Vcluster & vcl = create_vcluster();
Vcluster<> & vcl = create_vcluster();
if (vcl.getProcessingUnits() >= 32)
return;
......@@ -541,7 +541,7 @@ void test_different_layouts()
{
for (size_t i = 0 ; i < 100 ; i++)
{
Vcluster & vcl = create_vcluster();
Vcluster<> & vcl = create_vcluster();
if (vcl.getProcessingUnits() >= 32)
return;
......@@ -595,7 +595,7 @@ BOOST_AUTO_TEST_CASE (Vcluster_semantic_scatter)
{
for (size_t i = 0 ; i < 100 ; i++)
{
Vcluster & vcl = create_vcluster();
Vcluster<> & vcl = create_vcluster();
if (vcl.getProcessingUnits() >= 32)
{return;}
......@@ -645,7 +645,7 @@ BOOST_AUTO_TEST_CASE (Vcluster_semantic_struct_scatter)
{
for (size_t i = 0 ; i < 100 ; i++)
{
Vcluster & vcl = create_vcluster();
Vcluster<> & vcl = create_vcluster();
if (vcl.getProcessingUnits() >= 32)
{return;}
......@@ -701,7 +701,7 @@ BOOST_AUTO_TEST_CASE (Vcluster_semantic_sendrecv_all_unknown)
for (size_t i = 0 ; i < 100 ; i++)
{
Vcluster & vcl = create_vcluster();
Vcluster<> & vcl = create_vcluster();
if (vcl.getProcessUnitID() == 0 && i == 0)
std::cout << "Semantic sendrecv test start" << std::endl;
......@@ -805,7 +805,7 @@ BOOST_AUTO_TEST_CASE (Vcluster_semantic_sendrecv_receive_size_known)
for (size_t i = 0 ; i < 100 ; i++)
{
Vcluster & vcl = create_vcluster();
Vcluster<> & vcl = create_vcluster();
if (vcl.getProcessUnitID() == 0 && i == 0)
{std::cout << "Semantic sendrecv test start" << std::endl;}
......@@ -886,7 +886,7 @@ BOOST_AUTO_TEST_CASE (Vcluster_semantic_sendrecv_receive_known)
for (size_t i = 0 ; i < 100 ; i++)
{
Vcluster & vcl = create_vcluster();
Vcluster<> & vcl = create_vcluster();
if (vcl.getProcessUnitID() == 0 && i == 0)
{std::cout << "Semantic sendrecv test start" << std::endl;}
......@@ -962,7 +962,7 @@ BOOST_AUTO_TEST_CASE (Vcluster_semantic_struct_sendrecv)
{
for (size_t i = 0 ; i < 100 ; i++)
{
Vcluster & vcl = create_vcluster();
Vcluster<> & vcl = create_vcluster();
if (vcl.getProcessingUnits() >= 32)
{return;}
......@@ -1034,7 +1034,7 @@ BOOST_AUTO_TEST_CASE (Vcluster_semantic_struct_sendrecv)
// Send and receive 0 and check
{
Vcluster & vcl = create_vcluster();
Vcluster<> & vcl = create_vcluster();
openfpm::vector<size_t> prc_recv2;
openfpm::vector<size_t> prc_send;
......@@ -1062,7 +1062,7 @@ BOOST_AUTO_TEST_CASE (Vcluster_semantic_sendrecv_2)
{
for (size_t i = 0 ; i < 100 ; i++)
{
Vcluster & vcl = create_vcluster();
Vcluster<> & vcl = create_vcluster();
if (vcl.getProcessingUnits() >= 32)
return;
......@@ -1152,7 +1152,7 @@ BOOST_AUTO_TEST_CASE (Vcluster_semantic_sendrecv_3)
{
for (size_t i = 0 ; i < 100 ; i++)
{
Vcluster & vcl = create_vcluster();
Vcluster<> & vcl = create_vcluster();
if (vcl.getProcessingUnits() >= 32)
return;
......@@ -1293,7 +1293,7 @@ BOOST_AUTO_TEST_CASE (Vcluster_semantic_sendrecv_4)
{
for (size_t i = 0 ; i < 100 ; i++)
{
Vcluster & vcl = create_vcluster();
Vcluster<> & vcl = create_vcluster();
if (vcl.getProcessingUnits() >= 32)
return;
......@@ -1418,7 +1418,7 @@ BOOST_AUTO_TEST_CASE (Vcluster_semantic_sendrecv_5)
{
for (size_t i = 0 ; i < 100 ; i++)
{
Vcluster & vcl = create_vcluster();
Vcluster<> & vcl = create_vcluster();
if (vcl.getProcessingUnits() >= 32)
return;
......@@ -1554,7 +1554,7 @@ BOOST_AUTO_TEST_CASE (Vcluster_semantic_sendrecv_6)
{
for (size_t i = 0 ; i < 100 ; i++)
{
Vcluster & vcl = create_vcluster();
Vcluster<> & vcl = create_vcluster();
if (vcl.getProcessingUnits() >= 32)
return;
......
......@@ -103,12 +103,12 @@ void * msg_alloc3(size_t msg_i ,size_t total_msg, size_t total_p, size_t i, size
return &(v->last().get(0));
}
template<unsigned int ip, typename T> void commFunc(Vcluster & vcl,openfpm::vector< size_t > & prc, openfpm::vector< T > & data, void * (* msg_alloc)(size_t,size_t,size_t,size_t,size_t,size_t,void *), void * ptr_arg)
template<unsigned int ip, typename T> void commFunc(Vcluster<> & vcl,openfpm::vector< size_t > & prc, openfpm::vector< T > & data, void * (* msg_alloc)(size_t,size_t,size_t,size_t,size_t,size_t,void *), void * ptr_arg)
{
vcl.sendrecvMultipleMessagesNBX(prc,data,msg_alloc,ptr_arg);
}
template<unsigned int ip, typename T> void commFunc_null_odd(Vcluster & vcl,openfpm::vector< size_t > & prc, openfpm::vector< T > & data, void * (* msg_alloc)(size_t,size_t,size_t,size_t,size_t,size_t,void *), void * ptr_arg)
template<unsigned int ip, typename T> void commFunc_null_odd(Vcluster<> & vcl,openfpm::vector< size_t > & prc, openfpm::vector< T > & data, void * (* msg_alloc)(size_t,size_t,size_t,size_t,size_t,size_t,void *), void * ptr_arg)
{
if (vcl.getProcessUnitID() % 2 == 0)
vcl.sendrecvMultipleMessagesNBX(prc,data,msg_alloc,ptr_arg);
......@@ -126,7 +126,7 @@ template <unsigned int ip> std::string method()
template<unsigned int ip> void test_no_send_some_peer()
{
Vcluster & vcl = create_vcluster();
Vcluster<> & vcl = create_vcluster();
size_t n_proc = vcl.getProcessingUnits();
......@@ -218,7 +218,7 @@ template<unsigned int ip> void test_no_send_some_peer()
template<unsigned int ip> void test_known()
{
Vcluster & vcl = create_vcluster();
Vcluster<> & vcl = create_vcluster();
// send/recv messages
......@@ -326,7 +326,7 @@ template<unsigned int ip> void test_known()
template<unsigned int ip> void test(unsigned int opt)
{
Vcluster & vcl = create_vcluster();
Vcluster<> & vcl = create_vcluster();
// send/recv messages
......@@ -704,7 +704,7 @@ template<unsigned int ip> void test(unsigned int opt)
* \param vcl VCluster
*
*/
void test_send_recv_complex(const size_t n, Vcluster & vcl)
void test_send_recv_complex(const size_t n, Vcluster<> & vcl)
{
//! [Send and receive vectors of complex]
......@@ -767,7 +767,7 @@ void test_send_recv_complex(const size_t n, Vcluster & vcl)
* \param n size
*
*/
template<typename T> void test_send_recv_primitives(size_t n, Vcluster & vcl)
template<typename T> void test_send_recv_primitives(size_t n, Vcluster<> & vcl)
{
openfpm::vector<T> v_send = allocate_openfpm_primitive<T>(n,vcl.getProcessUnitID());
......@@ -844,7 +844,7 @@ template<typename T> void test_send_recv_primitives(size_t n, Vcluster & vcl)
}
}
template<typename T> void test_single_all_gather_primitives(Vcluster & vcl)
template<typename T> void test_single_all_gather_primitives(Vcluster<> & vcl)
{
//! [allGather numbers]
......@@ -861,7 +861,7 @@ template<typename T> void test_single_all_gather_primitives(Vcluster & vcl)
}
template<typename T,typename Memory, template <typename> class layout_base> void test_single_all_broadcast_primitives(Vcluster & vcl)
template<typename T,typename Memory, template <typename> class layout_base> void test_single_all_broadcast_primitives(Vcluster<> & vcl)
{
//! [bcast numbers]
......@@ -892,7 +892,7 @@ template<typename T,typename Memory, template <typename> class layout_base> voi
}
template<typename T,typename Memory, template <typename> class layout_base> void test_single_all_broadcast_complex(Vcluster & vcl)
template<typename T,typename Memory, template <typename> class layout_base> void test_single_all_broadcast_complex(Vcluster<> & vcl)
{
//! [bcast numbers]
......
......@@ -21,7 +21,7 @@ BOOST_AUTO_TEST_SUITE( VCluster_test )
BOOST_AUTO_TEST_CASE (Vcluster_robustness)
{
Vcluster & vcl = create_vcluster();
Vcluster<> & vcl = create_vcluster();
vcl.execute();
}
......@@ -31,7 +31,7 @@ BOOST_AUTO_TEST_CASE( VCluster_use_reductions)
//! [max min sum]
Vcluster & vcl = create_vcluster();
Vcluster<> & vcl = create_vcluster();
unsigned char uc = 1;
char c = 1;
......@@ -117,7 +117,7 @@ BOOST_AUTO_TEST_CASE( VCluster_use_reductions)
BOOST_AUTO_TEST_CASE(VCluster_send_recv)
{
Vcluster & vcl = create_vcluster();
Vcluster<> & vcl = create_vcluster();
test_send_recv_complex(N_V_ELEMENTS,vcl);
test_send_recv_primitives<unsigned char>(N_V_ELEMENTS,vcl);
......@@ -134,7 +134,7 @@ BOOST_AUTO_TEST_CASE(VCluster_send_recv)