Commit 7749ac5f authored by incardon's avatar incardon

Fixing MPI_Init and MPI_Finalize position

parent 4a06f580
......@@ -18,6 +18,7 @@ void init_global_v_cluster(int *argc, char ***argv)
class init_glob_v_cluster
{
public:
~init_glob_v_cluster()
{
delete global_v_cluster;
......@@ -26,5 +27,3 @@ public:
// Deallocate at the end
init_glob_v_cluster v_cls;
bool global_mpi_initialization = false;
......@@ -58,9 +58,6 @@ class exec_exception: public std::exception
}
};
// Flag that define the mpi initialization
extern bool global_mpi_initialization;
/*! \brief This class is virtualize the cluster as a set of processing unit
* and communication unit
*
......@@ -128,18 +125,11 @@ public:
// Finalize the MPI program
~Vcluster()
{
MPI_Finalize();
}
//! \brief Virtual cluster constructor
Vcluster(int *argc, char ***argv)
{
// Initialize MPI
if (global_mpi_initialization == false)
{
MPI_Init(argc,argv);
global_mpi_initialization = true;
}
//! Get the total number of process
//! and the rank of this process
......
#include "config.h"
#define BOOST_TEST_MODULE "C++ test module for OpenFPM_vcluster project"
#include <boost/test/included/unit_test.hpp>
#include "VCluster.hpp"
struct MPIFixture {
MPIFixture() { MPI_Init(&boost::unit_test::framework::master_test_suite().argc,&boost::unit_test::framework::master_test_suite().argv);}
~MPIFixture() { MPI_Finalize(); }
};
BOOST_GLOBAL_FIXTURE(MPIFixture);
#include "VCluster_unit_tests.hpp"
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