fix load bug

This commit is contained in:
tqchen
2014-10-16 21:47:01 -07:00
parent 3f3c90c3c0
commit f6d61f02f6
5 changed files with 18 additions and 2 deletions

View File

@@ -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

View File

@@ -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) {
}

View File

@@ -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();
}