Remove RABIT CMake targets. (#6275)

* Now it's built as part of libxgboost.
* Set correct C API error in RABIT initialization and finalization.
* Remove redundant message.
* Guard the tracker print C API.
This commit is contained in:
Jiaming Yuan
2020-10-27 01:30:20 +08:00
committed by GitHub
parent 2686d32a36
commit d61b628bf5
11 changed files with 50 additions and 120 deletions

View File

@@ -73,7 +73,7 @@ RABIT_DLL int RabitIsDistributed(void);
* the user who monitors the tracker
* \param msg the message to be printed
*/
RABIT_DLL void RabitTrackerPrint(const char *msg);
RABIT_DLL int RabitTrackerPrint(const char *msg);
/*!
* \brief get name of processor
* \param out_name hold output string

View File

@@ -622,7 +622,9 @@ struct PollHelper {
fdset.push_back(kv.second);
}
int ret = PollImpl(fdset.data(), fdset.size(), timeout);
if (ret <= 0) {
if (ret == 0) {
LOG(FATAL) << "Poll timeout";
} else if (ret < 0) {
Socket::Error("Poll");
} else {
for (auto& pfd : fdset) {

View File

@@ -15,6 +15,7 @@
#include <stdexcept>
#include <vector>
#include "dmlc/io.h"
#include "xgboost/logging.h"
#include <cstdarg>
#if !defined(__GNUC__) || defined(__FreeBSD__)
@@ -73,17 +74,14 @@ inline bool StringToBool(const char* s) {
* \param msg error message
*/
inline void HandleAssertError(const char *msg) {
fprintf(stderr,
"AssertError:%s, rabit is configured to keep process running\n", msg);
throw dmlc::Error(msg);
LOG(FATAL) << msg;
}
/*!
* \brief handling of Check error, caused by inappropriate input
* \param msg error message
*/
inline void HandleCheckError(const char *msg) {
fprintf(stderr, "%s, rabit is configured to keep process running\n", msg);
throw dmlc::Error(msg);
LOG(FATAL) << msg;
}
inline void HandlePrint(const char *msg) {
@@ -154,13 +152,6 @@ inline void Error(const char *fmt, ...) {
HandleCheckError(msg.c_str());
}
}
/*! \brief replace fopen, report error when the file open fails */
inline std::FILE *FopenCheck(const char *fname, const char *flag) {
std::FILE *fp = fopen64(fname, flag);
Check(fp != nullptr, "can not open file \"%s\"\n", fname);
return fp;
}
} // namespace utils
// Can not use std::min on Windows with msvc due to: