7#ifndef RABIT_INTERNAL_ENGINE_H_
8#define RABIT_INTERNAL_ENGINE_H_
63 size_t size_prev_slice) = 0;
81 void *prepare_arg =
nullptr) = 0;
88 virtual void Broadcast(
void *sendrecvbuf_,
size_t size,
int root) = 0;
123bool Init(
int argc,
char *argv[]);
171 size_t size_prev_slice);
194 void *prepare_arg =
nullptr);
Definition allreduce_base.h:32
interface of core Allreduce engine
Definition engine.h:22
virtual bool IsDistributed() const =0
whether we run in distribted mode
virtual void Allreduce(void *sendrecvbuf_, size_t type_nbytes, size_t count, ReduceFunction reducer, PreprocFunction prepare_fun=nullptr, void *prepare_arg=nullptr)=0
performs in-place Allreduce, on sendrecvbuf this function is NOT thread-safe
~IEngine()=default
virtual destructor
virtual void TrackerPrint(const std::string &msg)=0
prints the msg in the tracker, this function can be used to communicate progress information to the u...
virtual int GetRank() const =0
gets rank of current node
void() PreprocFunction(void *arg)
Preprocessing function, that is called before AllReduce, used to prepare the data used by AllReduce.
Definition engine.h:29
void() ReduceFunction(const void *src, void *dst, int count, const MPI::Datatype &dtype)
reduce function, the same form of MPI reduce function is used, to be compatible with MPI interface In...
Definition engine.h:41
virtual int LoadCheckPoint()=0
virtual int VersionNumber() const =0
virtual void Broadcast(void *sendrecvbuf_, size_t size, int root)=0
broadcasts data from root to every other node
virtual int GetWorldSize() const =0
gets total number of nodes
virtual std::string GetHost() const =0
gets the host name of the current node
virtual int GetRingPrevRank() const =0
gets rank of previous node in ring topology
virtual void CheckPoint()=0
Increase internal version number. Deprecated.
virtual void Allgather(void *sendrecvbuf, size_t total_size, size_t slice_begin, size_t slice_end, size_t size_prev_slice)=0
Allgather function, each node have a segment of data in the ring of sendrecvbuf, the data provided by...
DataType
enum of supported data types
Definition engine.h:141
OpType
enum of all operators
Definition engine.h:132
bool Init(int argc, char *argv[])
initializes the engine module
Definition engine.cc:43
void Allreduce_(void *sendrecvbuf, size_t type_nbytes, size_t count, IEngine::ReduceFunction red, mpi::DataType dtype, mpi::OpType op, IEngine::PreprocFunction prepare_fun=nullptr, void *prepare_arg=nullptr)
perform in-place Allreduce, on sendrecvbuf this is an internal function used by rabit to be able to c...
Definition engine.cc:95
bool Finalize()
finalizes the engine module
Definition engine.cc:55
void Allgather(void *sendrecvbuf, size_t total_size, size_t slice_begin, size_t slice_end, size_t size_prev_slice)
Allgather function, each node have a segment of data in the ring of sendrecvbuf, the data provided by...
Definition engine.cc:85
IEngine * GetEngine()
singleton method to get engine
Definition engine.cc:71
namespace of rabit
Definition engine.h:18
defines serializable interface of rabit