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

Public Member Functions

void Init (MPI_Comm comm) override
 Inherit.
 
void ReserveBuffer (fid_t fid, size_t send_size, size_t recv_size)
 
void SetupBuffer (fid_t fid, std::vector< char, Allocator< char > > &&send_buffer, std::vector< char, Allocator< char > > &&recv_buffer)
 
void Start () override
 Inherit.
 
void StartARound () override
 Inherit.
 
void FinishARound () override
 Inherit.
 
bool ToTerminate () override
 Inherit.
 
size_t GetMsgSize () const override
 Inherit.
 
void Finalize () override
 Inherit.
 
template<typename GRAPH_T , typename DATA_T >
void SyncInnerVertices (const GRAPH_T &frag, typename GRAPH_T::template vertex_array_t< DATA_T > &data, int thread_num=std::thread::hardware_concurrency())
 Synchronize the inner vertices' data of a vertex array to their mirrors.
 
void UpdateOuterVertices ()
 This function will block until all outer vertices are updated, that is, messages from all other fragments are received.
 
fid_t UpdatePartialOuterVertices ()
 This function will block until a set of messages from one fragment are received.
 
void ForceContinue () override
 Inherit.
 
void ForceTerminate (const std::string &terminate_info) override
 Inherit.
 
const TerminateInfoGetTerminateInfo () const override
 Inherit.
 

Private Types

template<typename FRAG_T , typename MESSAGE_T >
using shuffle_inplace_t = batch_shuffle_message_manager_impl::ShuffleInplace< FRAG_T, MESSAGE_T >
 
template<typename FRAG_T , typename MESSAGE_T >
using pod_shuffle_t = batch_shuffle_message_manager_impl::PodShuffle< FRAG_T, MESSAGE_T >
 
template<typename FRAG_T >
using archive_shuffle_t = batch_shuffle_message_manager_impl::ArchiveShuffle< FRAG_T >
 

Private Member Functions

void recvThreadRoutine ()
 
template<typename GRAPH_T , typename DATA_T >
std::enable_if< archive_shuffle_t< DATA_T >::value >::type startRecv (const GRAPH_T &frag, typename GRAPH_T::template vertex_array_t< DATA_T > &data, int thread_num)
 
template<typename GRAPH_T , typename DATA_T >
std::enable_if< shuffle_inplace_t< GRAPH_T, DATA_T >::value >::type startRecv (const GRAPH_T &frag, typename GRAPH_T::template vertex_array_t< DATA_T > &data, int thread_num)
 
template<typename GRAPH_T , typename DATA_T >
std::enable_if< pod_shuffle_t< GRAPH_T, DATA_T >::value >::type startRecv (const GRAPH_T &frag, typename GRAPH_T::template vertex_array_t< DATA_T > &data, int thread_num)
 
template<typename GRAPH_T , typename DATA_T >
std::enable_if<!archive_shuffle_t< DATA_T >::value >::type startSend (const GRAPH_T &frag, const typename GRAPH_T::template vertex_array_t< DATA_T > &data, int thread_num)
 
template<typename GRAPH_T , typename DATA_T >
std::enable_if< archive_shuffle_t< DATA_T >::value >::type startSend (const GRAPH_T &frag, const typename GRAPH_T::template vertex_array_t< DATA_T > &data, int thread_num)
 
template<typename GRAPH_T , typename DATA_T >
std::enable_if<!shuffle_inplace_t< GRAPH_T, DATA_T >::value >::type postProcess (const GRAPH_T &frag, fid_t i, const typename GRAPH_T::template vertex_array_t< DATA_T > &data, int thread_num)
 
template<typename GRAPH_T , typename DATA_T >
std::enable_if< shuffle_inplace_t< GRAPH_T, DATA_T >::value >::type postProcess (const GRAPH_T &frag, fid_t i, const typename GRAPH_T::template vertex_array_t< DATA_T > &data, int thread_num)
 

Private Attributes

fid_t fid_
 
fid_t fnum_
 
CommSpec comm_spec_
 
MPI_Comm comm_
 
std::vector< std::vector< char, Allocator< char > > > shuffle_out_buffers_
 
std::vector< InArchiveshuffle_out_archives_
 
std::vector< std::vector< char, Allocator< char > > > shuffle_in_buffers_
 
std::shared_ptr< batch_shuffle_message_manager_impl::PostProcessBasepost_process_handle_
 
std::vector< MPI_Request > recv_reqs_
 
std::vector< fid_t > recv_from_
 
std::vector< int > remaining_reqs_
 
fid_t remaining_frags_
 
std::vector< MPI_Request > send_reqs_
 
size_t msg_size_
 
std::thread recv_thread_
 
bool to_terminate_
 
bool force_terminate_
 
TerminateInfo terminate_info_
 
BlockingQueue< fid_t > sending_queue_
 

Member Function Documentation

◆ Finalize()

void grape::BatchShuffleMessageManager::Finalize ( )
inlineoverridevirtual

Inherit.

Implements grape::MessageManagerBase.

◆ FinishARound()

void grape::BatchShuffleMessageManager::FinishARound ( )
inlineoverridevirtual

Inherit.

Implements grape::MessageManagerBase.

◆ ForceContinue()

void grape::BatchShuffleMessageManager::ForceContinue ( )
inlineoverridevirtual

Inherit.

Implements grape::MessageManagerBase.

◆ ForceTerminate()

void grape::BatchShuffleMessageManager::ForceTerminate ( const std::string &  terminate_info)
inlineoverridevirtual

Inherit.

Implements grape::MessageManagerBase.

◆ GetMsgSize()

size_t grape::BatchShuffleMessageManager::GetMsgSize ( ) const
inlineoverridevirtual

Inherit.

Implements grape::MessageManagerBase.

◆ GetTerminateInfo()

const TerminateInfo & grape::BatchShuffleMessageManager::GetTerminateInfo ( ) const
inlineoverridevirtual

Inherit.

Implements grape::MessageManagerBase.

◆ Init()

void grape::BatchShuffleMessageManager::Init ( MPI_Comm  comm)
inlineoverridevirtual

Inherit.

Implements grape::MessageManagerBase.

◆ Start()

void grape::BatchShuffleMessageManager::Start ( )
inlineoverridevirtual

Inherit.

Implements grape::MessageManagerBase.

◆ StartARound()

void grape::BatchShuffleMessageManager::StartARound ( )
inlineoverridevirtual

Inherit.

Implements grape::MessageManagerBase.

◆ SyncInnerVertices()

template<typename GRAPH_T , typename DATA_T >
void grape::BatchShuffleMessageManager::SyncInnerVertices ( const GRAPH_T &  frag,
typename GRAPH_T::template vertex_array_t< DATA_T > &  data,
int  thread_num = std::thread::hardware_concurrency() 
)
inline

Synchronize the inner vertices' data of a vertex array to their mirrors.

Template Parameters
GRAPH_T
DATA_T
Parameters
frag
data

◆ ToTerminate()

bool grape::BatchShuffleMessageManager::ToTerminate ( )
inlineoverridevirtual

Inherit.

Implements grape::MessageManagerBase.

◆ UpdatePartialOuterVertices()

fid_t grape::BatchShuffleMessageManager::UpdatePartialOuterVertices ( )
inline

This function will block until a set of messages from one fragment are received.

Returns
Source fragment id.