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::Dealer Class Reference
Inheritance diagram for singa::Dealer:
singa::SocketInterface

Public Member Functions

 Dealer (int id)
 
int Connect (const std::string &endpoint)
 Setup the connection with the router. More...
 
int Send (Msg **msg) override
 Send a message to connected socket(s), non-blocking. More...
 
MsgReceive () override
 Receive a message from any connected socket. More...
 
void * InternalID () const override
 

Protected Attributes

int id_ = -1
 

Member Function Documentation

int singa::Dealer::Connect ( const std::string &  endpoint)

Setup the connection with the router.

Parameters
endpointIdentifier of the router. For intra-process connection, the endpoint follows the format of ZeroMQ, i.e., starting with "inproc://"; in Singa, since each process has one router, hence we can fix the endpoint to be "inproc://router" for intra-process. For inter-process, the endpoint follows ZeroMQ's format, i.e., IP:port, where IP is the connected process.
Returns
1 connection sets up successfully; 0 otherwise
void* singa::Dealer::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::Dealer::Receive ( )
overridevirtual

Receive a message from any connected socket.

Returns
a message pointer if success; nullptr if failure

Implements singa::SocketInterface.

int singa::Dealer::Send ( Msg **  msg)
overridevirtual

Send a message to connected socket(s), non-blocking.

The message will be deallocated after sending, thus should not be used after calling Send();

Parameters
msgThe message to be sent
Returns
1 for success queuing the message for sending, 0 for failure

Implements singa::SocketInterface.


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