changes
This commit is contained in:
parent
56a80f431b
commit
537497f520
2
.gitignore
vendored
2
.gitignore
vendored
@ -7,7 +7,7 @@
|
||||
# Precompiled Headers
|
||||
*.gch
|
||||
*.pch
|
||||
|
||||
*.lnk
|
||||
# Compiled Dynamic libraries
|
||||
*.so
|
||||
*.dylib
|
||||
|
||||
@ -48,8 +48,7 @@ def exec_cmd(cmd, taskid):
|
||||
while True:
|
||||
if os.name == 'nt':
|
||||
prep = 'SET PYTHONPATH=\"%s\"\n' % WRAPPER_PATH
|
||||
ret = subprocess.call(prep + cmd + ('rabit_num_trial=%d' % ntrial),
|
||||
shell=True)
|
||||
ret = subprocess.call(prep + cmd + ('rabit_num_trial=%d' % ntrial), shell=True)
|
||||
if ret == 254:
|
||||
ntrial += 1
|
||||
continue
|
||||
@ -65,6 +64,9 @@ def exec_cmd(cmd, taskid):
|
||||
if args.verbose != 0:
|
||||
print 'Thread %d exit with 0' % taskid
|
||||
return
|
||||
else:
|
||||
if os.name == 'nt':
|
||||
os.exit(-1)
|
||||
else:
|
||||
raise Exception('Get nonzero return code=%d' % ret)
|
||||
#
|
||||
|
||||
@ -11,11 +11,9 @@ import warnings
|
||||
import numpy as np
|
||||
|
||||
if os.name == 'nt':
|
||||
WRAPPER_PATH = os.path.dirname(__file__) + '\\..\\windows\\x64\\Release\\'
|
||||
WRAPPER_SUFFIX = 'dll'
|
||||
WRAPPER_PATH = os.path.dirname(__file__) + '\\..\\windows\\x64\\Release\\rabit_wrapper%s.dll'
|
||||
else:
|
||||
WRAPPER_PATH = os.path.dirname(__file__) + '/'
|
||||
WRAPPER_SUFFIX = 'so'
|
||||
WRAPPER_PATH = os.path.dirname(__file__) + '/librabit_wrapper%s.so'
|
||||
rbtlib = None
|
||||
|
||||
# load in xgboost library
|
||||
@ -25,11 +23,11 @@ def loadlib__(lib = 'standard'):
|
||||
warnings.Warn('rabit.int call was ignored because it has already been initialized', level = 2)
|
||||
return
|
||||
if lib == 'standard':
|
||||
rbtlib = ctypes.cdll.LoadLibrary(WRAPPER_PATH + 'librabit_wrapper.' + WRAPPER_SUFFIX)
|
||||
rbtlib = ctypes.cdll.LoadLibrary(WRAPPER_PATH % '')
|
||||
elif lib == 'mock':
|
||||
rbtlib = ctypes.cdll.LoadLibrary(WRAPPER_PATH + 'librabit_wrapper_mock.' + WRAPPER_SUFFIX)
|
||||
rbtlib = ctypes.cdll.LoadLibrary(WRAPPER_PATH % '_mock')
|
||||
elif lib == 'mpi':
|
||||
rbtlib = ctypes.cdll.LoadLibrary(WRAPPER_PATH + 'librabit_wrapper_mpi.so' + WRAPPER_SUFFIX)
|
||||
rbtlib = ctypes.cdll.LoadLibrary(WRAPPER_PATH % '_mpi')
|
||||
else:
|
||||
raise Exception('unknown rabit lib %s, can be standard, mock, mpi' % lib)
|
||||
rbtlib.RabitGetRank.restype = ctypes.c_int
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user