From 5b4f7335a4ce3383e566465dd180a9564f7da9bc Mon Sep 17 00:00:00 2001 From: Yifan Zhao <yifanz16@illinois.edu> Date: Thu, 25 Mar 2021 05:48:23 -0500 Subject: [PATCH] Fixed tensor-rt spamming profile_info files --- .../include/hpvm-rt-controller.h | 2 +- .../tensor_runtime/src/hpvm-rt-controller.cpp | 27 +++---------------- 2 files changed, 5 insertions(+), 24 deletions(-) diff --git a/hpvm/projects/hpvm-tensor-rt/tensor_runtime/include/hpvm-rt-controller.h b/hpvm/projects/hpvm-tensor-rt/tensor_runtime/include/hpvm-rt-controller.h index cbd4431387..03b46ca5a3 100644 --- a/hpvm/projects/hpvm-tensor-rt/tensor_runtime/include/hpvm-rt-controller.h +++ b/hpvm/projects/hpvm-tensor-rt/tensor_runtime/include/hpvm-rt-controller.h @@ -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(); diff --git a/hpvm/projects/hpvm-tensor-rt/tensor_runtime/src/hpvm-rt-controller.cpp b/hpvm/projects/hpvm-tensor-rt/tensor_runtime/src/hpvm-rt-controller.cpp index b17285b5e0..47323b1e65 100644 --- a/hpvm/projects/hpvm-tensor-rt/tensor_runtime/src/hpvm-rt-controller.cpp +++ b/hpvm/projects/hpvm-tensor-rt/tensor_runtime/src/hpvm-rt-controller.cpp @@ -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"); -- GitLab