Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dune-alugrid
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
3
Issues
3
List
Boards
Labels
Service Desk
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
extensions
dune-alugrid
Commits
6919cf0b
Commit
6919cf0b
authored
Nov 24, 2020
by
Robert K
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/python-mpi-comm' into 'master'
Cleanup mix of default mpi communicators. See merge request
!107
parents
31573248
1a55811e
Pipeline
#31399
passed with stage
in 30 minutes
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
16 deletions
+41
-16
dune/alugrid/common/declaration.hh
dune/alugrid/common/declaration.hh
+4
-0
dune/alugrid/dgf.hh
dune/alugrid/dgf.hh
+18
-8
dune/alugrid/impl/parallel/mpAccess_MPI.h
dune/alugrid/impl/parallel/mpAccess_MPI.h
+7
-0
python/dune/alugrid/_grids.py
python/dune/alugrid/_grids.py
+12
-8
No files found.
dune/alugrid/common/declaration.hh
View file @
6919cf0b
...
...
@@ -32,6 +32,10 @@ namespace Dune
No_Comm
noComm_
;
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_
;
}
};
...
...
dune/alugrid/dgf.hh
View file @
6919cf0b
...
...
@@ -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
()
;
...
...
dune/alugrid/impl/parallel/mpAccess_MPI.h
View file @
6919cf0b
...
...
@@ -2,6 +2,7 @@
#define MPACCESS_MPI_H_INCLUDED
#include <memory>
#include <dune/common/parallel/communication.hh>
#include "mpAccess.h"
...
...
@@ -58,6 +59,12 @@ namespace ALUGrid
public
:
// constructor taking MPI_Comm
explicit
MpAccessMPI
(
MPI_Comm
mpicomm
)
;
// constructor taking Dune::No_Comm and creating MpAccessMPI with MPI_COMM_SELF
explicit
MpAccessMPI
(
const
Dune
::
No_Comm
&
)
:
MpAccessMPI
(
MPI_COMM_SELF
)
{}
// copy constructor
MpAccessMPI
(
const
MpAccessMPI
&
);
// destructor
...
...
python/dune/alugrid/_grids.py
View file @
6919cf0b
...
...
@@ -9,7 +9,7 @@ from dune.common.checkconfiguration import assertHave, ConfigurationError
try
:
assertHave
(
"HAVE_DUNE_ALUGRID"
)
def
aluGrid
(
constructor
,
dimgrid
=
None
,
dimworld
=
None
,
elementType
=
None
,
serial
=
False
,
**
parameters
):
def
aluGrid
(
constructor
,
dimgrid
=
None
,
dimworld
=
None
,
elementType
=
None
,
comm
=
None
,
serial
=
False
,
**
parameters
):
from
dune.grid.grid_generator
import
module
,
getDimgrid
if
not
dimgrid
:
...
...
@@ -42,19 +42,23 @@ try:
includes
=
[
"dune/alugrid/grid.hh"
,
"dune/alugrid/dgf.hh"
]
gridModule
=
module
(
includes
,
typeName
)
return
gridModule
.
LeafGrid
(
gridModule
.
reader
(
constructor
))
if
comm
is
not
None
:
raise
Exception
(
"Passing communicator to grid construction is not yet implemented in Python bindings of dune-grid"
)
return
gridModule
.
LeafGrid
(
gridModule
.
reader
(
constructor
,
comm
))
else
:
return
gridModule
.
LeafGrid
(
gridModule
.
reader
(
constructor
))
def
aluConformGrid
(
constructor
,
dimgrid
=
None
,
dimworld
=
None
,
serial
=
False
,
**
parameters
):
return
aluGrid
(
constructor
,
dimgrid
,
dimworld
,
elementType
=
"Dune::simplex"
,
refinement
=
"Dune::conforming"
,
serial
=
serial
)
def
aluConformGrid
(
constructor
,
dimgrid
=
None
,
dimworld
=
None
,
comm
=
None
,
serial
=
False
,
**
parameters
):
return
aluGrid
(
constructor
,
dimgrid
,
dimworld
,
elementType
=
"Dune::simplex"
,
refinement
=
"Dune::conforming"
,
comm
=
comm
,
serial
=
serial
)
def
aluCubeGrid
(
constructor
,
dimgrid
=
None
,
dimworld
=
None
,
serial
=
False
,
**
parameters
):
return
aluGrid
(
constructor
,
dimgrid
,
dimworld
,
elementType
=
"Dune::cube"
,
refinement
=
"Dune::nonconforming"
,
serial
=
serial
)
def
aluCubeGrid
(
constructor
,
dimgrid
=
None
,
dimworld
=
None
,
comm
=
None
,
serial
=
False
,
**
parameters
):
return
aluGrid
(
constructor
,
dimgrid
,
dimworld
,
elementType
=
"Dune::cube"
,
refinement
=
"Dune::nonconforming"
,
comm
=
comm
,
serial
=
serial
)
def
aluSimplexGrid
(
constructor
,
dimgrid
=
None
,
dimworld
=
None
,
serial
=
False
,
**
parameters
):
return
aluGrid
(
constructor
,
dimgrid
,
dimworld
,
elementType
=
"Dune::simplex"
,
refinement
=
"Dune::nonconforming"
,
serial
=
serial
)
def
aluSimplexGrid
(
constructor
,
dimgrid
=
None
,
dimworld
=
None
,
comm
=
None
,
serial
=
False
,
**
parameters
):
return
aluGrid
(
constructor
,
dimgrid
,
dimworld
,
elementType
=
"Dune::simplex"
,
refinement
=
"Dune::nonconforming"
,
comm
=
comm
,
serial
=
serial
)
grid_registry
=
{
"ALU"
:
aluGrid
,
...
...
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