From 849b20b7c822d194a515cc5587c37764cdf39385 Mon Sep 17 00:00:00 2001 From: tqchen Date: Mon, 11 Apr 2016 15:43:01 -0700 Subject: [PATCH] add distributed checking --- include/rabit/c_api.h | 3 +++ src/c_api.cc | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/rabit/c_api.h b/include/rabit/c_api.h index c833aa037..16db693b4 100644 --- a/include/rabit/c_api.h +++ b/include/rabit/c_api.h @@ -46,6 +46,9 @@ RABIT_DLL int RabitGetRank(); /*! \brief get total number of process */ RABIT_DLL int RabitGetWorldSize(); +/*! \brief get rank of current process */ +RABIT_DLL int RabitIsDistributed(); + /*! * \brief print the msg to the tracker, * this function can be used to communicate the information of the progress to diff --git a/src/c_api.cc b/src/c_api.cc index 14f176222..8c789c08b 100644 --- a/src/c_api.cc +++ b/src/c_api.cc @@ -178,6 +178,10 @@ int RabitGetWorldSize() { return rabit::GetWorldSize(); } +int RabitIsDistributed() { + return rabit::IsDistributed(); +} + void RabitTrackerPrint(const char *msg) { std::string m(msg); rabit::TrackerPrint(m); @@ -200,7 +204,7 @@ void RabitBroadcast(void *sendrecv_data, } void RabitAllreduce(void *sendrecvbuf, - size_t count, + size_t count, int enum_dtype, int enum_op, void (*prepare_fun)(void *arg),