fix
This commit is contained in:
parent
fa99857467
commit
e0b7da0302
@ -90,6 +90,7 @@ class AllreduceBase : public IEngine {
|
||||
PreprocFunction prepare_fun = NULL,
|
||||
void *prepare_arg = NULL) {
|
||||
if (prepare_fun != NULL) prepare_fun(prepare_arg);
|
||||
if (world_size == 1) return;
|
||||
utils::Assert(TryAllreduce(sendrecvbuf_,
|
||||
type_nbytes, count, reducer) == kSuccess,
|
||||
"Allreduce failed");
|
||||
@ -101,6 +102,7 @@ class AllreduceBase : public IEngine {
|
||||
* \param root the root worker id to broadcast the data
|
||||
*/
|
||||
virtual void Broadcast(void *sendrecvbuf_, size_t total_size, int root) {
|
||||
if (world_size == 1) return;
|
||||
utils::Assert(TryBroadcast(sendrecvbuf_, total_size, root) == kSuccess,
|
||||
"Broadcast failed");
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user