def __init__(self, pkg_path, *args): full_path = util.get_extension_full_path(pkg_path, *args) self.MPI_LIB_CTYPES = ctypes.CDLL(full_path, mode=ctypes.RTLD_GLOBAL) self.Average = self.MPI_LIB_CTYPES.horovod_reduce_op_average() self.Sum = self.MPI_LIB_CTYPES.horovod_reduce_op_sum() self.Adasum = self.MPI_LIB_CTYPES.horovod_reduce_op_adasum()
def __init__(self, pkg_path, *args): full_path = util.get_extension_full_path(pkg_path, *args) self.MPI_LIB_CTYPES = ctypes.CDLL(full_path, mode=ctypes.RTLD_GLOBAL) self.Average = self.MPI_LIB_CTYPES.horovod_reduce_op_average() self.Sum = self.MPI_LIB_CTYPES.horovod_reduce_op_sum() self.Adasum = self.MPI_LIB_CTYPES.horovod_reduce_op_adasum() # These must be kept in sync with operations.cc (this might also be possible via ctypes) self.HOROVOD_PROCESS_SET_ERROR_INIT = -1 self.HOROVOD_PROCESS_SET_ERROR_DYNAMIC = -2 self.HOROVOD_PROCESS_SET_ERROR_UNKNOWN_SET = -3 self.HOROVOD_PROCESS_SET_ERROR_FOREIGN_SET = -4 self.HOROVOD_PROCESS_SET_ERROR_SHUTDOWN = -5 self.HOROVOD_PROCESS_SET_ERROR_EXISTING_SET = -6
def __init__(self, pkg_path, *args): full_path = util.get_extension_full_path(pkg_path, *args) self.MPI_LIB_CTYPES = ctypes.CDLL(full_path, mode=ctypes.RTLD_GLOBAL)