Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Sbalzarini Lab
S
Software
P
Parallel Computing
OpenFPM
openfpm_vcluster
Commits
7749ac5f
Commit
7749ac5f
authored
May 25, 2015
by
incardon
Browse files
Fixing MPI_Init and MPI_Finalize position
parent
4a06f580
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/VCluster.cpp
View file @
7749ac5f
...
...
@@ -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
;
src/VCluster.hpp
View file @
7749ac5f
...
...
@@ -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
...
...
src/main.cpp
View file @
7749ac5f
#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"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment