Skip to content
Snippets Groups Projects
Commit 7606237c authored by Robert K's avatar Robert K
Browse files

[bugfix][DGF] change constructor argument to Comm to get correct default

value for MPI_Comm.
parent 8b1ad2cf
No related branches found
No related tags found
No related merge requests found
......@@ -33,6 +33,7 @@ namespace Dune
ALUGridNoComm() : noComm_() {}
ALUGridNoComm( const No_Comm& comm ) : noComm_( comm ) {}
#if ALU3DGRID_PARALLEL
ALUGridNoComm( MPI_Comm comm ) : noComm_() {}
operator MPI_Comm () const { return MPI_COMM_SELF; }
#endif
operator No_Comm () const { return noComm_; }
......
......@@ -322,19 +322,19 @@ namespace Dune
testfile.close();
return true;
}
static int rank( MPICommunicatorType MPICOMM )
static int rank( MPICommunicatorType mpiComm )
{
int rank = 0;
#if HAVE_MPI
MPI_Comm_rank( MPICOMM, &rank );
MPI_Comm_rank( mpiComm, &rank );
#endif
return rank;
}
static int size( MPICommunicatorType MPICOMM )
static int size( MPICommunicatorType mpiComm )
{
int size = 1;
#if HAVE_MPI
MPI_Comm_size( MPICOMM, &size );
MPI_Comm_size( mpiComm, &size );
#endif
return size;
}
......@@ -355,8 +355,18 @@ namespace Dune
using BaseType :: callDirectly;
public:
explicit DGFGridFactory ( std::istream &input,
MPICommunicatorType comm = MPIHelper::getCommunicator() )
: BaseType( comm )
MPICommunicatorType mpiComm )
: DGFGridFactory( input, Comm(mpiComm) )
{}
explicit DGFGridFactory ( const std::string &filename,
MPICommunicatorType mpiComm )
: DGFGridFactory( filename, Comm(mpiComm) )
{}
DGFGridFactory ( std::istream &input,
Comm comm = Comm() ) // casts from and to MPI_Comm
: BaseType( MPICommunicatorType(comm) )
{
input.clear();
input.seekg( 0 );
......@@ -366,8 +376,8 @@ namespace Dune
}
explicit DGFGridFactory ( const std::string &filename,
MPICommunicatorType comm = MPIHelper::getCommunicator())
: BaseType( comm )
Comm comm = Comm() ) // casts from and to MPI_Comm
: BaseType( MPICommunicatorType(comm) )
{
std::ifstream input( filename.c_str() );
bool fileFound = input.is_open() ;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment