Squashed 'subtree/rabit/' changes from 1bb8fe9..4db0a62
4db0a62bugfix of lazy prepare87017bdlicensedc703e1licensec171440change license to bsd7db2070Update README.md581fe06add mocktestd2f252fok4a5b9e5add all12ee049init version of lbfgs37a2837complete lbfgs solver6ade7cbcomplete lbfgs git-subtree-dir: subtree/rabit git-subtree-split:4db0a62a06
This commit is contained in:
@@ -77,7 +77,10 @@ void AllreduceRobust::Allreduce(void *sendrecvbuf_,
|
||||
PreprocFunction prepare_fun,
|
||||
void *prepare_arg) {
|
||||
// skip action in single node
|
||||
if (world_size == 1) return;
|
||||
if (world_size == 1) {
|
||||
if (prepare_fun != NULL) prepare_fun(prepare_arg);
|
||||
return;
|
||||
}
|
||||
bool recovered = RecoverExec(sendrecvbuf_, type_nbytes * count, 0, seq_counter);
|
||||
// now we are free to remove the last result, if any
|
||||
if (resbuf.LastSeqNo() != -1 &&
|
||||
|
||||
@@ -92,6 +92,7 @@ void Allreduce_(void *sendrecvbuf,
|
||||
mpi::OpType op,
|
||||
IEngine::PreprocFunction prepare_fun,
|
||||
void *prepare_arg) {
|
||||
if (prepare_fun != NULL) prepare_fun(prepare_arg);
|
||||
}
|
||||
|
||||
// code for reduce handle
|
||||
@@ -106,6 +107,8 @@ void ReduceHandle::Init(IEngine::ReduceFunction redfunc, size_t type_nbytes) {}
|
||||
void ReduceHandle::Allreduce(void *sendrecvbuf,
|
||||
size_t type_nbytes, size_t count,
|
||||
IEngine::PreprocFunction prepare_fun,
|
||||
void *prepare_arg) {}
|
||||
void *prepare_arg) {
|
||||
if (prepare_fun != NULL) prepare_fun(prepare_arg);
|
||||
}
|
||||
} // namespace engine
|
||||
} // namespace rabit
|
||||
|
||||
Reference in New Issue
Block a user