Skip to content

Commit

Permalink
Move importing MPI where it is needed in controller
Browse files Browse the repository at this point in the history
  • Loading branch information
tsirif committed Feb 21, 2017
1 parent 73b63f6 commit 54c8a0d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions platoon/channel/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@
import posix_ipc
import zmq

try:
from mpi4py import MPI
except ImportError:
MPI = None

from ..util import (PlatoonError, mmap, launch_process,
op_to_mpi, dtype_to_mpi)

Expand Down Expand Up @@ -345,6 +340,10 @@ def _init_region_comm(self):
.. versionadded:: 0.6.0
"""
try:
from mpi4py import MPI
except ImportError:
MPI = None
if MPI is None:
raise AttributeError("mpi4py is not imported")
self._region_comm = MPI.COMM_WORLD
Expand Down

0 comments on commit 54c8a0d

Please sign in to comment.