Apache SINGA
A distributed deep learning platform .
 All Classes Namespaces Files Functions Variables Typedefs Macros
Public Member Functions | Protected Attributes | List of all members
singa::Router Class Reference
Inheritance diagram for singa::Router:
singa::SocketInterface

Public Member Functions

 Router (int bufsize)
 There is only one router per procs, hence its local id is 0 and is not set explicitly. More...
 
int Bind (const std::string &endpoint)
 Setup the connection with dealers. More...
 
int Send (Msg **msg) override
 If the destination socket has not connected yet, buffer this the message.
 
MsgReceive () override
 Receive a message from any connected socket. More...
 
void * InternalID () const override
 

Protected Attributes

int nBufmsg_ = 0
 
int bufsize_ = 100
 

Constructor & Destructor Documentation

singa::Router::Router ( int  bufsize)
explicit

There is only one router per procs, hence its local id is 0 and is not set explicitly.

Parameters
bufsizeBuffer at most this number of messages

Member Function Documentation

int singa::Router::Bind ( const std::string &  endpoint)

Setup the connection with dealers.

It automatically binds to the endpoint for intra-process communication, i.e., "inproc://router".

Parameters
endpointThe identifier for the Dealer socket in other process to connect. It has the format IP:Port, where IP is the host machine. If endpoint is empty, it means that all connections are intra-process connection.
Returns
number of connected dealers.
void* singa::Router::InternalID ( ) const
overridevirtual
Returns
Identifier of the implementation dependent socket. E.g., zsock_t* for ZeroMQ implementation and rank for MPI implementation.

Implements singa::SocketInterface.

Msg* singa::Router::Receive ( )
overridevirtual

Receive a message from any connected socket.

Returns
a message pointer if success; nullptr if failure

Implements singa::SocketInterface.


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