unify RDR configuration mode and data export path policy

This commit is contained in:
liangyongxiong 2021-11-01 14:52:51 +08:00
parent 4fd9d5739a
commit e861f42160
1 changed files with 1 additions and 8 deletions

View File

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