Medial Code Documentation
Loading...
Searching...
No Matches
Public Member Functions | Data Fields
rabit::engine::AllreduceBase::LinkRecord Struct Reference

Public Member Functions

void InitBuffer (size_t type_nbytes, size_t count, size_t reduce_buffer_size)
 
void ResetSize ()
 
ReturnType ReadToRingBuffer (size_t protect_start, size_t max_size_read)
 read data into ring-buffer, with care not to existing useful override data position after protect_start
 
ReturnType ReadToArray (void *recvbuf_, size_t max_size)
 read data into array, this function can not be used together with ReadToRingBuffer a link can either read into the ring buffer, or existing array
 
ReturnType WriteFromArray (const void *sendbuf_, size_t max_size)
 write data in array to sock
 

Data Fields

xgboost::collective::TCPSocket sock
 
int rank
 
size_t size_read
 
size_t size_write
 
char * buffer_head {nullptr}
 
size_t buffer_size {0}
 

Member Function Documentation

◆ ReadToArray()

ReturnType rabit::engine::AllreduceBase::LinkRecord::ReadToArray ( void *  recvbuf_,
size_t  max_size 
)
inline

read data into array, this function can not be used together with ReadToRingBuffer a link can either read into the ring buffer, or existing array

Parameters
max_sizemaximum size of array
Returns
true if it is an successful read, false if there is some error happens, check errno

◆ ReadToRingBuffer()

ReturnType rabit::engine::AllreduceBase::LinkRecord::ReadToRingBuffer ( size_t  protect_start,
size_t  max_size_read 
)
inline

read data into ring-buffer, with care not to existing useful override data position after protect_start

Parameters
protect_startall data start from protect_start is still needed in buffer read shall not override this
max_size_readmaximum logical amount we can read, size_read cannot exceed this value
Returns
the type of reading

◆ WriteFromArray()

ReturnType rabit::engine::AllreduceBase::LinkRecord::WriteFromArray ( const void *  sendbuf_,
size_t  max_size 
)
inline

write data in array to sock

Parameters
sendbuf_head of array
max_sizemaximum size of array
Returns
true if it is an successful write, false if there is some error happens, check errno

The documentation for this struct was generated from the following file: