MCPcopy Create free account
hub / github.com/dmlc/parameter_server / createApp

Function createApp

src/app/linear_method/linear.cc:8–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6namespace LM {
7
8App* createApp(const string& name, const Config& conf) {
9 auto my_role = Postoffice::instance().myNode().role();
10 App* app = nullptr;
11 if (conf.has_darlin()) {
12 if (my_role == Node::SCHEDULER) {
13 app = new DarlinScheduler(name, conf);
14 } else if (my_role == Node::WORKER) {
15 app = new DarlinWorker(name, conf);
16 } else if (my_role == Node::SERVER) {
17 app = new DarlinServer(name, conf);
18 }
19 } else if (conf.has_async_sgd()) {
20 typedef float Real;
21 if (my_role == Node::SCHEDULER) {
22 app = new AsyncSGDScheduler(name, conf);
23 } else if (my_role == Node::WORKER) {
24 app = new AsyncSGDWorker<Real>(name, conf);
25 } else if (my_role == Node::SERVER) {
26 app = new AsyncSGDServer<Real>(name, conf);
27 }
28 } else if (conf.has_validation_data()) {
29 app = new ModelEvaluation(name, conf);
30 }
31 CHECK(app) << "fail to create " << conf.ShortDebugString()
32 << " at " << Postoffice::instance().myNode().ShortDebugString();
33 return app;
34}
35
36} // namespace LM
37} // namespace PS

Callers 1

createMethod · 0.85

Calls 4

has_darlinMethod · 0.80
has_async_sgdMethod · 0.80
roleMethod · 0.45
has_validation_dataMethod · 0.45

Tested by

no test coverage detected