Commit b340ed59 authored by incardon's avatar incardon

Fixing ghost get for distributed grids

parent c3e6ff5f
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -2,7 +2,7 @@
#define CARTDECOMPOSITION_UNIT_TEST_HPP
#include "CartDecomposition.hpp"
#include "mathutil.hpp"
#include "util/mathutil.hpp"
BOOST_AUTO_TEST_SUITE( CartDecomposition_test )
......
......@@ -9,7 +9,7 @@
#define ORB_HPP_
#include "data_type/scalar.hpp"
#include "mathutil.hpp"
#include "util/mathutil.hpp"
/*! \brief this class is a functor for "for_each" algorithm
*
......
......@@ -90,7 +90,7 @@ public:
T szd[dim];
for (int i = 0 ; i < dim ; i++)
for (size_t i = 0 ; i < dim ; i++)
{szd[i] = (dom.getHigh(i) - dom.getLow(i)) / sz[i];}
//! Construct an hyper-cube of dimension dim
......@@ -137,7 +137,7 @@ public:
// Get the combinations of dimension d
for (int d = dim-1 ; d >= dim_c ; d--)
for (size_t d = dim-1 ; d >= dim_c ; d--)
{
// create the edges for that dimension
......@@ -145,7 +145,7 @@ public:
// for each combination calculate a safe linearization and create an edge
for (int j = 0 ; j < c.size() ; j++)
for (size_t j = 0 ; j < c.size() ; j++)
{
// Calculate the element size
......@@ -153,7 +153,7 @@ public:
// for each dimension multiply and reduce
for (int s = 0 ; s < dim ; s++)
for (size_t s = 0 ; s < dim ; s++)
{
ele_sz += szd[s] * abs(c[j][s]);
}
......@@ -200,7 +200,7 @@ public:
T szd[dim];
for (int i = 0 ; i < dim ; i++)
for (size_t i = 0 ; i < dim ; i++)
{szd[i] = (dom.getHigh(i) - dom.getLow(i)) / sz[i];}
//! Construct an hyper-cube of dimension dim
......@@ -247,7 +247,7 @@ public:
// Get the combinations of dimension d
for (int d = dim-1 ; d >= dim_c ; d--)
for (size_t d = dim-1 ; d >= dim_c ; d--)
{
// create the edges for that dimension
......@@ -255,7 +255,7 @@ public:
// for each combination calculate a safe linearization and create an edge
for (int j = 0 ; j < c.size() ; j++)
for (size_t j = 0 ; j < c.size() ; j++)
{
// Calculate the element size
......@@ -263,7 +263,7 @@ public:
// for each dimension multiply and reduce
for (int s = 0 ; s < dim ; s++)
for (size_t s = 0 ; s < dim ; s++)
{
ele_sz += szd[s] * abs(c[j][s]);
}
......
This diff is collapsed.
......@@ -24,7 +24,7 @@
| +------------+ |
| |
+------------------+
(0,0)
(0,0) local coordinate ---> ( x, y )
\endverbatim
......@@ -41,6 +41,8 @@ struct GBoxes
Box<dim,long int> GDbox;
//! Domain box
Box<dim,long int> Dbox;
//! origin of GDbox in global coordinates
Point<dim,long int> origin;
};
#include "grid_dist_key.hpp"
......@@ -78,7 +80,7 @@ class grid_dist_iterator
*
*/
grid_dist_iterator(Vcluster_object_array<device_grid> & gk, const openfpm::vector<GBoxes<device_grid::dims>> & gdb_ext)
:g_c(0),gList(gk),gdb_ext(gdb_ext),m(m)
:g_c(0),gList(gk),gdb_ext(gdb_ext),m(0)
{
// Initialize the current iterator
// with the first grid
......
......@@ -189,8 +189,8 @@ CC = gcc
CCDEPMODE = depmode=gcc3
CFLAGS = -g -O2
CPPFLAGS =
CUDA_CFLAGS = -I -I -I/usr/local/cuda-5.5/include
CUDA_LIBS = -L -L -L/usr/local/cuda-5.5/lib64 -lcuda -lcudart
CUDA_CFLAGS = -I -I -I/usr/local/cuda/include
CUDA_LIBS = -L -L -L/usr/local/cuda/lib64 -lcuda -lcudart
CXX = mpic++
CXXDEPMODE = depmode=gcc3
CXXFLAGS = --std=c++11 -march=native -mtune=native -g3 -Wall -O0
......@@ -213,7 +213,7 @@ LIBS =
LTLIBOBJS =
MAKEINFO = ${SHELL} /home/i-bird/Desktop/MOSAIC/OpenFPM_project/OpenFPM_pdata/missing makeinfo
MKDIR_P = /usr/bin/mkdir -p
NVCC = /usr/local/cuda-5.5/bin/nvcc
NVCC = /usr/local/cuda/bin/nvcc
NVCCFLAGS = -g -O0
NVCC_EXIST = yes
OBJEXT = o
......
......@@ -16,7 +16,7 @@
#include "memory/PreAllocHeapMemory.hpp"
#include "memory/PtrMemory.hpp"
#include "NN/CellList/CellList.hpp"
#include "common.hpp"
#include "util/common.hpp"
#include "util/object_util.hpp"
#include "memory/ExtPreAlloc.hpp"
#include "CSVWriter.hpp"
......@@ -102,7 +102,7 @@ public:
// Calculate the maximum number (before merging) of sub-domain on
// each dimension
size_t div[point::dims];
for (int i = 0 ; i < point::dims ; i++)
for (size_t i = 0 ; i < point::dims ; i++)
{div[i] = openfpm::math::round_big_2(pow(n_sub,1.0/point::dims));}
// Create the sub-domains
......@@ -487,9 +487,9 @@ public:
for (size_t j = 0 ; j < opart.get(i).size() ; j++)
{
// source object type
typedef encapc<1,prop,typename openfpm::vector<prop>::memory_t> encap_src;
typedef encapc<1,prop,typename openfpm::vector<prop>::memory_conf> encap_src;
// destination object type
typedef encapc<1,prp_object,typename openfpm::vector<prp_object>::memory_t> encap_dst;
typedef encapc<1,prp_object,typename openfpm::vector<prp_object>::memory_conf> encap_dst;
// Copy only the selected properties
object_si_d<encap_src,encap_dst,ENCAP,prp...>(v_prp.get(INTERNAL).get(opart.get(i).get(j)),g_send_prp.get(i).get(j));
......
......@@ -113,7 +113,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_ghost )
const auto & dec = vd.getDecomposition();
// Get the ghost external boxes
openfpm::vector<size_t> vb(dec.getNGhostBox());
openfpm::vector<size_t> vb(dec.getNEGhostBox());
// Get the ghost iterator
auto g_it = vd.getGhostIterator();
......@@ -131,9 +131,9 @@ BOOST_AUTO_TEST_CASE( vector_dist_ghost )
size_t lb = 0;
// check if the received data is in one of the ghost boxes
for ( ; b < dec.getNGhostBox() ; b++)
for ( ; b < dec.getNEGhostBox() ; b++)
{
if (dec.getGhostBox(b).isInside(vd.getPos<s::x>(key)) == true)
if (dec.getEGhostBox(b).isInside(vd.getPos<s::x>(key)) == true)
{
is_in = true;
......@@ -145,7 +145,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_ghost )
BOOST_REQUIRE_EQUAL(is_in,true);
// Check that the particle come from the correct processor
BOOST_REQUIRE_EQUAL(vd.getProp<p::v>(key)[0],dec.getGhostBoxProcessor(lb));
BOOST_REQUIRE_EQUAL(vd.getProp<p::v>(key)[0],dec.getEGhostBoxProcessor(lb));
++g_it;
}
......@@ -155,7 +155,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_ghost )
for (size_t i = 0 ; i < vb.size() ; i++)
{
// Calculate how many particle should be in the box
size_t n_point = cd.getGridPoints(dec.getGhostBox(i)).getVolume();
size_t n_point = cd.getGridPoints(dec.getEGhostBox(i)).getVolumeKey();
BOOST_REQUIRE_EQUAL(n_point,vb.get(i));
}
......
......@@ -115,7 +115,7 @@ private:
*/
void expand_one_wf(openfpm::vector<wavefront<dim>> & v_w, std::vector<comb<dim>> & w_comb , size_t d)
{
for (int j = 0 ; j < dim ; j++)
for (size_t j = 0 ; j < dim ; j++)
{
v_w.template get<wavefront<dim>::stop>(d)[j] = v_w.template get<wavefront<dim>::stop>(d)[j] + w_comb[d].c[j];
v_w.template get<wavefront<dim>::start>(d)[j] = v_w.template get<wavefront<dim>::start>(d)[j] + w_comb[d].c[j];
......@@ -136,9 +136,9 @@ private:
// Eliminate the w_comb[d] direction
for (int k = 0 ; k < q_comb.size() ; k++)
for (size_t k = 0 ; k < q_comb.size() ; k++)
{
for (int j = 0 ; j < dim ; j++)
for (size_t j = 0 ; j < dim ; j++)
{
if (w_comb[d].c[j] != 0)
{
......@@ -148,7 +148,7 @@ private:
}
// for all the combinations
for (int j = 0 ; j < q_comb.size() ; j++)
for (size_t j = 0 ; j < q_comb.size() ; j++)
{
size_t id = hyp.LinId(q_comb[j]);
......@@ -158,7 +158,7 @@ private:
// is positive, modify the stop point or the starting point
for (int s = 0 ; s < dim ; s++)
for (size_t s = 0 ; s < dim ; s++)
{
if (is_pos == true)
{v_w.template get<wavefront<dim>::stop>(id)[s] = v_w.template get<wavefront<dim>::stop>(id)[s] + w_comb[d].c[s];}
......@@ -257,7 +257,7 @@ private:
// Create an Hyper-cube
HyperCube<dim> hyp;
for (int d = 0 ; d < v_w.size() ; d++)
for (size_t d = 0 ; d < v_w.size() ; d++)
{
expand_one_wf(v_w,w_comb,d);
adjust_others_wf(v_w,hyp,w_comb,d);
......@@ -265,7 +265,7 @@ private:
// for each expanded wavefront create a sub-grid iterator and add the sub-domain
for (int d = 0 ; d < v_w.size() ; d++)
for (size_t d = 0 ; d < v_w.size() ; d++)
{
// Create a sub-grid iterator
grid_key_dx_iterator_sub<dim> g_sub(gh,v_w.template get<wavefront<dim>::start>(d),v_w.template get<wavefront<dim>::stop>(d));
......@@ -357,7 +357,7 @@ private:
// for each direction of expansion expand the wavefront
for (int d = 0 ; d < n_wf ; d++)
for (size_t d = 0 ; d < n_wf ; d++)
{
// number of processed sub-domain
size_t n_proc_sub = 0;
......@@ -403,7 +403,7 @@ private:
if (w_can_expand == true)
{
// expand the wavefront
for (int j = 0 ; j < dim ; j++)
for (size_t j = 0 ; j < dim ; j++)
{
v_w.template get<wavefront<dim>::stop>(d)[j] = v_w.template get<wavefront<dim>::stop>(d)[j] + w_comb[d].c[j];
v_w.template get<wavefront<dim>::start>(d)[j] = v_w.template get<wavefront<dim>::start>(d)[j] + w_comb[d].c[j];
......@@ -415,9 +415,9 @@ private:
// Eliminate the w_comb[d] direction
for (int k = 0 ; k < q_comb.size() ; k++)
for (size_t k = 0 ; k < q_comb.size() ; k++)
{
for (int j = 0 ; j < dim ; j++)
for (size_t j = 0 ; j < dim ; j++)
{
if (w_comb[d].c[j] != 0)
{
......@@ -427,7 +427,7 @@ private:
}
// for all the combinations
for (int j = 0 ; j < q_comb.size() ; j++)
for (size_t j = 0 ; j < q_comb.size() ; j++)
{
size_t id = hyp.LinId(q_comb[j]);
......@@ -437,7 +437,7 @@ private:
// is positive, modify the stop point or the starting point
for (int s = 0 ; s < dim ; s++)
for (size_t s = 0 ; s < dim ; s++)
{
if (is_pos == true)
{v_w.template get<wavefront<dim>::stop>(id)[s] = v_w.template get<wavefront<dim>::stop>(id)[s] + w_comb[d].c[s];}
......@@ -451,7 +451,7 @@ private:
// get back the hyper-cube produced
for (int i = 0 ; i < dim ; i++)
for (size_t i = 0 ; i < dim ; i++)
{
// get the index of the wavefront direction
size_t p_f = hyp.positiveFace(i);
......@@ -473,9 +473,9 @@ private:
{
// Wavefront to initialize
for (int i = 0 ; i < v_w.size() ; i++)
for (size_t i = 0 ; i < v_w.size() ; i++)
{
for (int j = 0 ; j < dim ; j++)
for (size_t j = 0 ; j < dim ; j++)
{
v_w.template get<wavefront<dim>::start>(i)[j] = start_p.get(j);
v_w.template get<wavefront<dim>::stop>(i)[j] = start_p.get(j);
......@@ -517,7 +517,7 @@ private:
const grid_key_dx<dim> & gk = g_sub.get();
// if the subdomain has the id we are searching stop
if (graph.vertex(gh.LinId(gk)).template get<p_id>() == id)
if ((long int)graph.vertex(gh.LinId(gk)).template get<p_id>() == id)
{
return gk;
}
......
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