Cluster is a singleton object, which provides cluster configuations, e.g., the topology of the cluster.
More...
#include <cluster.h>
|
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 |
|
ClusterRuntime * | runtime () 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 Cluster * | Setup (int job_id, const SingaProto &singaConf, const ClusterProto &clusterConf) |
|
static Cluster * | Get () |
|
Cluster is a singleton object, which provides cluster configuations, e.g., the topology of the cluster.
All IDs start from 0.
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,processs | ID |
group_size,num | of executors in a group |
procs_size,num | of 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 |
void singa::Cluster::Register |
( |
int |
pid, |
|
|
const std::string & |
endpoint |
|
) |
| |
Register this process.
- Parameters
-
pid | physical process id get from OS, all other procs ID refers to logical process ID. |
endpoint | unique string for other procs to connect |
The documentation for this class was generated from the following file:
- /home/wangwei/program/asf/release-0.1/apache-singa-incubating-0.1.0-RC1/include/utils/cluster.h