From ef175332b93d3da1b8d978dda5bf575fd61f1b5a Mon Sep 17 00:00:00 2001 From: Kevin Huck Date: Tue, 17 Oct 2023 14:09:46 -0700 Subject: [PATCH] Cleaning up kokkos tuning verbosity, shortening simulated annealing minimum iterations. --- src/apex/apex_kokkos_tuning.cpp | 16 +++++++++------- src/apex/simulated_annealing.hpp | 2 +- src/scripts/counter_scatterplot.py | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/apex/apex_kokkos_tuning.cpp b/src/apex/apex_kokkos_tuning.cpp index 11b4629e..337942f3 100644 --- a/src/apex/apex_kokkos_tuning.cpp +++ b/src/apex/apex_kokkos_tuning.cpp @@ -757,7 +757,9 @@ std::string hashContext(size_t numVars, } d = ","; } - ss << ",tree_node:" << tree_node << "]"; + if(tree_node.size() > 0) { + ss << ",tree_node:" << tree_node << "]"; + } std::string tmp{ss.str()}; return tmp; } @@ -816,12 +818,12 @@ void set_params(std::shared_ptr request, if (var->info.type == kokkos_value_double) { values[i].value.double_value = std::stod(param->get_value()); std::string tmp(request->get_name()+":"+var->name); - if (!request->has_converged()) + //if (!request->has_converged()) apex::sample_value(tmp, values[i].value.double_value); } else if (var->info.type == kokkos_value_int64) { values[i].value.int_value = std::stol(param->get_value()); std::string tmp(request->get_name()+":"+var->name); - if (!request->has_converged()) + //if (!request->has_converged()) apex::sample_value(tmp, values[i].value.int_value); } else if (var->info.type == kokkos_value_string) { strncpy(values[i].value.string_value, param->get_value().c_str(), KOKKOS_TOOLS_TUNING_STRING_LENGTH); @@ -832,14 +834,14 @@ void set_params(std::shared_ptr request, request->get_param(var->name)); values[i].value.double_value = param->get_value(); std::string tmp(request->get_name()+":"+var->name); - if (!request->has_converged()) + //if (!request->has_converged()) apex::sample_value(tmp, values[i].value.double_value); } else if (var->info.type == kokkos_value_int64) { auto param = std::static_pointer_cast( request->get_param(var->name)); values[i].value.int_value = param->get_value(); std::string tmp(request->get_name()+":"+var->name); - if (!request->has_converged()) + //if (!request->has_converged()) apex::sample_value(tmp, values[i].value.int_value); } } @@ -1089,11 +1091,11 @@ void kokkosp_request_values( // throw away the time spent setting up tuning //session.context_starts[contextId] = session.context_starts[contextId] + delta; } - if (!converged) { + //if (!converged) { // add this name to our map of active contexts session.active_requests.insert( std::pair(contextId, name)); - } + //} } if (session.verbose) { std::cout << std::string(getDepth(), ' '); diff --git a/src/apex/simulated_annealing.hpp b/src/apex/simulated_annealing.hpp index 6f511b3c..0801f30a 100644 --- a/src/apex/simulated_annealing.hpp +++ b/src/apex/simulated_annealing.hpp @@ -151,7 +151,7 @@ class SimulatedAnnealing { size_t kmax; size_t k; std::map vars; - const size_t max_iterations{1000}; + const size_t max_iterations{400}; const size_t min_iterations{100}; public: void evaluate(double new_cost); diff --git a/src/scripts/counter_scatterplot.py b/src/scripts/counter_scatterplot.py index e679536d..a873d8d8 100755 --- a/src/scripts/counter_scatterplot.py +++ b/src/scripts/counter_scatterplot.py @@ -101,7 +101,7 @@ def shorten_name(name): pl.yticks(fontsize=18) print ("Rendering...") pl.tight_layout() - name = name.replace(" ", "_") + name = key.replace(" ", "_") name = ''.join([c for c in name if c in safechars]) pl.savefig(name+extension) pl.close()