Handles collective communication primitives in memory.
More...
#include <in_memory_handler.h>
|
| | InMemoryHandler ()=default |
| | Default constructor.
|
| |
| | InMemoryHandler (int worldSize) |
| | Construct a handler with the given world size.
|
| |
| void | Init (int world_size, int rank) |
| | Initialize the handler with the world size and rank.
|
| |
| void | Shutdown (uint64_t sequence_number, int rank) |
| | Shut down the handler.
|
| |
| void | Allgather (char const *input, std::size_t bytes, std::string *output, std::size_t sequence_number, int rank) |
| | Perform allgather.
|
| |
| void | Allreduce (char const *input, std::size_t bytes, std::string *output, std::size_t sequence_number, int rank, DataType data_type, Operation op) |
| | Perform allreduce.
|
| |
| void | Broadcast (char const *input, std::size_t bytes, std::string *output, std::size_t sequence_number, int rank, int root) |
| | Perform broadcast.
|
| |
Handles collective communication primitives in memory.
This class is thread safe.
◆ InMemoryHandler() [1/2]
| xgboost::collective::InMemoryHandler::InMemoryHandler |
( |
| ) |
|
|
default |
Default constructor.
This is used when multiple objects/threads are accessing the same handler and need to initialize it collectively.
◆ InMemoryHandler() [2/2]
| xgboost::collective::InMemoryHandler::InMemoryHandler |
( |
int |
worldSize | ) |
|
|
inlineexplicit |
Construct a handler with the given world size.
- Parameters
-
| world_size | Number of workers. |
This is used when the handler only needs to be initialized once with a known world size.
◆ Allgather()
| void xgboost::collective::InMemoryHandler::Allgather |
( |
char const * |
input, |
|
|
std::size_t |
bytes, |
|
|
std::string * |
output, |
|
|
std::size_t |
sequence_number, |
|
|
int |
rank |
|
) |
| |
Perform allgather.
- Parameters
-
| input | The input buffer. |
| bytes | Number of bytes in the input buffer. |
| output | The output buffer. |
| sequence_number | Call sequence number. |
| rank | Index of the worker. |
◆ Allreduce()
| void xgboost::collective::InMemoryHandler::Allreduce |
( |
char const * |
input, |
|
|
std::size_t |
bytes, |
|
|
std::string * |
output, |
|
|
std::size_t |
sequence_number, |
|
|
int |
rank, |
|
|
DataType |
data_type, |
|
|
Operation |
op |
|
) |
| |
Perform allreduce.
- Parameters
-
| input | The input buffer. |
| bytes | Number of bytes in the input buffer. |
| output | The output buffer. |
| sequence_number | Call sequence number. |
| rank | Index of the worker. |
| data_type | Type of the data. |
| op | The reduce operation. |
◆ Broadcast()
| void xgboost::collective::InMemoryHandler::Broadcast |
( |
char const * |
input, |
|
|
std::size_t |
bytes, |
|
|
std::string * |
output, |
|
|
std::size_t |
sequence_number, |
|
|
int |
rank, |
|
|
int |
root |
|
) |
| |
Perform broadcast.
- Parameters
-
| input | The input buffer. |
| bytes | Number of bytes in the input buffer. |
| output | The output buffer. |
| sequence_number | Call sequence number. |
| rank | Index of the worker. |
| root | Index of the worker to broadcast from. |
◆ Init()
| void xgboost::collective::InMemoryHandler::Init |
( |
int |
world_size, |
|
|
int |
rank |
|
) |
| |
Initialize the handler with the world size and rank.
- Parameters
-
| world_size | Number of workers. |
| rank | Index of the worker. |
This is used when multiple objects/threads are accessing the same handler and need to initialize it collectively.
◆ Shutdown()
| void xgboost::collective::InMemoryHandler::Shutdown |
( |
uint64_t |
sequence_number, |
|
|
int |
rank |
|
) |
| |
Shut down the handler.
- Parameters
-
| sequence_number | Call sequence number. |
| rank | Index of the worker. |
This is used when multiple objects/threads are accessing the same handler and need to shut it down collectively.
The documentation for this class was generated from the following files:
- External/xgboost/src/collective/in_memory_handler.h
- External/xgboost/src/collective/in_memory_handler.cc