add distributed checking

This commit is contained in:
tqchen 2016-04-11 15:43:01 -07:00
parent be50e7b632
commit 849b20b7c8
2 changed files with 8 additions and 1 deletions

View File

@ -46,6 +46,9 @@ RABIT_DLL int RabitGetRank();
/*! \brief get total number of process */ /*! \brief get total number of process */
RABIT_DLL int RabitGetWorldSize(); RABIT_DLL int RabitGetWorldSize();
/*! \brief get rank of current process */
RABIT_DLL int RabitIsDistributed();
/*! /*!
* \brief print the msg to the tracker, * \brief print the msg to the tracker,
* this function can be used to communicate the information of the progress to * this function can be used to communicate the information of the progress to

View File

@ -178,6 +178,10 @@ int RabitGetWorldSize() {
return rabit::GetWorldSize(); return rabit::GetWorldSize();
} }
int RabitIsDistributed() {
return rabit::IsDistributed();
}
void RabitTrackerPrint(const char *msg) { void RabitTrackerPrint(const char *msg) {
std::string m(msg); std::string m(msg);
rabit::TrackerPrint(m); rabit::TrackerPrint(m);
@ -200,7 +204,7 @@ void RabitBroadcast(void *sendrecv_data,
} }
void RabitAllreduce(void *sendrecvbuf, void RabitAllreduce(void *sendrecvbuf,
size_t count, size_t count,
int enum_dtype, int enum_dtype,
int enum_op, int enum_op,
void (*prepare_fun)(void *arg), void (*prepare_fun)(void *arg),