Update rabit

This commit is contained in:
tqchen
2016-03-01 21:02:35 -08:00
parent 0515e4ec28
commit ced6d45e01
5 changed files with 22 additions and 6 deletions

View File

@@ -8,11 +8,18 @@ import numpy as np
from .core import _LIB, c_str, STRING_TYPES
def _init_rabit():
"""Initialize the rabit library."""
"""internal libary initializer."""
_LIB.RabitGetRank.restype = ctypes.c_int
_LIB.RabitGetWorldSize.restype = ctypes.c_int
_LIB.RabitVersionNumber.restype = ctypes.c_int
_LIB.RabitInit(0, None)
def init(args=None):
"""Initialize the rabit libary with arguments"""
if args is None:
args = []
arr = (ctypes.c_char_p * len(args))()
arr[:] = args
_LIB.RabitInit(len(arr), arr)
def finalize():