libgrape-lite
A C++ library for parallel graph processing
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
grape::cuda::GPUMessageManager Class Reference

Public Member Functions

void Init (const grape::CommSpec &comm_spec)
 Initialize message manager.
 
void InitBuffer (size_t send_buffer_capacity, size_t recv_buffer_capacity)
 
void DropBuffer ()
 
void Start ()
 This function will be called before Init step of applications.
 
void StartARound ()
 This function will be called before each evaluation step of applications.
 
void FinishARound ()
 This function will be called after each evaluation step of applications.
 
void Finalize () const
 This function will be called after the evaluation of applications.
 
bool ToTerminate () const
 This function will be called by worker after a step to determine whether evaluation is terminated.
 
size_t GetMsgSize () const
 Get size of messages sent by this message manager instance. The return value is valid only after FinishARound is called. StartARound will reset the value to zero.
 
void ForceContinue ()
 Force continue to evaluate one more round even if all workers stop sending message.
 
double GetAccumulatedCommTime () const
 
dev::MessageManager DeviceObject ()
 
void DeviceWarmup (size_t np)
 For some GPU servers, the first kernel always takes a long time. This is a Dummy function to warm up the device.
 
template<typename GRAPH_T , typename MESSAGE_T = grape::EmptyType, typename FUNC_T >
void ParallelProcess (const GRAPH_T &frag, FUNC_T func)
 
template<typename MESSAGE_T = grape::EmptyType, typename FUNC_T >
void ParallelProcess (FUNC_T func)
 
Streamstream ()
 
ncclComm_t nccl_comm ()
 

Private Member Functions

bool syncLengths ()
 

Private Attributes

InArchiveGroup to_send_
 
OutArchiveGroup to_recv_
 
pinned_vector< dev::OutArchivepinned_to_recv_
 
thrust::device_vector< dev::InArchived_to_send_
 
thrust::device_vector< dev::OutArchived_to_recv_
 
Event computation_finished_
 
grape::CommSpec comm_spec_
 
std::shared_ptr< ncclComm_t > nccl_comm_
 
Stream compute_stream_
 
Stream comm_stream_
 
std::vector< size_t > lengths_out_
 
std::vector< size_t > lengths_in_
 
size_t sent_size_ {}
 
double total_memcpy_time_ {}
 
bool to_terminate_ {}
 
bool force_continue_ {}
 
fid_t fid_
 
fid_t fnum_
 

Member Function Documentation

◆ DeviceWarmup()

void grape::cuda::GPUMessageManager::DeviceWarmup ( size_t  np)
inline

For some GPU servers, the first kernel always takes a long time. This is a Dummy function to warm up the device.

This function can be called by applications.

◆ ForceContinue()

void grape::cuda::GPUMessageManager::ForceContinue ( )
inline

Force continue to evaluate one more round even if all workers stop sending message.

This function can be called by applications.

◆ GetMsgSize()

size_t grape::cuda::GPUMessageManager::GetMsgSize ( ) const
inline

Get size of messages sent by this message manager instance. The return value is valid only after FinishARound is called. StartARound will reset the value to zero.

Returns
Size of messages sent by this message manager instance.

◆ Init()

void grape::cuda::GPUMessageManager::Init ( const grape::CommSpec comm_spec)
inline

Initialize message manager.

Parameters
commMPI_Comm object.

◆ ToTerminate()

bool grape::cuda::GPUMessageManager::ToTerminate ( ) const
inline

This function will be called by worker after a step to determine whether evaluation is terminated.

Returns
Whether evaluation is terminated.