Skip to content

Commit 3c8eb84

Browse files
committed
minor
1 parent 27304c5 commit 3c8eb84

File tree

3 files changed

+13
-16
lines changed

3 files changed

+13
-16
lines changed

src/app/hello_world/main.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,22 @@ class Hello : public App {
1010
void init() {
1111
model_ = new KVVector<uint64, float>(name()+"_model", name());
1212
LL << "this is " << myNodeID() << ", a " <<
13-
(IamWorker() ? "worker" :
14-
(IamServer() ? "server" :
15-
(IamScheduler() ? "scheduler" : "idle")))
13+
(isWorker() ? "worker" :
14+
(isServer() ? "server" :
15+
(isScheduler() ? "scheduler" : "idle")))
1616
<< " node with rank " << myRank()
1717
<< ", creates model ["
1818
<< model_->name() << "] in app [" << name() << "]";
1919

2020
// initial the weight at server
21-
if (IamServer()) {
21+
if (isServer()) {
2222
model_->key() = SArray<uint64>({0, 1, 2, 3, 4, 5});
2323
model_->value() = SArray<float>({.0, .1, .2, .3, .4, .5});
2424
}
2525
}
2626

2727
void run() {
28-
if (IamWorker()) {
28+
if (isWorker()) {
2929
// pull
3030
if (myRank() == 0) {
3131
model_->key() = SArray<uint64>({0, 2, 4, 5});

src/system/app.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ class App : public Customer {
66
App(const string& name) : Customer(name) { }
77
virtual ~App() { }
88

9+
// factory functionn
910
static App* create(const std::string& name, const std::string& conf);
1011

12+
// init() is called after this app has been created at all nodes.
1113
virtual void init() { }
1214

1315
// run() is executed after all nodes have been executed init()
@@ -16,8 +18,3 @@ class App : public Customer {
1618
};
1719

1820
} // namespace PS
19-
20-
// factory function, implemented in src/main.cc
21-
// static App* create(const AppConfig& config);
22-
// // TODO rename to app_conf_
23-
// AppConfig app_cf_;

src/system/customer.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,16 @@ class Customer {
3636
// query about my node
3737
NodeID myNodeID() { return exec_.myNode().id(); }
3838
int myRank() { return exec_.myNode().rank(); }
39-
bool IamWorker() { return exec_.myNode().role() == Node::WORKER; }
40-
bool IamServer() { return exec_.myNode().role() == Node::SERVER; }
41-
bool IamScheduler() { return exec_.myNode().role() == Node::SCHEDULER; }
39+
bool isWorker() { return exec_.myNode().role() == Node::WORKER; }
40+
bool isServer() { return exec_.myNode().role() == Node::SERVER; }
41+
bool isScheduler() { return exec_.myNode().role() == Node::SCHEDULER; }
4242

43-
// the unqiue scheduler id
43+
// the unique scheduler id
4444
NodeID schedulerID() { return sys_.scheduler().id(); }
45-
// return the executor
46-
Executor& exec() { return exec_; }
4745
// return the remote_note by its name
4846
RNodePtr port(const NodeID& k) { return exec_.rnode(k); }
47+
// return the executor
48+
Executor& exec() { return exec_; }
4949

5050
protected:
5151
string name_;

0 commit comments

Comments
 (0)