Skip to content

Commit

Permalink
Use Devito options for OpenMP and MPI.
Browse files Browse the repository at this point in the history
More importantly, this lift an arbitrary dependency on mpi4py in unrelated cases.
  • Loading branch information
PapyChacal committed Oct 4, 2023
1 parent a9bacf9 commit ac5dac3
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions devito/operator/xdsl_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
from devito.types import Evaluable, TimeFunction
from devito.types.mlir_types import ptr_of, f32

from mpi4py import MPI

from xdsl.printer import Printer

__all__ = ['XDSLOperator']
Expand Down Expand Up @@ -102,9 +100,10 @@ def _jit_compile(self):
#ccode = transform_devito_xdsl_string(self)
#self.ccode = ccode
with self._profiler.timer_on('jit-compile'):
is_mpi = MPI.Is_initialized()
is_mpi = self._options['mpi']
# TODO This one is less clear from what I see in self._options..
is_gpu = os.environ.get("DEVITO_PLATFORM", None) == 'nvidiaX'
is_omp = os.environ.get("DEVITO_LANGUAGE", None) == 'openmp'
is_omp = self._options['openmp']

if is_mpi and is_gpu:
raise RuntimeError("Cannot run MPI+GPU for now!")
Expand Down

0 comments on commit ac5dac3

Please sign in to comment.