Medial Code Documentation
Loading...
Searching...
No Matches
Namespaces | Data Structures | Typedefs | Functions | Variables
rabit::engine Namespace Reference

core interface of the engine More...

Namespaces

namespace  mpi
 namespace that contains stubs to be compatible with MPI
 

Data Structures

class  AllreduceBase
 implementation of basic Allreduce engine More...
 
class  AllreduceMock
 
class  IEngine
 interface of core Allreduce engine More...
 
class  MPIEngine
 implementation of engine using MPI More...
 
struct  ThreadLocalEntry
 entry to to easily hold returning information More...
 

Typedefs

using Manager = AllreduceBase
 
using EngineThreadLocal = dmlc::ThreadLocalStore< ThreadLocalEntry >
 

Functions

bool Init (int argc, char *argv[])
 initializes the engine module
 
bool Finalize ()
 finalizes the engine module
 
IEngineGetEngine ()
 singleton method to get engine
 
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 current node k is [slice_begin, slice_end), the next node's segment must start with slice_end after the call of Allgather, sendrecvbuf_ contains all the contents including all segments use a ring based algorithm.
 
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 compile with MPI do not use this function directly
 
size_t ParseUnit (const char *name, const char *val)
 
MPI::Datatype GetType (mpi::DataType dtype)
 
MPI::Op GetOp (mpi::OpType otype)
 

Variables

MPIEngine manager
 

Detailed Description

core interface of the engine

Function Documentation

◆ Allgather()

void rabit::engine::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 current node k is [slice_begin, slice_end), the next node's segment must start with slice_end after the call of Allgather, sendrecvbuf_ contains all the contents including all segments use a ring based algorithm.

Parameters
sendrecvbufbuffer for both sending and receiving data, it is a ring conceptually
total_sizetotal size of data to be gathered
slice_beginbeginning of the current slice
slice_endend of the current slice
size_prev_slicesize of the previous slice i.e. slice of node (rank - 1) % world_size

◆ Allreduce_()

void rabit::engine::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 compile with MPI do not use this function directly

Parameters
sendrecvbufbuffer for both sending and receiving data
type_nbytesthe number of bytes the type has
countnumber of elements to be reduced
reducerreduce function
dtypethe data type
opthe reduce operator type
prepare_funcLazy preprocessing function, lazy prepare_fun(prepare_arg) will be called by the function before performing Allreduce, to initialize the data in sendrecvbuf_. If the result of Allreduce can be recovered directly, then prepare_func will NOT be called
prepare_argargument used to pass into the lazy preprocessing function.

◆ Finalize()

bool rabit::engine::Finalize ( void  )

finalizes the engine module

finalize syncrhonization module

◆ Init()

bool rabit::engine::Init ( int  argc,
char *  argv[] 
)

initializes the engine module

initialize the synchronization module

intiialize the synchronization module