Commit daf36c05 authored by Pietro Incardona's avatar Pietro Incardona

Make ghost put test stringer

parent 2bd620dd
...@@ -8,8 +8,8 @@ All notable changes to this project will be documented in this file. ...@@ -8,8 +8,8 @@ All notable changes to this project will be documented in this file.
- Full-Support for complex property on vector-dist (Serialization) + example - Full-Support for complex property on vector-dist (Serialization) + example
### Fixed ### Fixed
- Installation in case of MPI preinstalled PETSC fail - Installation PETSC installation fail in case of preinstalled MPI
- vector_dist with negative domain - vector_dist with negative domain (Now supported)
- Grid 1D fixing - Grid 1D fixing
### Changed ### Changed
......
...@@ -57,6 +57,9 @@ fi ...@@ -57,6 +57,9 @@ fi
if [ -d "$1/MPI" ]; then if [ -d "$1/MPI" ]; then
configure_trilinos_options="$configure_trilinos_options -D MPI_BASE_DIR=$1/MPI " configure_trilinos_options="$configure_trilinos_options -D MPI_BASE_DIR=$1/MPI "
mpi_dir="$1/MPI"
else
mpi_dir=$(dirname "$(dirname "$(which mpic++)")")
fi fi
### It seem that the PETSC --download-packege option has several problems and cannot produce ### It seem that the PETSC --download-packege option has several problems and cannot produce
...@@ -286,9 +289,9 @@ fi ...@@ -286,9 +289,9 @@ fi
tar -xf petsc-lite-3.6.4.tar.gz tar -xf petsc-lite-3.6.4.tar.gz
cd petsc-3.6.4 cd petsc-3.6.4
echo "./configure --with-cxx-dialect=C++11 --with-mpi-dir=$1/MPI $configure_options --prefix=$1/PETSC" echo "./configure --with-cxx-dialect=C++11 --with-mpi-dir=$mpi_dir $configure_options --prefix=$1/PETSC"
./configure --with-cxx-dialect=C++11 $petsc_openmp --with-mpi-dir=$1/MPI $configure_options --with-mumps-lib="$MUMPS_extra_lib" --prefix=$1/PETSC ./configure --with-cxx-dialect=C++11 $petsc_openmp --with-mpi-dir=$mpi_dir $configure_options --with-mumps-lib="$MUMPS_extra_lib" --prefix=$1/PETSC
make all test make all test
make install make install
......
...@@ -1632,62 +1632,119 @@ BOOST_AUTO_TEST_CASE( vector_dist_ghost_put ) ...@@ -1632,62 +1632,119 @@ BOOST_AUTO_TEST_CASE( vector_dist_ghost_put )
// sync the ghost // sync the ghost
vd.ghost_get<0>(); vd.ghost_get<0>();
auto NN = vd.getCellList(1.3/k); {
float a = 1.0f*k*k; auto NN = vd.getCellList(1.3/k);
float a = 1.0f*k*k;
// run trough all the particles + ghost // run trough all the particles + ghost
auto it2 = vd.getDomainIterator(); auto it2 = vd.getDomainIterator();
while (it2.isNext()) while (it2.isNext())
{ {
// particle p // particle p
auto p = it2.get(); auto p = it2.get();
Point<3,float> xp = vd.getPos(p); Point<3,float> xp = vd.getPos(p);
// Get an iterator over the neighborhood particles of p // Get an iterator over the neighborhood particles of p
auto Np = NN.template getNNIterator<NO_CHECK>(NN.getCell(vd.getPos(p))); auto Np = NN.template getNNIterator<NO_CHECK>(NN.getCell(vd.getPos(p)));
// For each neighborhood particle ... // For each neighborhood particle ...
while (Np.isNext()) while (Np.isNext())
{ {
auto q = Np.get(); auto q = Np.get();
Point<3,float> xq = vd.getPos(q); Point<3,float> xq = vd.getPos(q);
float dist = xp.distance(xq); float dist = xp.distance(xq);
if (dist < 1.0/k) if (dist < 1.0/k)
vd.getProp<0>(q) += a*(-dist*dist+1.0/k/k); vd.getProp<0>(q) += a*(-dist*dist+1.0/k/k);
++Np; ++Np;
}
++it2;
} }
++it2; vd.ghost_put<add_,0>();
}
vd.ghost_put<add_,0>(); bool ret = true;
auto it3 = vd.getDomainIterator();
bool ret = true; float constant = vd.getProp<0>(it3.get());
auto it3 = vd.getDomainIterator(); float eps = 0.001;
while (it3.isNext())
{
float constant2 = vd.getProp<0>(it3.get());
if (fabs(constant - constant2)/constant > eps)
{
std::cout << Point<3,float>(vd.getPos(it3.get())).toString() << " " << constant2 << "/" << constant << " " << v_cl.getProcessUnitID() << std::endl;
ret = false;
break;
}
float constant = vd.getProp<0>(it3.get()); ++it3;
float eps = 0.001; }
BOOST_REQUIRE_EQUAL(ret,true);
}
while (it3.isNext())
{ {
float constant2 = vd.getProp<0>(it3.get()); auto NN = vd.getCellList(1.3/k);
if (fabs(constant - constant2)/constant > eps) float a = 1.0f*k*k;
// run trough all the particles + ghost
auto it2 = vd.getDomainIterator();
while (it2.isNext())
{ {
std::cout << Point<3,float>(vd.getPos(it3.get())).toString() << " " << constant2 << "/" << constant << " " << v_cl.getProcessUnitID() << std::endl; // particle p
ret = false; auto p = it2.get();
break; Point<3,float> xp = vd.getPos(p);
// Get an iterator over the neighborhood particles of p
auto Np = NN.template getNNIterator<NO_CHECK>(NN.getCell(vd.getPos(p)));
// For each neighborhood particle ...
while (Np.isNext())
{
auto q = Np.get();
Point<3,float> xq = vd.getPos(q);
float dist = xp.distance(xq);
if (dist < 1.0/k)
vd.getProp<0>(q) += a*(-dist*dist+1.0/k/k);
++Np;
}
++it2;
} }
++it3; vd.ghost_put<add_,0>();
}
bool ret = true;
auto it3 = vd.getDomainIterator();
BOOST_REQUIRE_EQUAL(ret,true); float constant = vd.getProp<0>(it3.get());
float eps = 0.001;
while (it3.isNext())
{
float constant2 = vd.getProp<0>(it3.get());
if (fabs(constant - constant2)/constant > eps)
{
std::cout << Point<3,float>(vd.getPos(it3.get())).toString() << " " << constant2 << "/" << constant << " " << v_cl.getProcessUnitID() << std::endl;
ret = false;
break;
}
++it3;
}
BOOST_REQUIRE_EQUAL(ret,true);
}
} }
} }
......
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