Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/sst/core/baseComponent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ BaseComponent::getCurrentSimTime(const std::string& base) const
TimeConverter* tc = Simulation_impl::getTimeLord()->getTimeConverter(base);
ret = getCurrentSimTime(*tc);
}
catch ( std::underflow_error& e ) {
catch ( const std::underflow_error& e ) {
// base is too small for the core timebase, fall back to using UnitAlgebra
ret = processCurrentTimeWithUnderflowedBase(base);
}
Expand Down
4 changes: 2 additions & 2 deletions src/sst/core/configBase.cc
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ flag_default_true(bool& var, std::string arg)
try {
var = SST::Core::from_string<bool>(arg);
}
catch ( std::exception& e ) {
catch ( const std::exception& e ) {
fprintf(stderr, "ERROR: For option \"%s\", failed to parse \"%s\" as a boolean\n",
ConfigBase::currently_parsing_option.c_str(), arg.c_str());
return -1;
Expand All @@ -105,7 +105,7 @@ flag_default_false(bool& var, std::string arg)
try {
var = SST::Core::from_string<bool>(arg);
}
catch ( std::exception& e ) {
catch ( const std::exception& e ) {
fprintf(stderr, "ERROR: For option \"%s\", failed to parse \"%s\" as a boolean\n",
ConfigBase::currently_parsing_option.c_str(), arg.c_str());
return -1;
Expand Down
4 changes: 2 additions & 2 deletions src/sst/core/configBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ from_string(T& var, std::string arg)
try {
var = SST::Core::from_string<T>(arg);
}
catch ( std::exception& e ) {
catch ( const std::exception& e ) {
fprintf(stderr, "ERROR: For option \"%s\", failed to parse argument: \"%s\"\n",
ConfigBase::currently_parsing_option.c_str(), arg.c_str());
return -1;
Expand All @@ -759,7 +759,7 @@ from_string_default(T& var, std::string arg, const T& default_value)
try {
var = SST::Core::from_string<T>(arg);
}
catch ( std::exception& e ) {
catch ( const std::exception& e ) {
fprintf(stderr, "ERROR: For option \"%s\", failed to parse argument: \"%s\"\n",
ConfigBase::currently_parsing_option.c_str(), arg.c_str());
return -1;
Expand Down
2 changes: 1 addition & 1 deletion src/sst/core/configShared.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class ConfigShared : public ConfigBase
val = value;
return 0;
}
catch ( std::invalid_argument& e ) {
catch ( const std::invalid_argument& e ) {
fprintf(stderr, "Failed to parse '%s' as number for option --verbose\n", arg.c_str());
return -1;
}
Expand Down
68 changes: 36 additions & 32 deletions src/sst/core/impl/interactive/simpleDebug.cc
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ SimpleDebugger::cmd_verbose(std::vector<std::string>& tokens)
try {
verbosity = SST::Core::from_string<uint32_t>(tokens[1]);
}
catch ( std::invalid_argument& e ) {
catch ( const std::invalid_argument& e ) {
std::cout << "Invalid mask " << tokens[1] << std::endl;
}
}
Expand Down Expand Up @@ -521,7 +521,7 @@ SimpleDebugger::cmd_print(std::vector<std::string>& tokens)
try {
recurse = SST::Core::from_string<int>(num);
}
catch ( std::invalid_argument& e ) {
catch ( const std::invalid_argument& e ) {
printf("Invalid number format specified with -r: %s\n", tok.c_str());
return;
}
Expand Down Expand Up @@ -617,7 +617,7 @@ SimpleDebugger::cmd_set(std::vector<std::string>& tokens)
try {
var->set(value);
}
catch ( std::exception& e ) {
catch ( const std::exception& e ) {
printf("Invalid format: %s\n", tokens[2].c_str());
}
var->selectParent();
Expand All @@ -640,7 +640,7 @@ SimpleDebugger::cmd_run(std::vector<std::string>& tokens)
std::string msg = format_string("Ran clock for %" PRI_SIMTIME " sim cycles", tc->getFactor());
schedule_interactive(tc->getFactor(), msg);
}
catch ( std::exception& e ) {
catch ( const std::exception& e ) {
printf("Unknown time in call to run: %s\n", tokens[1].c_str());
return;
}
Expand Down Expand Up @@ -928,7 +928,7 @@ SimpleDebugger::cmd_history(std::vector<std::string>& tokens)
try {
recs = (int)SST::Core::from_string<int>(tokens[1]);
}
catch ( std::invalid_argument& e ) {
catch ( const std::invalid_argument& e ) {
std::cout << "history: Ignoring arg1 (" << tokens[1] << ")" << std::endl;
}
}
Expand Down Expand Up @@ -1004,25 +1004,20 @@ SimpleDebugger::cmd_spinThread(std::vector<std::string>& UNUSED(tokens))
Core::Serialization::ObjectMapComparison*
parseComparison(std::vector<std::string>& tokens, size_t& index, Core::Serialization::ObjectMap* obj, std::string& name)
{

std::string var("");
Core::Serialization::ObjectMapComparison::Op op = Core::Serialization::ObjectMapComparison::Op::INVALID;
std::string v2("");
std::string name2("");
std::string opstr("");

// Get first comparison
var = tokens[index++];
if ( index == tokens.size() ) {
std::string var = tokens[index++];
if ( index >= tokens.size() ) {
printf("Invalid format for trigger test\n");
return nullptr;
}
opstr = tokens[index++];
op = Core::Serialization::ObjectMapComparison::getOperationFromString(opstr);
std::string opstr = tokens[index++];
Core::Serialization::ObjectMapComparison::Op op =
Core::Serialization::ObjectMapComparison::getOperationFromString(opstr);

std::string v2;
if ( op != Core::Serialization::ObjectMapComparison::Op::CHANGED ) {
if ( index == tokens.size() ) {
printf("Invalid format for trigger test. Valid formats are <var> changed"
" and <var> <op> <val>\n");
if ( index >= tokens.size() ) {
printf("Invalid format for trigger test. Valid formats are <var> changed and <var> <op> <val>\n");
return nullptr;
}
v2 = tokens[index++];
Expand Down Expand Up @@ -1054,6 +1049,17 @@ parseComparison(std::vector<std::string>& tokens, size_t& index, Core::Serializa

name = obj->getFullName() + "/" + var;

// In changed mode, we do not use v2
if ( op == Core::Serialization::ObjectMapComparison::Op::CHANGED ) {
try {
return map->getComparison(name, op, ""); // Can throw an exception
}
catch ( const std::exception& e ) {
printf("Invalid argument passed to trigger test: %s %s\n", var.c_str(), opstr.c_str());
return nullptr;
}
}

// Check if v2 is a variable
Core::Serialization::ObjectMap* map2 = obj->findVariable(v2);

Expand All @@ -1069,23 +1075,21 @@ parseComparison(std::vector<std::string>& tokens, size_t& index, Core::Serializa
return nullptr;
}

name2 = obj->getFullName() + "/" + v2;
std::string name2 = obj->getFullName() + "/" + v2;
try {
auto* c = map->getComparisonVar(name, op, name2, map2); // Can throw an exception
return c;
return map->getComparisonVar(name, op, name2, map2); // Can throw an exception
}
catch ( std::exception& e ) {
catch ( const std::exception& e ) {
printf("Invalid argument passed to trigger test: %s %s %s\n", var.c_str(), opstr.c_str(), v2.c_str());
return nullptr;
}
}
else { // V2 is value string
// printf("v2 is value string\n");
try {
auto* c = map->getComparison(name, op, v2); // Can throw an exception
return c;
return map->getComparison(name, op, v2); // Can throw an exception
}
catch ( std::exception& e ) {
catch ( const std::exception& e ) {
printf("Invalid argument passed to trigger test: %s %s %s\n", var.c_str(), opstr.c_str(), v2.c_str());
return nullptr;
}
Expand Down Expand Up @@ -1262,7 +1266,7 @@ SimpleDebugger::cmd_watch(std::vector<std::string>& tokens)
return;
}
} // try/catch TODO: need to revisit what can actually throw an exception
catch ( std::exception& e ) {
catch ( const std::exception& e ) {
printf("Invalid format for watch command\n");
return;
}
Expand Down Expand Up @@ -1346,7 +1350,7 @@ SimpleDebugger::cmd_unwatch(std::vector<std::string>& tokens)
try {
index = (long unsigned int)SST::Core::from_string<int>(tokens[1]);
}
catch ( std::invalid_argument& e ) {
catch ( const std::invalid_argument& e ) {
printf("Invalid index format specified. The unwatch command requires that "
"one of the index shown when "
"\"watch\" is run with no arguments be specified\n");
Expand Down Expand Up @@ -1423,7 +1427,7 @@ parseTraceBuffer(std::vector<std::string>& tokens, size_t& index, Core::Serializ
// Setup Trace Buffer
return new Core::Serialization::TraceBuffer(obj, bufsize, pdelay);
}
catch ( std::exception& e ) {
catch ( const std::exception& e ) {
std::cout << "Invalid buffer argument passed to trace command\n";
return nullptr;
}
Expand Down Expand Up @@ -1559,7 +1563,7 @@ SimpleDebugger::cmd_trace(std::vector<std::string>& tokens)
return;
}
}
catch ( std::exception& e ) {
catch ( const std::exception& e ) {
printf("Invalid format for trace command\n");
return;
}
Expand Down Expand Up @@ -1705,7 +1709,7 @@ CommandHistoryBuffer::findEvent(const std::string& s, std::string& newcmd)
try {
event = (int)SST::Core::from_string<int>(s);
}
catch ( std::invalid_argument& e ) {
catch ( const std::invalid_argument& e ) {
// std::cout << "history: invalid event: " << s << std::endl;
return false;
}
Expand Down Expand Up @@ -1734,7 +1738,7 @@ CommandHistoryBuffer::findOffset(const std::string& s, std::string& newcmd)
try {
offset = (int)SST::Core::from_string<int>(s);
}
catch ( std::invalid_argument& e ) {
catch ( const std::invalid_argument& e ) {
std::cout << "history: invalid offset: " << s << std::endl;
return false;
}
Expand Down
12 changes: 6 additions & 6 deletions src/sst/core/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ start_graph_creation(ConfigGraph*& graph, const RankInfo& world_size, const Rank
try {
model_name = extension_map.at(extension);
}
catch ( std::exception& e ) {
catch ( const std::exception& e ) {
std::cerr << "Unsupported SDL file type: \"" << extension << "\"" << std::endl;
SST_Exit(EXIT_FAILURE);
}
Expand All @@ -356,7 +356,7 @@ start_graph_creation(ConfigGraph*& graph, const RankInfo& world_size, const Rank
try {
graph = modelGen->createConfigGraph();
}
catch ( std::exception& e ) {
catch ( const std::exception& e ) {
g_output.fatal(CALL_INFO, -1, "Error encountered during config-graph generation: %s\n", e.what());
}
}
Expand All @@ -373,7 +373,7 @@ start_graph_creation(ConfigGraph*& graph, const RankInfo& world_size, const Rank
try {
Comms::broadcast(cfg, 0);
}
catch ( std::exception& e ) {
catch ( const std::exception& e ) {
g_output.fatal(CALL_INFO, -1, "Error encountered broadcasting configuration object: %s\n", e.what());
}
}
Expand Down Expand Up @@ -418,7 +418,7 @@ start_partitioning(const RankInfo& world_size, const RankInfo& myRank, Factory*
delete pgraph;
}
}
catch ( std::exception& e ) {
catch ( const std::exception& e ) {
g_output.fatal(CALL_INFO, -1, "Error encountered during graph partitioning phase: %s\n", e.what());
}

Expand Down Expand Up @@ -1200,7 +1200,7 @@ main(int argc, char* argv[])
delete your_graph;
}
}
catch ( std::exception& e ) {
catch ( const std::exception& e ) {
g_output.fatal(CALL_INFO, -1, "Error encountered during graph broadcast: %s\n", e.what());
}
}
Expand Down Expand Up @@ -1333,7 +1333,7 @@ main(int argc, char* argv[])

Simulation_impl::shutdown();
}
catch ( std::exception& e ) {
catch ( const std::exception& e ) {
g_output.fatal(CALL_INFO, -1, "Error encountered during simulation: %s\n", e.what());
}
Simulation_impl::basicPerf.endRegion("execute");
Expand Down
2 changes: 1 addition & 1 deletion src/sst/core/model/python/pymodel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1216,7 +1216,7 @@ SSTPythonModelDefinition::initModel(
try {
enablePythonCoverage = SST::Core::from_string<bool>(value);
}
catch ( std::invalid_argument& e ) {
catch ( const std::invalid_argument& e ) {
output->fatal(CALL_INFO, 1,
"ERROR: Invalid format for SST_CONFIG_PYTHON_COVERAGE. Valid boolean pairs are true/false, t/f, "
"yes/no, y/n, on/off, or 1/0\n");
Expand Down
2 changes: 1 addition & 1 deletion src/sst/core/output.cc
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ TraceFunction::TraceFunction(uint32_t line, const char* file, const char* func,
try {
sim = Simulation_impl::getSimulation();
}
catch ( std::out_of_range& e ) {
catch ( const std::out_of_range& e ) {
// do nothing
}

Expand Down
3 changes: 0 additions & 3 deletions src/sst/core/serialization/objectMap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@

namespace SST::Core::Serialization {

// Static variable instantiation
const std::multimap<std::string, ObjectMap*> ObjectMap::emptyVars;

std::string
ObjectMap::getFullName() const
{
Expand Down
Loading
Loading