Commit f94c71e6 authored by Pietro Incardona's avatar Pietro Incardona

Changing vcluster initialization

parent 48eca62b
......@@ -474,7 +474,7 @@ public:
*/
template<typename T> void impose(const T & op , typename Sys_eqs::stype num ,long int id ,grid_dist_iterator_sub<Sys_eqs::dims,typename g_map_type::d_grid> it_d, bool skip_first = false)
{
Vcluster & v_cl = *global_v_cluster;
Vcluster & v_cl = create_vcluster();
openfpm::vector<triplet> & trpl = A.getMatrixTriplets();
......
......@@ -140,7 +140,7 @@ typedef Avg<y,v_x,lid_nn,FORWARD> avg_vx_f;
BOOST_AUTO_TEST_CASE(lid_driven_cavity)
{
Vcluster & v_cl = *global_v_cluster;
Vcluster & v_cl = create_vcluster();
if (v_cl.getProcessingUnits() > 3)
return;
......@@ -169,9 +169,6 @@ BOOST_AUTO_TEST_CASE(lid_driven_cavity)
// and cannot be discussed here
Padding<2> pd({1,1},{0,0});
// Initialize openfpm
init_global_v_cluster(&boost::unit_test::framework::master_test_suite().argc,&boost::unit_test::framework::master_test_suite().argv);
// Distributed grid that store the solution
grid_dist_id<2,float,aggregate<float[2],float>,CartDecomposition<2,float>> g_dist(szu,domain,g);
......
......@@ -130,7 +130,7 @@ typedef Avg<x,v_z,lid_nn_3d,FORWARD> avg_x_vz_f;
BOOST_AUTO_TEST_CASE(lid_driven_cavity)
{
Vcluster & v_cl = *global_v_cluster;
Vcluster & v_cl = create_vcluster();
if (v_cl.getProcessingUnits() > 3)
return;
......@@ -149,9 +149,6 @@ BOOST_AUTO_TEST_CASE(lid_driven_cavity)
Padding<3> pd({1,1,1},{0,0,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);
// velocity in the grid is the property 0, pressure is the property 1
constexpr int velocity = 0;
constexpr int pressure = 1;
......
......@@ -96,7 +96,7 @@ private:
*/
void assemble()
{
Vcluster & vcl = *global_v_cluster;
Vcluster & vcl = create_vcluster();
////// On Master and only here
// we assemble the Matrix from the collected data
......@@ -116,7 +116,7 @@ private:
*/
void collect()
{
Vcluster & vcl = *global_v_cluster;
Vcluster & vcl = create_vcluster();
trpl_recv.clear();
......
......@@ -18,7 +18,7 @@ BOOST_AUTO_TEST_SUITE( sparse_matrix_test_suite )
BOOST_AUTO_TEST_CASE(sparse_matrix_eigen_parallel)
{
Vcluster & vcl = *global_v_cluster;
Vcluster & vcl = create_vcluster();
if (vcl.getProcessingUnits() != 3)
return;
......
......@@ -17,7 +17,7 @@ BOOST_AUTO_TEST_SUITE( pse_kernels_unit_tests )
BOOST_AUTO_TEST_CASE( pse_ker )
{
Vcluster & v_cl = *global_v_cluster;
Vcluster & v_cl = create_vcluster();
// This test is not made to run in parallel
if (v_cl.getProcessingUnits() > 1)
......
......@@ -46,7 +46,7 @@ public:
*/
template<typename impl> static Vector<double> solve(SparseMatrix<double,int,impl> & A, const Vector<double> & b, size_t opt = UMFPACK_NONE)
{
Vcluster & vcl = *global_v_cluster;
Vcluster & vcl = create_vcluster();
Vector<double> x;
......
......@@ -94,7 +94,7 @@ class Vector<T,Eigen::Matrix<T, Eigen::Dynamic, 1>>
*/
void collect() const
{
Vcluster & vcl = *global_v_cluster;
Vcluster & vcl = create_vcluster();
row_val_recv.clear();
......@@ -313,7 +313,7 @@ public:
void scatter()
{
row_val_recv.clear();
Vcluster & vcl = *global_v_cluster;
Vcluster & vcl = create_vcluster();
vcl.SScatter(row_val,row_val_recv,prc,sz,0);
......
......@@ -14,7 +14,7 @@ BOOST_AUTO_TEST_SUITE( vector_test_suite )
BOOST_AUTO_TEST_CASE(vector_eigen_parallel)
{
Vcluster & vcl = *global_v_cluster;
Vcluster & vcl = create_vcluster();
if (vcl.getProcessingUnits() != 3)
return;
......
......@@ -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