libgrape-lite
A C++ library for parallel graph processing
Public Member Functions | List of all members
grape::MessageManagerBase Class Referenceabstract

MessageManagerBase is the base class for message managers. More...

#include <message_manager_base.h>

Inheritance diagram for grape::MessageManagerBase:
grape::BatchShuffleMessageManager grape::DefaultMessageManager grape::GatherScatterMessageManager grape::ParallelMessageManager grape::ParallelMessageManagerOpt grape::AutoParallelMessageManager< FRAG_T >

Public Member Functions

virtual void Init (MPI_Comm comm)=0
 Initialize message manager. More...
 
virtual void Start ()=0
 This function will be called before Init step of applications.
 
virtual void StartARound ()=0
 This function will be called before each evaluation step of applications.
 
virtual void FinishARound ()=0
 This function will be called after each evaluation step of applications.
 
virtual void Finalize ()=0
 This function will be called after the evaluation of applications.
 
virtual bool ToTerminate ()=0
 This function will be called by worker after a step to determine whether evaluation is terminated. More...
 
virtual size_t GetMsgSize () const =0
 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. More...
 
virtual void ForceContinue ()=0
 Force continue to evaluate one more round even if all workers stop sending message. More...
 
virtual void ForceTerminate (const std::string &info="")=0
 Force all workers terminate after this round of evaluation. More...
 
virtual const TerminateInfoGetTerminateInfo () const =0
 This function is called to get gathered termination info after evaluation finished. More...
 

Detailed Description

MessageManagerBase is the base class for message managers.

Note
: The pure virtual functions in the class work as interfaces, instructing sub-classes to implement. The override functions in the derived classes would be invoked directly, not via virtual functions.

Member Function Documentation

◆ ForceContinue()

virtual void grape::MessageManagerBase::ForceContinue ( )
pure virtual

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

This function can be called by applications.

Implemented in grape::ParallelMessageManagerOpt, grape::ParallelMessageManager, grape::GatherScatterMessageManager, grape::DefaultMessageManager, grape::BatchShuffleMessageManager, and grape::AutoParallelMessageManager< FRAG_T >.

◆ ForceTerminate()

virtual void grape::MessageManagerBase::ForceTerminate ( const std::string &  info = "")
pure virtual

Force all workers terminate after this round of evaluation.

This function can be called by applications.

Parameters
infoTermination info.

Implemented in grape::GatherScatterMessageManager, grape::ParallelMessageManagerOpt, grape::ParallelMessageManager, grape::DefaultMessageManager, and grape::BatchShuffleMessageManager.

◆ GetMsgSize()

virtual size_t grape::MessageManagerBase::GetMsgSize ( ) const
pure virtual

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.

Implemented in grape::ParallelMessageManagerOpt, grape::ParallelMessageManager, grape::GatherScatterMessageManager, grape::DefaultMessageManager, and grape::BatchShuffleMessageManager.

◆ GetTerminateInfo()

virtual const TerminateInfo& grape::MessageManagerBase::GetTerminateInfo ( ) const
pure virtual

This function is called to get gathered termination info after evaluation finished.

Returns
Termination info.

Implemented in grape::ParallelMessageManagerOpt, grape::ParallelMessageManager, grape::GatherScatterMessageManager, grape::DefaultMessageManager, and grape::BatchShuffleMessageManager.

◆ Init()

virtual void grape::MessageManagerBase::Init ( MPI_Comm  comm)
pure virtual

◆ ToTerminate()

virtual bool grape::MessageManagerBase::ToTerminate ( )
pure virtual

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

Returns
Whether evaluation is terminated.

Implemented in grape::ParallelMessageManagerOpt, grape::ParallelMessageManager, grape::GatherScatterMessageManager, grape::DefaultMessageManager, grape::BatchShuffleMessageManager, and grape::AutoParallelMessageManager< FRAG_T >.