Medial Code Documentation
Loading...
Searching...
No Matches
noop_communicator.h
1
4#pragma once
5#include <string>
6
7#include "communicator.h"
8
9namespace xgboost {
10namespace collective {
11
16 public:
18 bool IsDistributed() const override { return false; }
19 bool IsFederated() const override { return false; }
20 void AllGather(void *, std::size_t) override {}
21 void AllReduce(void *, std::size_t, DataType, Operation) override {}
22 void Broadcast(void *, std::size_t, int) override {}
23 std::string GetProcessorName() override { return ""; }
24 void Print(const std::string &message) override { LOG(CONSOLE) << message; }
25
26 protected:
27 void Shutdown() override {}
28};
29
30} // namespace collective
31} // namespace xgboost
A communicator class that handles collective communication.
Definition communicator.h:86
A no-op communicator, used for non-distributed training.
Definition noop_communicator.h:15
void Shutdown() override
Shuts down the communicator.
Definition noop_communicator.h:27
std::string GetProcessorName() override
Gets the name of the processor.
Definition noop_communicator.h:23
bool IsFederated() const override
Whether the communicator is running in federated mode.
Definition noop_communicator.h:19
void AllGather(void *, std::size_t) override
Gathers data from all processes and distributes it to all processes.
Definition noop_communicator.h:20
bool IsDistributed() const override
Whether the communicator is running in distributed mode.
Definition noop_communicator.h:18
void Broadcast(void *, std::size_t, int) override
Broadcasts a message from the process with rank root to all other processes of the group.
Definition noop_communicator.h:22
void AllReduce(void *, std::size_t, DataType, Operation) override
Combines values from all processes and distributes the result back to all processes.
Definition noop_communicator.h:21
void Print(const std::string &message) override
Prints the message.
Definition noop_communicator.h:24
Operation
Defines the reduction operation.
Definition communicator.h:61
DataType
Defines the integral and floating data types.
Definition communicator.h:15
namespace of xgboost
Definition base.h:90