allow common python output in single node
This commit is contained in:
@@ -12,6 +12,7 @@ def _init_rabit():
|
|||||||
if _LIB is not None:
|
if _LIB is not None:
|
||||||
_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.RabitIsDistributed.restype = ctypes.c_int
|
||||||
_LIB.RabitVersionNumber.restype = ctypes.c_int
|
_LIB.RabitVersionNumber.restype = ctypes.c_int
|
||||||
|
|
||||||
def init(args=None):
|
def init(args=None):
|
||||||
@@ -65,8 +66,12 @@ def tracker_print(msg):
|
|||||||
"""
|
"""
|
||||||
if not isinstance(msg, STRING_TYPES):
|
if not isinstance(msg, STRING_TYPES):
|
||||||
msg = str(msg)
|
msg = str(msg)
|
||||||
|
is_dist = _LIB.RabitIsDistributed()
|
||||||
|
if is_dist != 0:
|
||||||
_LIB.RabitTrackerPrint(c_str(msg))
|
_LIB.RabitTrackerPrint(c_str(msg))
|
||||||
|
else:
|
||||||
|
sys.stdout.write(msg)
|
||||||
|
sys.stdout.flush()
|
||||||
|
|
||||||
def get_processor_name():
|
def get_processor_name():
|
||||||
"""Get the processor name.
|
"""Get the processor name.
|
||||||
|
|||||||
2
rabit
2
rabit
Submodule rabit updated: be50e7b632...849b20b7c8
Reference in New Issue
Block a user