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

Public Member Functions

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

Protected Attributes

int id_
 
zsock_t * dealer_
 
zpoller_t * poller_
 
- Protected Attributes inherited from singa::Socket
int local_id_
 

Member Function Documentation

virtual int singa::Dealer::Connect ( string  endpoint)
virtual

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
virtual void* singa::Dealer::InternalID ( ) const
inlinevirtual
Returns
Identifier of the implementation dependent socket. E.g., zsock_t* for ZeroMQ implementation and rank for MPI implementation.

Implements singa::Socket.

virtual Msg* singa::Dealer::Receive ( )
virtual

Receive a message from any connected socket.

Returns
a message pointer if success; nullptr if failure

Implements singa::Socket.

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

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
themessage to be sent
Returns
1 for success queuing the message for sending, 0 for failure

Implements singa::Socket.


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