update with new rabit api

This commit is contained in:
tqchen 2015-01-19 21:32:25 -08:00
parent 25cf27d50f
commit cd2bce4719
5 changed files with 12 additions and 12 deletions

View File

@ -17,8 +17,8 @@ cd -
python splitrows.py ../../demo/regression/machine.txt.train train-machine $k
# run xgboost mpi
../../rabit/tracker/rabit_mpi.py -n $k ../../xgboost machine-row.conf dsplit=row num_round=3 eval_train=1
../../subtree/rabit/tracker/rabit_demo.py -n $k ../../xgboost machine-row.conf dsplit=row num_round=3 eval_train=1
# run xgboost-mpi save model 0001, continue to run from existing model
../../rabit/tracker/rabit_mpi.py -n $k ../../xgboost machine-row.conf dsplit=row num_round=1
../../rabit/tracker/rabit_mpi.py -n $k ../../xgboost machine-row.conf dsplit=row num_round=2 model_in=0001.model
../../subtree/rabit/tracker/rabit_demo.py -n $k ../../xgboost machine-row.conf dsplit=row num_round=1
../../subtree/rabit/tracker/rabit_demo.py -n $k ../../xgboost machine-row.conf dsplit=row num_round=2 model_in=0001.model

View File

@ -205,8 +205,8 @@ struct GradStats {
this->Add(b.sum_grad, b.sum_hess);
}
/*! \brief same as add, reduce is used in All Reduce */
inline void Reduce(const GradStats &b) {
this->Add(b);
inline static void Reduce(GradStats &a, const GradStats &b) {
a.Add(b);
}
/*! \brief set current value to a - b */
inline void SetSubstract(const GradStats &a, const GradStats &b) {
@ -285,8 +285,8 @@ struct CVGradStats : public GradStats {
}
}
/*! \brief same as add, reduce is used in All Reduce */
inline void Reduce(const CVGradStats &b) {
this->Add(b);
inline static void Reduce(CVGradStats &a, const CVGradStats &b) {
a.Add(b);
}
/*! \brief set current value to a - b */
inline void SetSubstract(const CVGradStats &a, const CVGradStats &b) {
@ -368,8 +368,8 @@ struct SplitEntry{
}
}
/*! \brief same as update, used by AllReduce*/
inline void Reduce(const SplitEntry &e) {
this->Update(e);
inline static void Reduce(SplitEntry &dst, const SplitEntry &src) {
dst.Update(src);
}
/*!\return feature index to split on */
inline unsigned split_index(void) const {

View File

@ -155,7 +155,7 @@ class DistColMaker : public ColMaker<TStats> {
private:
utils::BitMap bitmap;
std::vector<int> boolmap;
rabit::Reducer<SplitEntry> reducer;
rabit::Reducer<SplitEntry, SplitEntry::Reduce> reducer;
};
// we directly introduce pruner here
TreePruner pruner;

View File

@ -117,7 +117,7 @@ class HistMaker: public BaseMaker {
// workspace of thread
ThreadWSpace wspace;
// reducer for histogram
rabit::Reducer<TStats> histred;
rabit::Reducer<TStats, TStats::Reduce> histred;
// set of working features
std::vector<bst_uint> fwork_set;
// update function implementation

View File

@ -147,7 +147,7 @@ class TreeRefresher: public IUpdater {
// training parameter
TrainParam param;
// reducer
rabit::Reducer<TStats> reducer;
rabit::Reducer<TStats, TStats::Reduce> reducer;
};
} // namespace tree