Commit f2e1b994 authored by incardon's avatar incardon

Fixing jenkins script

parent ea3864ab
......@@ -103,6 +103,7 @@ elif [ "$2" == "taurus" ]
then
echo "Compiling on taurus"
source /etc/profile
echo "$PATH"
module load gcc/4.8.2
module load boost/1.55.0-gnu4.8
......
......@@ -222,7 +222,7 @@ private:
//! it contain the internal ghosts of the local processor
openfpm::vector<lBox_dom> loc_ghost_box;
//! Structure that contain for each sub-domain box the processor id
//! Structure that contain for each sub-sub-domain box the processor id
//! exist for efficient global communication
openfpm::vector<size_t> fine_s;
......
......@@ -38,6 +38,10 @@ BOOST_AUTO_TEST_CASE( grid_dist_id_domain_grid_unit_converter_test)
Vcluster & v_cl = *global_v_cluster;
// Skip this test on big scale
if (v_cl.getProcessingUnits() >= 32)
return;
// Test several grid dimensions
for (size_t k = 1024 ; k >= 2 ; k--)
......@@ -86,17 +90,18 @@ BOOST_AUTO_TEST_CASE( grid_dist_id_domain_grid_unit_converter_test)
}
}
BOOST_AUTO_TEST_CASE( grid_dist_id_iterator_test_use)
void Test2D(const Box<2,float> & domain, long int k)
{
// Domain
Box<2,float> domain({0.0,0.0},{1.0,1.0});
// Initialize the global VCluster
init_global_v_cluster(&boost::unit_test::framework::master_test_suite().argc,&boost::unit_test::framework::master_test_suite().argv);
// 2D test
for ( ; k >= 2 ; k-= (k >= 66)?33:1 )
{
BOOST_TEST_CHECKPOINT( "Testing 2D grid k=" << k );
for (long int k = 1024 ; k >= 2 ; k-= (k >= 66)?33:1 )
if (global_v_cluster->getProcessUnitID() == 0)
{
BOOST_TEST_CHECKPOINT( "Testing grid k=" << k );
std::cout << "Testing 2D: "<< k << "\n";
}
// grid size
size_t sz[2];
sz[0] = k;
......@@ -182,10 +187,132 @@ BOOST_AUTO_TEST_CASE( grid_dist_id_iterator_test_use)
++domg;
}
}
}
void Test3D(const Box<3,float> & domain, long int k)
{
// 3D test
for ( ; k >= 2 ; k-= (k >= 33)?5:1 )
{
BOOST_TEST_CHECKPOINT( "Testing 3D grid k=" << k );
if (global_v_cluster->getProcessUnitID() == 0)
{
std::cout << "Testing 3D: "<< k << "\n";
}
// grid size
size_t sz[3];
sz[0] = k;
sz[1] = k;
sz[2] = k;
// Ghost
Ghost<3,float> g(0.01);
// Distributed grid with id decomposition
grid_dist_id<3, float, scalar<float>, CartDecomposition<3,float>> g_dist(sz,domain,g);
// check the consistency of the decomposition
bool val = g_dist.getDecomposition().check_consistency();
BOOST_REQUIRE_EQUAL(val,true);
// Grid sm
grid_sm<3,void> info(sz);
// get the domain iterator
size_t count = 0;
auto dom = g_dist.getDomainIterator();
while (dom.isNext())
{
auto key = dom.get();
auto key_g = g_dist.getGKey(key);
g_dist.template get<0>(key) = info.LinId(key_g);
// Count the point
count++;
++dom;
}
// Get the virtual cluster machine
Vcluster & vcl = g_dist.getVC();
// reduce
vcl.reduce(count);
vcl.execute();
// Check
BOOST_REQUIRE_EQUAL(count,k*k*k);
auto dom2 = g_dist.getDomainIterator();
// check that the grid store the correct information
while (dom2.isNext())
{
auto key = dom2.get();
auto key_g = g_dist.getGKey(key);
BOOST_REQUIRE_EQUAL(g_dist.template get<0>(key),info.LinId(key_g));
++dom2;
}
g_dist.template ghost_get<0>();
// check that the communication is correctly completed
auto domg = g_dist.getDomainGhostIterator();
// check that the grid with the ghost past store the correct information
while (domg.isNext())
{
auto key = domg.get();
auto key_g = g_dist.getGKey(key);
// In this case the boundary condition are non periodic
if (g_dist.isInside(key_g))
{
if (g_dist.template get<0>(key) != info.LinId(key_g))
{
int debug = 0;
debug++;
}
BOOST_REQUIRE_EQUAL(g_dist.template get<0>(key),info.LinId(key_g));
}
++domg;
}
}
}
BOOST_AUTO_TEST_CASE( grid_dist_id_iterator_test_use)
{
// Domain
Box<2,float> domain({0.0,0.0},{1.0,1.0});
// Initialize the global VCluster
init_global_v_cluster(&boost::unit_test::framework::master_test_suite().argc,&boost::unit_test::framework::master_test_suite().argv);
long int k = 1024*1024*global_v_cluster->getProcessingUnits();
k = std::pow(k, 1/2.);
Test2D(domain,k);
// Domain
Box<3,float> domain3({0.0,0.0,0.0},{1.0,1.0,1.0});
k = 128*128*128*global_v_cluster->getProcessingUnits();
k = std::pow(k, 1/3.);
Test3D(domain3,k);
// 3D test
// g_dist.write("");
/* auto g_it = g_dist.getIteratorBulk();
......
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