[python package] include dmlc-tracker into xgb python pkg (#4731)
This commit is contained in:
17
tests/python/test_tracker.py
Normal file
17
tests/python/test_tracker.py
Normal file
@@ -0,0 +1,17 @@
|
||||
import time
|
||||
|
||||
from xgboost import RabitTracker
|
||||
import xgboost as xgb
|
||||
|
||||
|
||||
def test_rabit_tracker():
|
||||
tracker = RabitTracker(hostIP='127.0.0.1', nslave=1)
|
||||
tracker.start(1)
|
||||
rabit_env = [
|
||||
str.encode('DMLC_TRACKER_URI=127.0.0.1'),
|
||||
str.encode('DMLC_TRACKER_PORT=9091'),
|
||||
str.encode('DMLC_TASK_ID=0')]
|
||||
xgb.rabit.init(rabit_env)
|
||||
ret = xgb.rabit.broadcast('test1234', 0)
|
||||
assert str(ret) == 'test1234'
|
||||
xgb.rabit.finalize()
|
||||
Reference in New Issue
Block a user