Commit 0b083860 authored by incardon's avatar incardon

Fixing map performance tests

parent 9a560ecb
......@@ -45,10 +45,13 @@ double benchmark_map(size_t k_int, Vcluster<HeapMemory> & v_cl)
for (size_t i = 0; i < dim; i++)
{bc[i] = PERIODIC;}
vector_dist<dim,float, aggregate<float[dim]> > vd(k_int,box,bc,Ghost<dim,float>(0.1));
vector_dist<dim,float, aggregate<float[dim]> > vd(v_cl.size()*v_cl.size()*k_int,box,bc,Ghost<dim,float>(0.1));
auto & dec = vd.getDecomposition();
int start = 0;
int stop = k_int;
for (size_t i = 0 ; i < v_cl.size() ; i++)
{
if (i == v_cl.rank())
......@@ -60,7 +63,10 @@ double benchmark_map(size_t k_int, Vcluster<HeapMemory> & v_cl)
{
// generate all particles in the near processor
vd_initialize_box_nomap<dim>(vd,nn_box.get(0),v_cl,k_int);
vd_initialize_box_nomap<dim>(vd,nn_box.get(0),v_cl,start,stop);
start += k_int;
stop += k_int;
}
}
......
......@@ -166,16 +166,13 @@ void vd_initialize(v_dist & vd, Vcluster<HeapMemory> & v_cl)
*
*/
template<unsigned int dim, typename v_dist>
void vd_initialize_box_nomap(v_dist & vd, const Box<dim,typename v_dist::stype> & box, Vcluster<HeapMemory> & v_cl, int npart)
void vd_initialize_box_nomap(v_dist & vd, const Box<dim,typename v_dist::stype> & box, Vcluster<HeapMemory> & v_cl,int start, int stop)
{
// The random generator engine
std::default_random_engine eg(v_cl.getProcessUnitID()*4313);
std::uniform_real_distribution<float> ud(0.0f, 1.0f);
size_t n = vd.size_local();
size_t n_stop = n + npart;
auto it = vd.getIterator(n,n_stop);
auto it = vd.getIterator(start,stop);
while (it.isNext())
{
......
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