Skip to content
Snippets Groups Projects
Commit 5b4f7335 authored by Yifan Zhao's avatar Yifan Zhao
Browse files

Fixed tensor-rt spamming profile_info files

parent ffb35262
No related branches found
No related tags found
No related merge requests found
......@@ -128,7 +128,7 @@ public:
unsigned long getIterationFrequency();
void set_out_file_name(std::string &str);
void set_out_file_name(const std::string &str);
void printToFile();
......
......@@ -265,7 +265,9 @@ double ProfileInfo::getCurrentIterationComputeEnergy() {
return energy_compute_current_iteration;
}
void ProfileInfo::set_out_file_name(std::string &str) { out_file_name = str; }
void ProfileInfo::set_out_file_name(const std::string &str) {
out_file_name = str;
}
void ProfileInfo::printToFile() {
INFO("Writing Runtime Profile Info File...\n");
......@@ -432,7 +434,7 @@ NodeConfiguration *RuntimeController::getNodeConfiguration(const char *data) {
void RuntimeController::init(const char *Cstr) {
// We initialize the path to the profile info output file,
// based on the path given for the configuration file
setProfileInfoFilename(Cstr);
PI->set_out_file_name("profile_info.txt");
readConfigurationFile(Cstr);
// NOTE: Configurations is pareto-configs. InitialConfigurations is the full
......@@ -634,27 +636,6 @@ RuntimeController::~RuntimeController() {
// are stored in different containers, but share the node setup
}
void RuntimeController::setProfileInfoFilename(const char *str) {
if (PI) {
std::string file_path = std::string(str);
size_t idx = file_path.find_last_of("/");
file_path.erase(idx + 1);
file_path.append("profile_info_");
bool found = false;
std::string profile_filename;
for (unsigned i = 0; !found; i++) {
profile_filename = file_path;
profile_filename.append(std::to_string(i));
profile_filename.append(".txt");
found = !fileExists(profile_filename);
}
PI->set_out_file_name(profile_filename);
}
}
void RuntimeController::readConfigurationFile(const char *str) {
INFO("Reading Configuration File...\n");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment