#include <dc_comm_base.hpp>
Public Member Functions | |
| virtual size_t | capabilities () const =0 |
| virtual void | init (const std::vector< std::string > &machines, const std::map< std::string, std::string > &initopts, procid_t curmachineid, std::vector< dc_receive * > receiver)=0 |
| virtual void | close ()=0 |
| Must close all connections when this function is called. | |
| virtual procid_t | numprocs () const =0 |
| virtual procid_t | procid () const =0 |
| virtual size_t | network_bytes_sent () const =0 |
| virtual size_t | network_bytes_received () const =0 |
| virtual bool | channel_active (size_t target) const =0 |
| virtual void | send (size_t target, const char *buf, size_t len)=0 |
| virtual void | send2 (size_t target, const char *buf1, const size_t len1, const char *buf2, const size_t len2)=0 |
| virtual void | flush (size_t target)=0 |
The base class of all comms implementations
Definition at line 33 of file dc_comm_base.hpp.
| virtual bool graphlab::dc_impl::dc_comm_base::channel_active | ( | size_t | target | ) | const [pure virtual] |
returns true if the channel to the target machine is truly open. The dc_comm_base specification allows for lazy channels which are not created until it is used. For such implementations, this function should return true if the channel has been created, and false otherwise. Non-lazy implementations should return true all the time. The invariant to ensure is that this function must return true for a target machine ID if a packet has been sent from this machine to the target before this call.
Implemented in graphlab::dc_impl::dc_sctp_comm, and graphlab::dc_impl::dc_tcp_comm.
| virtual void graphlab::dc_impl::dc_comm_base::init | ( | const std::vector< std::string > & | machines, | |
| const std::map< std::string, std::string > & | initopts, | |||
| procid_t | curmachineid, | |||
| std::vector< dc_receive * > | receiver | |||
| ) | [pure virtual] |
Parses initialization parameters. Most of these parameters are user provided, or provided on a higher level initialization system. It is entirely up to the comm implementation how these parameters to be treated. The descriptions here are largely prescriptive. All machines are called with the same initialization parameters (of course with the exception of curmachineid)
The expected behavior is that this fuction should pause until all communication has been set up and returns the number of systems in the network. After which, all other remaining public functions (numprocs(), send(), etc) should operate normally. Every received message should immediate trigger the attached receiver
machines: a vector of string over machine IDs. This is typically provided by the user or through some other initialization mechanism initstring: Additional parameters passed by the user curmachineid: The ID of the current machine. Will be size_t(-1) if this is not available. (Some comm protocols will negotiate this itself.)
receiver: the receiving object
Implemented in graphlab::dc_impl::dc_sctp_comm, and graphlab::dc_impl::dc_tcp_comm.
| virtual void graphlab::dc_impl::dc_comm_base::send | ( | size_t | target, | |
| const char * | buf, | |||
| size_t | len | |||
| ) | [pure virtual] |
Sends the string of length len to the target machine dest. Only valid after call to init(); Establishes a connection if necessary
Implemented in graphlab::dc_impl::dc_sctp_comm, and graphlab::dc_impl::dc_tcp_comm.
1.7.1