Skip to content
Snippets Groups Projects
Commit c74888f2 authored by Andreas Dedner's avatar Andreas Dedner
Browse files

Merge branch '346-parallelerror-in-dune-grid-python-bindings-with-openmpi' into 'master'

Resolve "ParallelError in dune-grid Python bindings with OpenMPI"

Closes #346

See merge request core/dune-common!1280
parents bb70c2f8 f6faf141
No related branches found
No related tags found
1 merge request!1280Resolve "ParallelError in dune-grid Python bindings with OpenMPI"
Pipeline #64615 passed with warnings
Pipeline: Dune Nightly Test

#64619

    ......@@ -24,12 +24,12 @@ logging.basicConfig(format=logformat, level=loglevel)
    cmakeFlags = getCMakeFlags()
    if 'HAVE_MPI' in cmakeFlags and cmakeFlags['HAVE_MPI']:
    try:
    from mpi4py import MPI
    if MPI.COMM_WORLD.Get_rank() == 0:
    logger.debug('MPI initialized successfully')
    except ImportError:
    try:
    from mpi4py import MPI
    if MPI.COMM_WORLD.Get_rank() >= 0:
    logger.debug('MPI initialized successfully using mpi4py')
    except ImportError:
    if 'HAVE_MPI' in cmakeFlags and cmakeFlags['HAVE_MPI']:
    logger.debug('mpi4py not found but MPI used during configuration of dune-common')
    raise RuntimeError(textwrap.dedent("""
    The Dune modules were configured using MPI. For the Python bindings to work,
    ......@@ -38,11 +38,12 @@ if 'HAVE_MPI' in cmakeFlags and cmakeFlags['HAVE_MPI']:
    pip install mpi4py
    before rerunning your Dune script.
    """))
    else:
    logger.debug('dune not configured with mpi')
    from ._common import *
    from .deprecated import DeprecatedObject
    def _fieldVectorGetItem(self,index):
    try:
    return self._getitem(index)
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment