예제 #1
0
    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()
예제 #2
0
    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
예제 #3
0
파일: basics.py 프로젝트: yushinliu/horovod
 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)