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

Method stop

src/system/postoffice.cc:160–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

158}
159
160void Postoffice::stop() {
161 if (IamScheduler()) {
162 if (FLAGS_num_workers + FLAGS_num_servers) {
163 nodes_are_done_.get_future().wait();
164 }
165 Task terminate;
166 terminate.set_type(Task::TERMINATE);
167 app_->port(kLiveGroup)->submit(terminate);
168 usleep(800);
169 LI << "System stopped\n";
170 } else {
171 Task done;
172 done.set_type(Task::MANAGE);
173 done.mutable_mng_app()->set_cmd(ManageApp::DONE);
174 app_->port(app_->schedulerID())->submit(done);
175 // run as a daemon until received the termination messag
176 while (!done_) usleep(300);
177 }
178}
179
180void Postoffice::reply(
181 const NodeID& recver, const Task& task, const string& reply_msg) {

Callers

nothing calls this directly

Calls 7

waitMethod · 0.80
submitMethod · 0.80
mutable_mng_appMethod · 0.80
schedulerIDMethod · 0.80
set_typeMethod · 0.45
portMethod · 0.45
set_cmdMethod · 0.45

Tested by

no test coverage detected