MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / GetIdState

Method GetIdState

oneflow/core/framework/multi_client_session_context.cpp:209–219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

207}
208
209IdState MultiClientSessionContext::GetIdState() {
210 CHECK(Singleton<IDMgr>::Get() != nullptr);
211 CHECK(Singleton<TaskStreamIndexManager>::Get() != nullptr);
212 CHECK(Singleton<LazyJobBuildAndInferCtxMgr>::Get() != nullptr);
213 IdState id_state;
214
215 id_state.job_id_state_ = Singleton<LazyJobBuildAndInferCtxMgr>::Get()->GetJobIdCount();
216 Singleton<IDMgr>::Get()->SaveIdAndTaskIndex(&id_state);
217 Singleton<TaskStreamIndexManager>::Get()->GetTaskStreamIndex(&id_state.stream_index_state_);
218 return id_state;
219}
220
221void MultiClientSessionContext::SetIdState(const IdState& id_state) {
222 CHECK(Singleton<IDMgr>::Get() != nullptr);

Callers 1

id_state.cppFile · 0.80

Calls 4

GetFunction · 0.85
GetJobIdCountMethod · 0.80
SaveIdAndTaskIndexMethod · 0.80
GetTaskStreamIndexMethod · 0.80

Tested by

no test coverage detected