Commit 2d24d5c6 authored by incardon's avatar incardon

Adding documentation

parent 82a87d7f
......@@ -5,3 +5,6 @@ Vcluster * global_v_cluster_private = NULL;
// number of vcluster instances
size_t n_vcluster = 0;
bool ofp_initialized = false;
size_t tot_sent = 0;
size_t tot_recv = 0;
......@@ -41,6 +41,8 @@ extern size_t n_vcluster;
extern bool global_mpi_init;
// initialization flag
extern bool ofp_initialized;
extern size_t tot_sent;
extern size_t tot_recv;
///////////////////// Post functions /////////////
......@@ -128,6 +130,53 @@ struct op_ssend_recv_merge
}
};
//! Helper class to merge data without serialization
template<bool sr>
struct op_ssend_gg_recv_merge_impl
{
//! Merge the
template<typename T, typename D, typename S, int ... prp> inline static void execute(D & recv,S & v2,size_t i,size_t & start)
{
// Merge the information
recv.template merge_prp_v<replace_,typename T::value_type, PtrMemory, openfpm::grow_policy_identity, prp...>(v2,start);
start += v2.size();
}
};
//! Helper class to merge data with serialization
template<>
struct op_ssend_gg_recv_merge_impl<true>
{
//! merge the data
template<typename T, typename D, typename S, int ... prp> inline static void execute(D & recv,S & v2,size_t i,size_t & start)
{
// Merge the information
recv.template merge_prp_v<replace_,typename T::value_type, HeapMemory, openfpm::grow_policy_double, prp...>(v2,start);
// from
start += v2.size();
}
};
//! Helper class to merge data
struct op_ssend_gg_recv_merge
{
//! starting marker
size_t start;
//! constructor
op_ssend_gg_recv_merge(size_t start)
:start(start)
{}
//! execute the merge
template<bool sr, typename T, typename D, typename S, int ... prp> void execute(D & recv,S & v2,size_t i)
{
op_ssend_gg_recv_merge_impl<sr>::template execute<T,D,S,prp...>(recv,v2,i,start);
}
};
//////////////////////////////////////////////////
//! temporal buffer for reductions
......@@ -650,6 +699,7 @@ public:
check_valid(ptr[i],sz[i]);
#endif
tot_sent += sz[i];
MPI_SAFE_CALL(MPI_Issend(ptr[i], sz[i], MPI_BYTE, prc[i], SEND_SPARSE + NBX_cnt, MPI_COMM_WORLD,&req.last()));
log.logSend(prc[i]);
}
......@@ -692,6 +742,7 @@ public:
#ifdef SE_CLASS2
check_valid(ptr,msize);
#endif
tot_recv += msize;
MPI_SAFE_CALL(MPI_Recv(ptr,msize,MPI_BYTE,stat_t.MPI_SOURCE,SEND_SPARSE+NBX_cnt,MPI_COMM_WORLD,&stat_t));
#ifdef SE_CLASS2
......
......@@ -11,10 +11,16 @@
#include "Grid/grid_util_test.hpp"
#include "data_type/aggregate.hpp"
//! Example structure
struct Aexample
{
//! Example size_t
size_t a;
//! Example float
float b;
//! Example double
double c;
};
......@@ -1409,6 +1415,8 @@ BOOST_AUTO_TEST_CASE (Vcluster_semantic_bench_all_all)
comm_time.stop();
std::cout << "Communication time " << comm_time.getwct() << std::endl;
std::cout << "Total sent: " << tot_sent << " Tot recv: " << tot_recv << std::endl;
std::cout << "END" << std::endl;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment