|
Medial Code Documentation
|
namespace of rabit More...
Namespaces | |
| namespace | engine |
| core interface of the engine | |
| namespace | op |
| reduction operators namespace | |
| namespace | utils |
| namespace for helper utils of the project | |
Typedefs | |
| using | Stream = dmlc::Stream |
| defines stream used in rabit see definition of Stream in dmlc/io.h | |
| using | Serializable = dmlc::Serializable |
| defines serializable objects used in rabit see definition of Serializable in dmlc/io.h | |
Functions | |
| bool | Init (int argc, char *argv[]) |
| initializes rabit, call this once at the beginning of your program | |
| bool | Finalize () |
| finalizes the rabit engine, call this function after you finished with all the jobs | |
| int | GetRingPrevRank () |
| int | GetRank () |
| gets rank of the current process | |
| int | GetWorldSize () |
| gets total number of processes | |
| bool | IsDistributed () |
| whether rabit env is in distributed mode | |
| std::string | GetProcessorName () |
| gets processor's name | |
| void | Broadcast (void *sendrecv_data, size_t size, int root) |
| broadcasts a memory region to every node from the root | |
| template<typename DType > | |
| void | Broadcast (std::vector< DType > *sendrecv_data, int root) |
| broadcasts an std::vector<DType> to every node from root | |
| void | Broadcast (std::string *sendrecv_data, int root) |
| broadcasts a std::string to every node from the root | |
| template<typename OP , typename DType > | |
| void | Allreduce (DType *sendrecvbuf, size_t count, void(*prepare_fun)(void *arg), void *prepare_arg) |
| void | TrackerPrint (const std::string &msg) |
| prints the msg to the tracker, this function can be used to communicate progress information to the user who monitors the tracker | |
| void | TrackerPrintf (const char *fmt,...) |
| prints the msg to the tracker, this function may not be available in very strict c++98 compilers, though it usually is. this function can be used to communicate progress information to the user who monitors the tracker | |
| int | LoadCheckPoint () |
| deprecated, planned for removal after checkpoing from JVM package is removed. | |
| void | CheckPoint () |
| deprecated, planned for removal after checkpoing from JVM package is removed. | |
| int | VersionNumber () |
| template<typename T > | |
| auto | Min (T const &l, T const &r) |
| template<typename T > | |
| auto | Max (T const &l, T const &r) |
| template<typename T > | |
| T * | BeginPtr (std::vector< T > &vec) |
| get the beginning address of a vector | |
| char * | BeginPtr (std::string &str) |
| const char * | BeginPtr (const std::string &str) |
| template<typename OP , typename DType > | |
| void | Allreduce (DType *sendrecvbuf, size_t count, void(*prepare_fun)(void *)=nullptr, void *prepare_arg=nullptr) |
| performs in-place Allreduce on sendrecvbuf this function is NOT thread-safe | |
| template<typename DType > | |
| void | Allgather (DType *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. | |
namespace of rabit
rabit namespace
|
inline |
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.
| sendrecvbuf_ | buffer for both sending and receiving data, it is a ring conceptually |
| total_size | total size of data to be gathered |
| slice_begin | beginning of the current slice |
| slice_end | end of the current slice |
| size_prev_slice | size of the previous slice i.e. slice of node (rank - 1) % world_size |
|
inline |
performs in-place Allreduce on sendrecvbuf this function is NOT thread-safe
Example Usage: the following code does an Allreduce and outputs the sum as the result
| sendrecvbuf | buffer for both sending and receiving data |
| count | number of elements to be reduced |
| prepare_fun | Lazy preprocessing function, if it is not NULL, prepare_fun(prepare_arg) will be called by the function before performing Allreduce in order to initialize the data in sendrecvbuf. If the result of Allreduce can be recovered directly, then prepare_func will NOT be called |
| prepare_arg | argument used to pass into the lazy preprocessing function |
| OP | see namespace op, reduce operator |
| DType | data type |
|
inline |
broadcasts a std::string to every node from the root
| sendrecv_data | the pointer to the send/receive buffer, for the receiver, the vector does not need to be pre-allocated |
| _file | caller file name used to generate unique cache key |
| _line | caller line number used to generate unique cache key |
| _caller | caller function name used to generate unique cache key |
| root | the process root |
|
inline |
broadcasts an std::vector<DType> to every node from root
| sendrecv_data | the pointer to send/receive vector, for the receiver, the vector does not need to be pre-allocated |
| root | the process root |
| DType | the data type stored in the vector, has to be a simple data type that can be directly transmitted by sending the sizeof(DType) |
|
inline |
broadcasts a memory region to every node from the root
Example: int a = 1; Broadcast(&a, sizeof(a), root);
| sendrecv_data | the pointer to the send/receive buffer, |
| size | the data size |
| root | the process root |
|
inline |
finalizes the rabit engine, call this function after you finished with all the jobs
|
inline |
gets processor's name
|
inline |
gets rank of the current process
|
inline |
gets total number of processes
|
inline |
initializes rabit, call this once at the beginning of your program
| argc | number of arguments in argv |
| argv | the array of input arguments |
|
inline |
whether rabit env is in distributed mode
|
inline |
prints the msg to the tracker, this function can be used to communicate progress information to the user who monitors the tracker
| msg | the message to be printed |
|
inline |
prints the msg to the tracker, this function may not be available in very strict c++98 compilers, though it usually is. this function can be used to communicate progress information to the user who monitors the tracker
| fmt | the format string |
|
inline |