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

Method writeToFile

src/parameter/kv_store.h:63–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61 }
62
63 virtual void writeToFile(const std::string& file) {
64 if (!dirExists(getPath(file))) {
65 createDir(getPath(file));
66 }
67 std::ofstream out(file); CHECK(out.good());
68 V v;
69 for (auto& e : data_) {
70 e.second.put(&v, &state_);
71 if (v != 0) out << e.first << "\t" << v << std::endl;
72 }
73 }
74 // TODO fault tolerance
75 void setReplica(const MessagePtr& msg) { }
76 void getReplica(const MessagePtr& msg) { }

Callers

nothing calls this directly

Calls 4

dirExistsFunction · 0.85
getPathFunction · 0.85
createDirFunction · 0.85
putMethod · 0.45

Tested by

no test coverage detected