Update rabit
This commit is contained in:
parent
0515e4ec28
commit
ced6d45e01
5
.gitignore
vendored
5
.gitignore
vendored
@ -20,8 +20,9 @@
|
|||||||
*buffer
|
*buffer
|
||||||
*model
|
*model
|
||||||
*pyc
|
*pyc
|
||||||
*train
|
*.train
|
||||||
*test
|
*.test
|
||||||
|
*.tar
|
||||||
*group
|
*group
|
||||||
*rar
|
*rar
|
||||||
*vali
|
*vali
|
||||||
|
|||||||
7
Makefile
7
Makefile
@ -73,7 +73,7 @@ endif
|
|||||||
|
|
||||||
|
|
||||||
# specify tensor path
|
# specify tensor path
|
||||||
.PHONY: clean all lint clean_all doxygen rcpplint Rpack Rbuild Rcheck java
|
.PHONY: clean all lint clean_all doxygen rcpplint pypack Rpack Rbuild Rcheck java
|
||||||
|
|
||||||
|
|
||||||
all: lib/libxgboost.a $(XGBOOST_DYLIB) xgboost
|
all: lib/libxgboost.a $(XGBOOST_DYLIB) xgboost
|
||||||
@ -143,6 +143,11 @@ clean_all: clean
|
|||||||
doxygen:
|
doxygen:
|
||||||
doxygen doc/Doxyfile
|
doxygen doc/Doxyfile
|
||||||
|
|
||||||
|
# create standalone python tar file.
|
||||||
|
pypack: ${XGBOOST_DYLIB}
|
||||||
|
cp ${XGBOOST_DYLIB} python-package/xgboost
|
||||||
|
cd python-package; tar cf xgboost.tar xgboost; cd ..
|
||||||
|
|
||||||
# Script to make a clean installable R package.
|
# Script to make a clean installable R package.
|
||||||
Rpack:
|
Rpack:
|
||||||
make clean_all
|
make clean_all
|
||||||
|
|||||||
@ -8,11 +8,18 @@ import numpy as np
|
|||||||
from .core import _LIB, c_str, STRING_TYPES
|
from .core import _LIB, c_str, STRING_TYPES
|
||||||
|
|
||||||
def _init_rabit():
|
def _init_rabit():
|
||||||
"""Initialize the rabit library."""
|
"""internal libary initializer."""
|
||||||
_LIB.RabitGetRank.restype = ctypes.c_int
|
_LIB.RabitGetRank.restype = ctypes.c_int
|
||||||
_LIB.RabitGetWorldSize.restype = ctypes.c_int
|
_LIB.RabitGetWorldSize.restype = ctypes.c_int
|
||||||
_LIB.RabitVersionNumber.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():
|
def finalize():
|
||||||
|
|||||||
2
rabit
2
rabit
@ -1 +1 @@
|
|||||||
Subproject commit 1392e9f3da59bd5602ddebee944dd8fb5c6507b0
|
Subproject commit be50e7b63224b9fb7ff94ce34df9f8752ef83043
|
||||||
@ -4,6 +4,9 @@ import scipy.sparse
|
|||||||
import pickle
|
import pickle
|
||||||
import xgboost as xgb
|
import xgboost as xgb
|
||||||
|
|
||||||
|
# always call this before using distributed module
|
||||||
|
xgb.rabit.init()
|
||||||
|
|
||||||
# Load file, file will be automatically sharded in distributed mode.
|
# Load file, file will be automatically sharded in distributed mode.
|
||||||
dtrain = xgb.DMatrix('../../demo/data/agaricus.txt.train')
|
dtrain = xgb.DMatrix('../../demo/data/agaricus.txt.train')
|
||||||
dtest = xgb.DMatrix('../../demo/data/agaricus.txt.test')
|
dtest = xgb.DMatrix('../../demo/data/agaricus.txt.test')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user