!25729 unify RDR configuration mode and data export path policy

Merge pull request !25729 from liangyongxiong/rdr
This commit is contained in:
i-robot 2021-11-04 06:15:32 +00:00 committed by Gitee
commit f30edf5c4b
1 changed files with 1 additions and 8 deletions

View File

@ -18,7 +18,6 @@
#include <fstream> #include <fstream>
#include "debug/common.h" #include "debug/common.h"
#include "utils/utils.h" #include "utils/utils.h"
#include "utils/ms_context.h"
#include "utils/comm_manager.h" #include "utils/comm_manager.h"
namespace mindspore { namespace mindspore {
@ -36,13 +35,7 @@ std::optional<std::string> BaseRecorder::GetFileRealPath(const std::string &suff
filename = filename_ + delimiter_ + suffix; filename = filename_ + delimiter_ + suffix;
} }
} }
std::string file_path = directory_ + filename; std::string file_path = directory_ + "rank_" + std::to_string(GetRank()) + "/rdr/" + filename;
auto context = MsContext::GetInstance();
MS_EXCEPTION_IF_NULL(context);
auto config_file = context->get_param<std::string>(MS_CTX_ENV_CONFIG_PATH);
if (config_file.empty()) {
file_path = directory_ + "rank_" + std::to_string(GetRank()) + "/rdr/" + filename;
}
auto realpath = Common::CreatePrefixPath(file_path); auto realpath = Common::CreatePrefixPath(file_path);
if (!realpath.has_value()) { if (!realpath.has_value()) {
MS_LOG(ERROR) << "Get real path failed. " MS_LOG(ERROR) << "Get real path failed. "