fix load bug
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include "../utils/utils.h"
|
||||
#include <string>
|
||||
|
||||
namespace xgboost {
|
||||
/*! \brief syncrhonizer module that minimumly wraps interface of MPI */
|
||||
@@ -23,6 +24,8 @@ enum ReduceOp {
|
||||
int GetRank(void);
|
||||
/*! \brief get total number of process */
|
||||
int GetWorldSize(void);
|
||||
/*! \brief get name of processor */
|
||||
std::string GetProcessorName(void);
|
||||
|
||||
/*!
|
||||
* \brief this is used to check if sync module is a true distributed implementation, or simply a dummpy
|
||||
|
||||
@@ -21,6 +21,10 @@ int GetWorldSize(void) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
std::string GetProcessorName(void) {
|
||||
return std::string("");
|
||||
}
|
||||
|
||||
template<>
|
||||
void AllReduce<uint32_t>(uint32_t *sendrecvbuf, int count, ReduceOp op) {
|
||||
}
|
||||
|
||||
@@ -20,6 +20,14 @@ bool IsDistributed(void) {
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string GetProcessorName(void) {
|
||||
int len;
|
||||
char name[MPI_MAX_PROCESSOR_NAME];
|
||||
MPI::Get_processor_name(name, len);
|
||||
name[len] = '\0';
|
||||
return std::string(name);
|
||||
}
|
||||
|
||||
void Finalize(void) {
|
||||
MPI::Finalize();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user