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

@ -192,7 +192,8 @@ class BoostLearner {
std::fill(enabled.begin(), enabled.end(), false);
int start = step * pid;
int end = std::min(step * (pid + 1), ncol);
utils::Printf("rank %d idset:", pid);
std::string name = sync::GetProcessorName();
utils::Printf("rank %d of %s idset:", pid, name.c_str());
for (int i = start; i < end; ++i) {
enabled[col_index[i]] = true;
utils::Printf(" %u", col_index[i]);

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

View File

@ -305,7 +305,7 @@ class TreeModel {
// chg deleted nodes
deleted_nodes.resize(0);
for (int i = param.num_roots; i < param.num_nodes; i ++) {
if (nodes[i].is_root()) deleted_nodes.push_back(i);
if (nodes[i].is_deleted()) deleted_nodes.push_back(i);
}
utils::Assert(static_cast<int>(deleted_nodes.size()) == param.num_deleted,
"number of deleted nodes do not match");