Commit d93e4a34 authored by Pietro Incardona's avatar Pietro Incardona

Changing vcluster initialization

parent 7e9feabe
# Change Log
All notable changes to this project will be documented in this file.
## [0.3.0] -
### Added
- Nothing to report
### Fixed
- Nothing to report
### Changed
- Eliminated global_v_cluster, init_global_v_cluster, delete_global_v_cluster,
substituted by
create_vcluster, openfpm_init, openfpm_delete
## [0.2.1] -
### Changed
......
......@@ -66,6 +66,11 @@ then
module load gcc/4.9.2
./install -s -c "--prefix=/home/jenkins/openfpm_install"
make
if [ $? -ne 0 ]; then
curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\" , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
exit 1 ;
fi
make install
if [ $? -ne 0 ]; then
......@@ -261,6 +266,11 @@ else
echo "Compiling general"
source ~/.bashrc
./install -s
make
if [ $? -ne 0 ]; then
curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\" , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
exit 1 ;
fi
mpirun -np 1 ./src/pdata
if [ $? -ne 0 ]; then
......
......@@ -54,7 +54,7 @@ int main(int argc, char* argv[])
// * domain: where the grid is defined
// * g: ghost extension
//
grid_dist_id<3, float, aggregate<float[3]>, CartDecomposition<3,float>> g_dist(sz,domain,g);
grid_dist_id<3, float, aggregate<float[3]>> g_dist(sz,domain,g);
// ### WIKI 5 ###
//
......
......@@ -70,7 +70,7 @@ int main(int argc, char* argv[])
// * domain: where the grid is defined
// * g: ghost extension
//
grid_dist_id<3, float, grid_point, CartDecomposition<3,float>> g_dist(sz,domain,g);
grid_dist_id<3, float, grid_point> g_dist(sz,domain,g);
// ### WIKI 5 ###
//
......
......@@ -68,7 +68,6 @@ int main(int argc, char* argv[])
// * Type of the space, float (2° template parameters)
// * Information stored by each object (3* template parameters), in this case a Point_test store 4 scalars
// 1 vector and an asymmetric tensor of rank 2
// * Strategy used to decompose the space
//
// Constructor instead require:
//
......@@ -79,7 +78,7 @@ int main(int argc, char* argv[])
// objects with an undefined position in space. This non-space decomposition is also called data-driven
// decomposition
//
vector_dist<2,float, Particle<float>, CartDecomposition<2,float> > vd(4096,domain,bc,g);
vector_dist<2,float, Particle<float> > vd(4096,domain,bc,g);
//
// ### WIKI 5 ###
......
......@@ -43,7 +43,7 @@ int main(int argc, char* argv[])
// scalar double, a vector double[3], and a tensor or rank 2 double[3][3].
// In this case the vector contain 0 particles in total
//
vector_dist<3,float, aggregate<double,double[3],double[3][3]>, CartDecomposition<3,float> > vd(0,box,bc,ghost);
vector_dist<3,float, aggregate<double,double[3],double[3][3]> > vd(0,box,bc,ghost);
//
// ### WIKI 4 ###
......
......@@ -42,7 +42,7 @@ int main(int argc, char* argv[])
// scalar double, a vector double[3], and a tensor or rank 2 double[3][3].
// In this case the vector contain 0 particles in total
//
vector_dist<3,float, aggregate<double,double[3],double[3][3]>, CartDecomposition<3,float> > vd(0,box,bc,ghost);
vector_dist<3,float, aggregate<double,double[3],double[3][3]> > vd(0,box,bc,ghost);
//
// ### WIKI 4 ###
......
......@@ -10,10 +10,10 @@
int main(int argc, char ** argv)
{
// Initialize the global VCluster
init_global_v_cluster(&argc,&argv);
openfpm_init(&argc,&argv);
// Vcluster
Vcluster & vcl = *global_v_cluster;
Vcluster & vcl = create_vcluster();
//! [Create CartDecomposition vtk gen]
CartDecomposition<2,float> dec(vcl);
......@@ -42,6 +42,7 @@ int main(int argc, char ** argv)
//! [Create CartDecomposition]
delete &vcl;
// deinitialize the library
openfpm_finalize();
}
......@@ -24,8 +24,8 @@ int main(int argc, char* argv[])
// Here we Initialize the library, than we create a uniform random generator between 0 and 1 to to generate particles
// randomly in the domain, we create a Box that define our domain, boundary conditions, and ghost
//
init_global_v_cluster(&argc,&argv);
Vcluster & v_cl = *global_v_cluster;
openfpm_init(&argc,&argv);
Vcluster & v_cl = create_vcluster();
typedef Point<2,float> s;
......@@ -90,5 +90,5 @@ int main(int argc, char* argv[])
vd.write("Vector/vector_move",i);
}
delete_global_v_cluster();
openfpm_finalize();
}
openfpm_io @ d07c3c78
Subproject commit b5dbab02939cabadaa8ffc398a672dd2d13f9ae4
Subproject commit d07c3c7848e446437526d0bbda0843c18ab6a925
openfpm_numerics @ f94c71e6
Subproject commit 48eca62b3223c084608e4ac031cc70a15d8ba977
Subproject commit f94c71e644d0e7a36c86185174da186a2b352b3b
openfpm_vcluster @ 02c93554
Subproject commit 2eb8e4318e89a14d7891ee1af6723175fc856476
Subproject commit 02c935545524000d318f0b84578af704896eeee4
......@@ -55,10 +55,7 @@ void setComputationCosts3D(CartDecomposition<3, float> &dec, size_t n_v, Point<3
BOOST_AUTO_TEST_CASE( CartDecomposition_non_periodic_test)
{
// Vcluster
Vcluster & vcl = *global_v_cluster;
// Initialize the global VCluster
init_global_v_cluster(&boost::unit_test::framework::master_test_suite().argc,&boost::unit_test::framework::master_test_suite().argv);
Vcluster & vcl = create_vcluster();
//! [Create CartDecomposition]
CartDecomposition<3, float> dec(vcl);
......@@ -150,10 +147,7 @@ BOOST_AUTO_TEST_CASE( CartDecomposition_non_periodic_test)
BOOST_AUTO_TEST_CASE( CartDecomposition_periodic_test)
{
// Vcluster
Vcluster & vcl = *global_v_cluster;
// Initialize the global VCluster
init_global_v_cluster(&boost::unit_test::framework::master_test_suite().argc,&boost::unit_test::framework::master_test_suite().argv);
Vcluster & vcl = create_vcluster();
//! [Create CartDecomposition]
CartDecomposition<3, float> dec(vcl);
......@@ -248,10 +242,7 @@ BOOST_AUTO_TEST_CASE( CartDecomposition_periodic_test)
BOOST_AUTO_TEST_CASE( CartDecomposition_ext_non_periodic_test)
{
// Vcluster
Vcluster & vcl = *global_v_cluster;
// Initialize the global VCluster
init_global_v_cluster(&boost::unit_test::framework::master_test_suite().argc,&boost::unit_test::framework::master_test_suite().argv);
Vcluster & vcl = create_vcluster();
//! [Create CartDecomposition]
CartDecomposition<3,float> dec(vcl);
......
......@@ -57,7 +57,7 @@ BOOST_AUTO_TEST_SUITE (Distribution_test)
BOOST_AUTO_TEST_CASE( Metis_distribution_test)
{
Vcluster & v_cl = *global_v_cluster;
Vcluster & v_cl = create_vcluster();
if (v_cl.getProcessingUnits() != 3)
return;
......@@ -166,7 +166,7 @@ BOOST_AUTO_TEST_CASE( Metis_distribution_test)
BOOST_AUTO_TEST_CASE( Parmetis_distribution_test)
{
Vcluster & v_cl = *global_v_cluster;
Vcluster & v_cl = create_vcluster();
if (v_cl.getProcessingUnits() != 3)
return;
......@@ -267,7 +267,7 @@ BOOST_AUTO_TEST_CASE( Parmetis_distribution_test)
BOOST_AUTO_TEST_CASE( DistParmetis_distribution_test)
{
Vcluster & v_cl = *global_v_cluster;
Vcluster & v_cl = create_vcluster();
if (v_cl.getProcessingUnits() != 3)
return;
......@@ -365,7 +365,7 @@ BOOST_AUTO_TEST_CASE( DistParmetis_distribution_test)
void print_test_v(std::string test, size_t sz)
{
if (global_v_cluster->getProcessUnitID() == 0)
if (create_vcluster().getProcessUnitID() == 0)
std::cout << test << " " << sz << "\n";
}
......
......@@ -25,7 +25,7 @@ BOOST_AUTO_TEST_SUITE( Metis_test )
BOOST_AUTO_TEST_CASE( Metis_test_use)
{
Vcluster & v_cl = *global_v_cluster;
Vcluster & v_cl = create_vcluster();
if (v_cl.getProcessingUnits() != 3)
return;
......
......@@ -264,7 +264,7 @@ public:
*
*/
ORB(Box dom, size_t n_sub, loc_pos & lp)
:v_cl(*global_v_cluster),lp(lp)
:v_cl(create_vcluster()),lp(lp)
{
typedef ORB<dim,T,loc_wg,loc_pos,Box,Tree> ORB_class;
......
......@@ -17,12 +17,9 @@ BOOST_AUTO_TEST_SUITE( ORB_test )
BOOST_AUTO_TEST_CASE( ORB_test_use)
{
// Initialize the global VCluster
init_global_v_cluster(&boost::unit_test::framework::master_test_suite().argc,&boost::unit_test::framework::master_test_suite().argv);
// set the seed
// create the random generator engine
std::srand(global_v_cluster->getProcessUnitID());
std::srand(create_vcluster().getProcessUnitID());
std::default_random_engine eg;
std::uniform_real_distribution<float> ud(0.0f, 1.0f);
......
......@@ -240,7 +240,7 @@ public:
//! Construct Cartesian graph
static Graph construct(const size_t (&sz)[dim], Box<dim, T> dom)
{
Vcluster &v_cl = *global_v_cluster;
Vcluster &v_cl = create_vcluster();
// Calculate the size of the hyper-cubes on each dimension
T szd[dim];
......@@ -394,7 +394,7 @@ public:
//! Construct Cartesian graph
static Graph construct(const size_t (&sz)[dim], Box<dim, T> dom)
{
Vcluster &v_cl = *global_v_cluster;
Vcluster &v_cl = create_vcluster();
// Calculate the size of the hyper-cubes on each dimension
......
......@@ -1015,7 +1015,7 @@ public:
*
*/
DistGraph_CSR(const DistGraph_CSR & dg) :
vcl(*global_v_cluster)
vcl(create_vcluster())
{
this->operator=(dg);
}
......@@ -1026,7 +1026,7 @@ public:
*
*/
DistGraph_CSR(DistGraph_CSR && dg) :
vcl(*global_v_cluster)
vcl(create_vcluster())
{
this->operator=(dg);
}
......@@ -1057,7 +1057,7 @@ public:
*
*/
DistGraph_CSR(size_t n_vertex, size_t n_slot) :
vcl(*global_v_cluster), v_slot(n_slot)
vcl(create_vcluster()), v_slot(n_slot)
{
// Creating n_vertex into the graph
v.resize(n_vertex);
......
......@@ -127,10 +127,7 @@ BOOST_AUTO_TEST_CASE( dist_map_graph_use)
{
//! Vcluster
Vcluster & vcl = *global_v_cluster;
//! Initialize the global VCluster
init_global_v_cluster(&boost::unit_test::framework::master_test_suite().argc,&boost::unit_test::framework::master_test_suite().argv);
Vcluster & vcl = create_vcluster();
if(vcl.getProcessingUnits() != 4)
return;
......@@ -244,14 +241,11 @@ BOOST_AUTO_TEST_CASE( dist_map_graph_use)
BOOST_AUTO_TEST_CASE( dist_map_graph_use_redistribution)
{
//! Vcluster
Vcluster & vcl = *global_v_cluster;
Vcluster & vcl = create_vcluster();
if(vcl.getProcessingUnits() != 4)
return;
//! Initialize the global VCluster
init_global_v_cluster(&boost::unit_test::framework::master_test_suite().argc,&boost::unit_test::framework::master_test_suite().argv);
//! Cartesian grid
size_t sz[2] = { 4, 4 };
......@@ -330,14 +324,11 @@ BOOST_AUTO_TEST_CASE( dist_map_graph_use_redistribution)
BOOST_AUTO_TEST_CASE( dist_map_graph_use_free_add)
{
// Vcluster
Vcluster & vcl = *global_v_cluster;
Vcluster & vcl = create_vcluster();
if(vcl.getProcessingUnits() != 4)
return;
// Initialize the global VCluster
init_global_v_cluster(&boost::unit_test::framework::master_test_suite().argc,&boost::unit_test::framework::master_test_suite().argv);
// [create graph adding freely the vertices and the edges ]
// Distributed graph
......@@ -489,14 +480,11 @@ BOOST_AUTO_TEST_CASE( dist_map_graph_use_free_add)
BOOST_AUTO_TEST_CASE( dist_map_graph_use_multi_free_add)
{
// Vcluster
Vcluster & vcl = *global_v_cluster;
Vcluster & vcl = create_vcluster();
if(vcl.getProcessingUnits() != 4)
return;
// Initialize the global VCluster
init_global_v_cluster(&boost::unit_test::framework::master_test_suite().argc, &boost::unit_test::framework::master_test_suite().argv);
// Distributed graph
DistGraph_CSR<vx, ed> gd;
......
......@@ -17,6 +17,7 @@
#include "VTKWriter/VTKWriter.hpp"
#include "Packer_Unpacker/Packer.hpp"
#include "Packer_Unpacker/Unpacker.hpp"
#include "Decomposition/CartDecomposition.hpp"
#define GRID_SUB_UNIT_FACTOR 64
......@@ -47,7 +48,7 @@
* \snippet grid_dist_id_unit_test.hpp Construct two grid with the same decomposition
*
*/
template<unsigned int dim, typename St, typename T, typename Decomposition,typename Memory=HeapMemory , typename device_grid=grid_cpu<dim,T> >
template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>,typename Memory=HeapMemory , typename device_grid=grid_cpu<dim,T> >
class grid_dist_id
{
// Domain
......@@ -629,7 +630,7 @@ public:
*
*/
template<typename H> grid_dist_id(const grid_dist_id<dim,St,H,typename Decomposition::base_type,Memory,grid_cpu<dim,H>> & g, const Ghost<dim,long int> & gh, Box<dim,size_t> ext)
:dec(*global_v_cluster),v_cl(*global_v_cluster)
:dec(create_vcluster()),v_cl(create_vcluster())
{
#ifdef SE_CLASS2
check_new(this,8,GRID_DIST_EVENT,4);
......@@ -672,7 +673,7 @@ public:
*
*/
grid_dist_id(const Decomposition & dec, const size_t (& g_sz)[dim], const Box<dim,St> & domain, const Ghost<dim,St> & ghost)
:domain(domain),ghost(ghost),dec(dec),v_cl(*global_v_cluster),ginfo(g_sz),ginfo_v(g_sz)
:domain(domain),ghost(ghost),dec(dec),v_cl(create_vcluster()),ginfo(g_sz),ginfo_v(g_sz)
{
// Increment the reference counter of the decomposition
this->dec.incRef();
......@@ -690,7 +691,7 @@ public:
*
*/
grid_dist_id(Decomposition && dec, const size_t (& g_sz)[dim], const Box<dim,St> & domain, const Ghost<dim,St> & ghost)
:domain(domain),ghost(ghost),dec(dec),ginfo(g_sz),ginfo_v(g_sz),v_cl(*global_v_cluster)
:domain(domain),ghost(ghost),dec(dec),ginfo(g_sz),ginfo_v(g_sz),v_cl(create_vcluster())
{
#ifdef SE_CLASS2
check_new(this,8,GRID_DIST_EVENT,4);
......@@ -711,7 +712,7 @@ public:
*
*/
grid_dist_id(const Decomposition & dec, const size_t (& g_sz)[dim],const Box<dim,St> & domain, const Ghost<dim,long int> & g)
:domain(domain),dec(*global_v_cluster),v_cl(*global_v_cluster),ginfo(g_sz),ginfo_v(g_sz)
:domain(domain),dec(create_vcluster()),v_cl(create_vcluster()),ginfo(g_sz),ginfo_v(g_sz)
{
#ifdef SE_CLASS2
check_new(this,8,GRID_DIST_EVENT,4);
......@@ -737,7 +738,7 @@ public:
*
*/
grid_dist_id(Decomposition && dec, const size_t (& g_sz)[dim],const Box<dim,St> & domain, const Ghost<dim,long int> & g)
:domain(domain),dec(dec),v_cl(*global_v_cluster),ginfo(g_sz),ginfo_v(g_sz)
:domain(domain),dec(dec),v_cl(create_vcluster()),ginfo(g_sz),ginfo_v(g_sz)
{
#ifdef SE_CLASS2
check_new(this,8,GRID_DIST_EVENT,4);
......@@ -760,7 +761,7 @@ public:
*
*/
grid_dist_id(const size_t (& g_sz)[dim],const Box<dim,St> & domain, const Ghost<dim,St> & g)
:domain(domain),ghost(g),dec(*global_v_cluster),v_cl(*global_v_cluster),ginfo(g_sz),ginfo_v(g_sz)
:domain(domain),ghost(g),dec(create_vcluster()),v_cl(create_vcluster()),ginfo(g_sz),ginfo_v(g_sz)
{
#ifdef SE_CLASS2
check_new(this,8,GRID_DIST_EVENT,4);
......@@ -784,7 +785,7 @@ public:
*
*/
grid_dist_id(const size_t (& g_sz)[dim],const Box<dim,St> & domain, const Ghost<dim,long int> & g)
:domain(domain),dec(*global_v_cluster),v_cl(*global_v_cluster),ginfo(g_sz),ginfo_v(g_sz)
:domain(domain),dec(create_vcluster()),v_cl(create_vcluster()),ginfo(g_sz),ginfo_v(g_sz)
{
#ifdef SE_CLASS2
check_new(this,8,GRID_DIST_EVENT,4);
......
This diff is collapsed.
......@@ -18,7 +18,7 @@ void Test3D_extended_grid(const Box<3,float> & domain, long int k)
big_step = (big_step == 0)?1:big_step;
long int small_step = 21;
Vcluster & v_cl = *global_v_cluster;
Vcluster & v_cl = create_vcluster();
if ( v_cl.getProcessingUnits() > 32 )
return;
......@@ -26,7 +26,7 @@ void Test3D_extended_grid(const Box<3,float> & domain, long int k)
print_test( "Testing 3D extended grid k<=",k);
// factor
float factor = pow(global_v_cluster->getProcessingUnits()/2.0f,1.0f/3.0f);
float factor = pow(create_vcluster().getProcessingUnits()/2.0f,1.0f/3.0f);
// This test in order to work must have at least one ghost
for ( ; (0.01 / factor) > (domain.getHigh(0) - domain.getLow(0) / k) ; k-= (k > 2*big_step)?big_step:small_step )
......
......@@ -25,6 +25,7 @@
#include "Decomposition/common.hpp"
#include "Grid/grid_dist_id_iterator_dec.hpp"
#include "Vector/vector_dist_ofb.hpp"
#include "Decomposition/CartDecomposition.hpp"
#define V_SUB_UNIT_FACTOR 64
......@@ -67,7 +68,7 @@
*
*/
template<unsigned int dim, typename St, typename prop, typename Decomposition, typename Memory = HeapMemory>
template<unsigned int dim, typename St, typename prop, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory>
class vector_dist
{
private:
......@@ -654,7 +655,7 @@ public:
*
*/
vector_dist(size_t np, Box<dim, St> box, const size_t (&bc)[dim], const Ghost<dim, St> & g) :
dec(*global_v_cluster), v_cl(*global_v_cluster)
dec(create_vcluster()), v_cl(create_vcluster())
{
#ifdef SE_CLASS2
check_new(this,8,VECTOR_DIST_EVENT,4);
......
......@@ -94,14 +94,14 @@ BOOST_AUTO_TEST_SUITE( vector_dist_test )
void print_test(std::string test, size_t sz)
{
if (global_v_cluster->getProcessUnitID() == 0)
if (create_vcluster().getProcessUnitID() == 0)
std::cout << test << " " << sz << "\n";
}
BOOST_AUTO_TEST_CASE( vector_dist_ghost )
{
// Communication object
Vcluster & v_cl = *global_v_cluster;
Vcluster & v_cl = create_vcluster();
typedef Point_test<float> p;
typedef Point<2,float> s;
......@@ -149,7 +149,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_ghost )
size_t bc[2]={NON_PERIODIC,NON_PERIODIC};
// Vector of particles
vector_dist<2,float, Point_test<float>, CartDecomposition<2,float> > vd(g_info.size(),box,bc,g);
vector_dist<2,float, Point_test<float> > vd(g_info.size(),box,bc,g);
// size_t
size_t cobj = 0;
......@@ -272,7 +272,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_ghost )
void print_test_v(std::string test, size_t sz)
{
if (global_v_cluster->getProcessUnitID() == 0)
if (create_vcluster().getProcessUnitID() == 0)
std::cout << test << " " << sz << "\n";
}
......@@ -294,7 +294,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_iterator_test_use_2d )
{
typedef Point<2,float> s;
Vcluster & v_cl = *global_v_cluster;
Vcluster & v_cl = create_vcluster();
// set the seed
// create the random generator engine
......@@ -321,7 +321,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_iterator_test_use_2d )
// Boundary conditions
size_t bc[2]={NON_PERIODIC,NON_PERIODIC};
vector_dist<2,float, Point_test<float>, CartDecomposition<2,float> > vd(k,box,bc,Ghost<2,float>(0.0));
vector_dist<2,float, Point_test<float> > vd(k,box,bc,Ghost<2,float>(0.0));
auto it = vd.getIterator();
......@@ -367,7 +367,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_iterator_test_use_3d )
{
typedef Point<3,float> s;
Vcluster & v_cl = *global_v_cluster;
Vcluster & v_cl = create_vcluster();
// set the seed
// create the random generator engine
......@@ -394,7 +394,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_iterator_test_use_3d )
// Boundary conditions
size_t bc[3]={NON_PERIODIC,NON_PERIODIC,NON_PERIODIC};
vector_dist<3,float, Point_test<float>, CartDecomposition<3,float> > vd(k,box,bc,Ghost<3,float>(0.0));
vector_dist<3,float, Point_test<float> > vd(k,box,bc,Ghost<3,float>(0.0));
auto it = vd.getIterator();
......@@ -441,7 +441,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_periodic_test_use_2d )
{
typedef Point<2,float> s;
Vcluster & v_cl = *global_v_cluster;
Vcluster & v_cl = create_vcluster();
// set the seed
// create the random generator engine
......@@ -469,7 +469,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_periodic_test_use_2d )
size_t bc[2]={PERIODIC,PERIODIC};
// factor
float factor = pow(global_v_cluster->getProcessingUnits()/2.0f,1.0f/3.0f);
float factor = pow(create_vcluster().getProcessingUnits()/2.0f,1.0f/3.0f);
// ghost
Ghost<2,float> ghost(0.01 / factor);
......@@ -551,7 +551,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_periodic_test_use_3d )
{
typedef Point<3,float> s;
Vcluster & v_cl = *global_v_cluster;
Vcluster & v_cl = create_vcluster();
// set the seed
// create the random generator engine
......@@ -579,7 +579,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_periodic_test_use_3d )
size_t bc[3]={PERIODIC,PERIODIC,PERIODIC};
// factor
float factor = pow(global_v_cluster->getProcessingUnits()/2.0f,1.0f/3.0f);
float factor = pow(create_vcluster().getProcessingUnits()/2.0f,1.0f/3.0f);
// ghost
Ghost<3,float> ghost(0.05 / factor);
......@@ -659,7 +659,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_periodic_test_random_walk )
{
typedef Point<3,float> s;
Vcluster & v_cl = *global_v_cluster;
Vcluster & v_cl = create_vcluster();
// set the seed
// create the random generator engine
......@@ -685,7 +685,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_periodic_test_random_walk )
size_t bc[3]={PERIODIC,PERIODIC,PERIODIC};
// factor
float factor = pow(global_v_cluster->getProcessingUnits()/2.0f,1.0f/3.0f);
float factor = pow(create_vcluster().getProcessingUnits()/2.0f,1.0f/3.0f);
// ghost
Ghost<3,float> ghost(0.01 / factor);
......@@ -747,7 +747,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_periodic_map )
size_t bc[3]={PERIODIC,PERIODIC,PERIODIC};
// factor
float factor = pow(global_v_cluster->getProcessingUnits()/2.0f,1.0f/3.0f);
float factor = pow(create_vcluster().getProcessingUnits()/2.0f,1.0f/3.0f);
// ghost
Ghost<3,float> ghost(0.05 / factor);
......@@ -799,7 +799,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_not_periodic_map )
size_t bc[3]={NON_PERIODIC,NON_PERIODIC,NON_PERIODIC};
// factor
float factor = pow(global_v_cluster->getProcessingUnits()/2.0f,1.0f/3.0f);
float factor = pow(create_vcluster().getProcessingUnits()/2.0f,1.0f/3.0f);
// ghost
Ghost<3,float> ghost(0.05 / factor);
......@@ -843,7 +843,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_not_periodic_map )
BOOST_AUTO_TEST_CASE( vector_dist_out_of_bound_policy )
{
Vcluster & v_cl = *global_v_cluster;
Vcluster & v_cl = create_vcluster();
if (v_cl.getProcessingUnits() > 8)
return;
......@@ -856,7 +856,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_out_of_bound_policy )
size_t bc[3]={NON_PERIODIC,NON_PERIODIC,NON_PERIODIC};
// factor
float factor = pow(global_v_cluster->getProcessingUnits()/2.0f,1.0f/3.0f);
float factor = pow(create_vcluster().getProcessingUnits()/2.0f,1.0f/3.0f);
// ghost
Ghost<3,float> ghost(0.05 / factor);
......@@ -908,7 +908,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_periodic_test_interacting_particles )
typedef Point<3,float> s;
Vcluster & v_cl = *global_v_cluster;
Vcluster & v_cl = create_vcluster();
if (v_cl.getProcessingUnits() > 8)
return;
......@@ -937,7 +937,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_periodic_test_interacting_particles )
size_t bc[3]={PERIODIC,PERIODIC,PERIODIC};
// factor
float factor = pow(global_v_cluster->getProcessingUnits()/2.0f,1.0f/3.0f);
float factor = pow(create_vcluster().getProcessingUnits()/2.0f,1.0f/3.0f);
// interaction radius
float r_cut = 0.01 / factor;
......@@ -1040,7 +1040,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_periodic_test_interacting_particles )
BOOST_AUTO_TEST_CASE( vector_dist_cell_verlet_test )
{
long int k = 64*64*64*global_v_cluster->getProcessingUnits();
long int k = 64*64*64*create_vcluster().getProcessingUnits();
k = std::pow(k, 1/3.);
long int big_step = k / 30;
......@@ -1054,7 +1054,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_cell_verlet_test )
{
typedef Point<3,float> s;
Vcluster & v_cl = *global_v_cluster;
Vcluster & v_cl = create_vcluster();
const size_t Ng = k;
......
......@@ -144,7 +144,7 @@ BOOST_AUTO_TEST_CASE( dec_optimizer_test_use_p)
BOOST_AUTO_TEST_CASE( dec_optimizer_disconnected_subdomains_np)
{
// Vcluster
Vcluster & vcl = *global_v_cluster;
Vcluster & vcl = create_vcluster();
// Test for only 3 processors
if (vcl.getProcessingUnits() > 3)
......
......@@ -11,8 +11,8 @@
#include "VCluster.hpp"
struct ut_start {
ut_start() { BOOST_TEST_MESSAGE("Initialize global VCluster"); init_global_v_cluster(&boost::unit_test::framework::master_test_suite().argc,&boost::unit_test::framework::master_test_suite().argv); }
~ut_start() { BOOST_TEST_MESSAGE("Delete global VClster");delete_global_v_cluster(); }
ut_start() { BOOST_TEST_MESSAGE("Initialize global VCluster"); openfpm_init(&boost::unit_test::framework::master_test_suite().argc,&boost::unit_test::framework::master_test_suite().argv); }
~ut_start() { BOOST_TEST_MESSAGE("Delete global VClster"); openfpm_finalize(); }
};
//____________________________________________________________________________//
......
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