From d967d3c666884be54e4e12aca386d971a4741464 Mon Sep 17 00:00:00 2001 From: lizhenyu Date: Mon, 28 Mar 2022 14:49:57 +0800 Subject: [PATCH] [bugfix] file configuration initialize fail --- mindspore/ccsrc/ps/parameter_server.cc | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/mindspore/ccsrc/ps/parameter_server.cc b/mindspore/ccsrc/ps/parameter_server.cc index a10d9c68c6c..a6119479f4c 100644 --- a/mindspore/ccsrc/ps/parameter_server.cc +++ b/mindspore/ccsrc/ps/parameter_server.cc @@ -1145,19 +1145,8 @@ void ParameterServer::RecoverHandler::Init() { MS_EXCEPTION_IF_NULL(ps_->server_node_); std::string persistent_storage_file_path = std::string(kCurrentDirOfServer) + std::to_string(ps_->server_node_->rank_id()) + "_persistent_storage.json"; - if (!distributed::storage::FileIOUtils::IsFileOrDirExist(persistent_storage_file_path)) { - distributed::storage::FileIOUtils::CreateFile(persistent_storage_file_path); - } - - auto ret = FileUtils::GetRealPath(persistent_storage_file_path.c_str()); - if (!ret.has_value()) { - MS_LOG(EXCEPTION) << "Cannot get real path for persistent storage file"; - } - - storage_ = std::make_unique(ret.value()); - if (!storage_->Initialize()) { - MS_LOG(EXCEPTION) << "Initialize file storage module failed, file path: " << ret.value(); - } + storage_ = std::make_unique(persistent_storage_file_path); + (void)storage_->Initialize(); } void ParameterServer::RecoverHandler::Recover() {