Apache SINGA
A distributed deep learning platform .
 All Classes Namespaces Files Functions Variables Typedefs Macros
Public Member Functions | Static Public Member Functions | List of all members
singa::Cluster Class Reference

Cluster is a singleton object, which provides cluster configuations, e.g., the topology of the cluster. More...

#include <cluster.h>

Public Member Functions

int nserver_groups () const
 
int nworker_groups () const
 
int nworkers_per_group () const
 
int nservers_per_group () const
 
int nworkers_per_procs () const
 
int nservers_per_procs () const
 
int nworker_groups_per_server_group () const
 
bool has_server () const
 
bool has_worker () const
 
int procs_id () const
 
void set_procs_id (int procs_id)
 
bool server_worker_separate () const
 
int nworker_procs () const
 
int nserver_procs () const
 
int nprocs () const
 
std::string endpoint (int procs_id) const
 
std::string workspace () const
 
std::string vis_folder () const
 
std::string checkpoint_folder () const
 
bool share_memory () const
 
int sync_freq () const
 
int poll_time () const
 
ClusterRuntimeruntime () const
 
int ProcsIDOf (int group_id, int id, int flag)
 
std::string hostip () const
 
const std::vector< int > ExecutorRng (int pid, int group_size, int procs_size)
 
void Register (int pid, const std::string &endpoint)
 Register this process. More...
 

Static Public Member Functions

static ClusterSetup (int job_id, const SingaProto &singaConf, const ClusterProto &clusterConf)
 
static ClusterGet ()
 

Detailed Description

Cluster is a singleton object, which provides cluster configuations, e.g., the topology of the cluster.

All IDs start from 0.

Member Function Documentation

std::string singa::Cluster::endpoint ( int  procs_id) const
inline
Returns
endpoint of the router of a procs with the specified id
const std::vector<int> singa::Cluster::ExecutorRng ( int  pid,
int  group_size,
int  procs_size 
)
Parameters
pid,processsID
group_size,numof executors in a group
procs_size,numof executors in a procs
Returns
a vector with 4 integers: [group start, group end), [start executor, end executor)
bool singa::Cluster::has_server ( ) const
inline
Returns
true if the calling procs has server threads, otherwise false
bool singa::Cluster::has_worker ( ) const
inline
Returns
true if the calling procs has worker threads.
int singa::Cluster::procs_id ( ) const
inline
Returns
global procs id, which starts from 0.
int singa::Cluster::ProcsIDOf ( int  group_id,
int  id,
int  flag 
)
inline
Returns
logical procs ID
void singa::Cluster::Register ( int  pid,
const std::string &  endpoint 
)

Register this process.

Parameters
pidphysical process id get from OS, all other procs ID refers to logical process ID.
endpointunique string for other procs to connect

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