bindings/python/cntk/distributed.py: dynamic load for libmpi.so.12, same as CNTK binary links against
This commit is contained in:
Родитель
8794cb6ebf
Коммит
67b460c576
|
@ -7,13 +7,13 @@ from . import cntk_py
|
|||
from . import trainer
|
||||
from .utils import typemap
|
||||
|
||||
# Preload libmpi.so for non-Windows platform to work around MPI_Init failure bug
|
||||
# Preload libmpi.so.12 for non-Windows platform to work around MPI_Init failure bug
|
||||
# https://xrunhprof.wordpress.com/2014/11/04/an-openmpi-python-and-dlopen-issue/
|
||||
# If other OS has similar OpenMPI MPI_Init failure, add dll load to global here
|
||||
import platform
|
||||
import ctypes
|
||||
if platform.system() == 'Linux':
|
||||
ctypes.CDLL("libmpi.so", mode=ctypes.RTLD_GLOBAL)
|
||||
ctypes.CDLL("libmpi.so.12", mode=ctypes.RTLD_GLOBAL)
|
||||
|
||||
__doc__= '''\
|
||||
Distributed trainers manage trainers in distributed environment.
|
||||
|
@ -118,4 +118,4 @@ def data_parallel_distributed_trainer(communicator, use_async_buffered_parameter
|
|||
if (isinstance(communicator, QuantizedCommunicator)):
|
||||
return cntk_py.create_quantized_data_parallel_distributed_trainer(communicator, use_async_buffered_parameter_update)
|
||||
else:
|
||||
return cntk_py.create_data_parallel_distributed_trainer(communicator, use_async_buffered_parameter_update)
|
||||
return cntk_py.create_data_parallel_distributed_trainer(communicator, use_async_buffered_parameter_update)
|
||||
|
|
Загрузка…
Ссылка в новой задаче