Commit d93e4a34 authored by Pietro Incardona's avatar Pietro Incardona
Browse files

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;
......
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