Skip to content
Permalink
Browse files

Fix error check when initializing Horovod with existing mpi4py commun…

…icator. (#1391)

Signed-off-by: Josh Romero <joshr@nvidia.com>
  • Loading branch information...
romerojosh authored and tgaddair committed Sep 10, 2019
1 parent 93d1a4f commit 317c1d9e6d57a31e42c1f674dac937efc3fbc2b2
Showing with 4 additions and 3 deletions.
  1. +4 −3 horovod/common/basics.py
@@ -40,10 +40,11 @@ def init(self, comm=None):
atexit.register(self.shutdown)

if not isinstance(comm, list):
mpi_enabled = self.MPI_LIB_CTYPES.horovod_mpi_enabled()
if not bool(mpi_enabled):
mpi_built = self.MPI_LIB_CTYPES.horovod_mpi_built()
if not bool(mpi_built):
raise ValueError(
'Horovod MPI is not enabled; Please make sure it\'s installed and enabled.')
"Horovod has not been built with MPI support. Ensure MPI is installed and "
"reinstall Horovod with HOROVOD_WITH_MPI=1 to debug the build error.")

from mpi4py import MPI
if MPI._sizeof(MPI.Comm) == ctypes.sizeof(ctypes.c_int):

0 comments on commit 317c1d9

Please sign in to comment.
You can’t perform that action at this time.