-
Notifications
You must be signed in to change notification settings - Fork 75
Expand file tree
/
Copy pathdifacto.cc
More file actions
32 lines (28 loc) · 885 Bytes
/
difacto.cc
File metadata and controls
32 lines (28 loc) · 885 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "async_sgd.h"
#include "config.pb.h"
#include "base/arg_parser.h"
namespace ps {
App* App::Create(int argc, char *argv[]) {
CHECK_GE(argc, 2) << "\nusage: " << argv[0] << " conf_file";
::dmlc::ArgParser parser;
if (strcmp(argv[1], "none")) parser.ReadFile(argv[1]);
parser.ReadArgs(argc-2, argv+2);
::dmlc::difacto::Config conf; parser.ParseToProto(&conf);
NodeInfo n;
if (n.IsWorker()) {
return new ::dmlc::difacto::AsyncWorker(conf);
} else if (n.IsServer()) {
return new ::dmlc::difacto::AsyncServer(conf);
} else if (n.IsScheduler()) {
return new ::dmlc::difacto::AsyncScheduler(conf);
} else {
LOG(FATAL) << "unknown node";
}
return NULL;
}
} // namespace ps
int64_t dmlc::difacto::ISGDHandle::new_w = 0;
int64_t dmlc::difacto::ISGDHandle::new_V = 0;
int main(int argc, char *argv[]) {
return ps::RunSystem(&argc, &argv);
}