bugfix of lazy prepare
This commit is contained in:
parent
87017bd4cd
commit
4db0a62a06
@ -77,7 +77,10 @@ void AllreduceRobust::Allreduce(void *sendrecvbuf_,
|
|||||||
PreprocFunction prepare_fun,
|
PreprocFunction prepare_fun,
|
||||||
void *prepare_arg) {
|
void *prepare_arg) {
|
||||||
// skip action in single node
|
// 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);
|
bool recovered = RecoverExec(sendrecvbuf_, type_nbytes * count, 0, seq_counter);
|
||||||
// now we are free to remove the last result, if any
|
// now we are free to remove the last result, if any
|
||||||
if (resbuf.LastSeqNo() != -1 &&
|
if (resbuf.LastSeqNo() != -1 &&
|
||||||
|
|||||||
@ -92,6 +92,7 @@ void Allreduce_(void *sendrecvbuf,
|
|||||||
mpi::OpType op,
|
mpi::OpType op,
|
||||||
IEngine::PreprocFunction prepare_fun,
|
IEngine::PreprocFunction prepare_fun,
|
||||||
void *prepare_arg) {
|
void *prepare_arg) {
|
||||||
|
if (prepare_fun != NULL) prepare_fun(prepare_arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
// code for reduce handle
|
// code for reduce handle
|
||||||
@ -106,6 +107,8 @@ void ReduceHandle::Init(IEngine::ReduceFunction redfunc, size_t type_nbytes) {}
|
|||||||
void ReduceHandle::Allreduce(void *sendrecvbuf,
|
void ReduceHandle::Allreduce(void *sendrecvbuf,
|
||||||
size_t type_nbytes, size_t count,
|
size_t type_nbytes, size_t count,
|
||||||
IEngine::PreprocFunction prepare_fun,
|
IEngine::PreprocFunction prepare_fun,
|
||||||
void *prepare_arg) {}
|
void *prepare_arg) {
|
||||||
|
if (prepare_fun != NULL) prepare_fun(prepare_arg);
|
||||||
|
}
|
||||||
} // namespace engine
|
} // namespace engine
|
||||||
} // namespace rabit
|
} // namespace rabit
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user