fixed: MPI handling across all apps

we need to call mpi_init when compiled against mpi (in particular mpich)
even if running with a single node.

this fixes this across all apps in a uniform way (the dune-intended approach)
This commit is contained in:
Arne Morten Kvarving
2013-10-08 13:44:56 +02:00
parent c29aabe236
commit 24e2dff7c4
16 changed files with 147 additions and 106 deletions
+7 -2
View File
@@ -53,7 +53,13 @@
#include <sys/utsname.h>
#include <opm/upscaling/SinglePhaseUpscaler.hpp>
#include <dune/common/version.hh>
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3)
#include <dune/common/parallel/mpihelper.hh>
#else
#include <dune/common/mpihelper.hh>
#endif
using namespace std;
@@ -83,8 +89,7 @@ void usage() {
@return int
*/
int upscale(int varnum, char** vararg) {
Dune::MPIHelper& mpi=Dune::MPIHelper::instance(varnum, vararg);
mpi.rank();
Dune::MPIHelper::instance(varnum, vararg);
if (varnum == 1) { // If no arguments supplied ("upscale_perm" is the first argument)
cout << "Error: No eclipsefile provided" << endl;
usage();