try {
id = std::stoi(args[1]);
mailbox_ = simgrid::s4u::Mailbox::by_name(std::to_string(id));
- } catch (std::invalid_argument& ia) {
+ } catch (const std::invalid_argument&) {
throw std::invalid_argument(std::string("Invalid ID:") + args[1].c_str());
}
try {
deadline = std::stod(args[2]);
- } catch (std::invalid_argument& ia) {
+ } catch (const std::invalid_argument&) {
throw std::invalid_argument(std::string("Invalid deadline:") + args[2].c_str());
}
xbt_assert(deadline > 0, "Wrong deadline supplied");
try {
XBT_DEBUG("Sending a peer request to the tracker.");
tracker_mailbox->put(peer_request, TRACKER_COMM_SIZE, GET_PEERS_TIMEOUT);
- } catch (simgrid::TimeoutError& e) {
+ } catch (const simgrid::TimeoutError&) {
XBT_DEBUG("Timeout expired when requesting peers to tracker");
delete peer_request;
return false;
if (id != peer_id)
connected_peers.emplace(peer_id, Connection(peer_id));
delete answer;
- } catch (simgrid::TimeoutError& e) {
+ } catch (const simgrid::TimeoutError&) {
XBT_DEBUG("Timeout expired when requesting peers to tracker");
return false;
}
// Retrieving end time
try {
deadline = std::stod(args[1]);
- } catch (std::invalid_argument& ia) {
+ } catch (const std::invalid_argument&) {
throw std::invalid_argument(std::string("Invalid deadline:") + args[1].c_str());
}
xbt_assert(deadline > 0, "Wrong deadline supplied");
XBT_DEBUG("Sending a 'PREDECESSOR_LEAVING' to my successor %d", fingers_[0]);
try {
simgrid::s4u::Mailbox::by_name(std::to_string(fingers_[0]))->put(pred_msg, 10, timeout);
- } catch (simgrid::TimeoutError& e) {
+ } catch (const simgrid::TimeoutError&) {
XBT_DEBUG("Timeout expired when sending a 'PREDECESSOR_LEAVING' to my successor %d", fingers_[0]);
delete pred_msg;
}
try {
simgrid::s4u::Mailbox::by_name(std::to_string(pred_id_))->put(succ_msg, 10, timeout);
- } catch (simgrid::TimeoutError& e) {
+ } catch (const simgrid::TimeoutError&) {
XBT_DEBUG("Timeout expired when sending a 'SUCCESSOR_LEAVING' to my predecessor %d", pred_id_);
delete succ_msg;
}
XBT_DEBUG("Sending a 'Predecessor Alive' request to my predecessor %d", pred_id_);
try {
mailbox->put(message, 10, timeout);
- } catch (simgrid::TimeoutError& e) {
+ } catch (const simgrid::TimeoutError&) {
XBT_DEBUG("Failed to send the 'Predecessor Alive' request to %d", pred_id_);
delete message;
return;
comm->wait_for(timeout);
XBT_DEBUG("Received the answer to my 'Predecessor Alive': my predecessor %d is alive", pred_id_);
delete static_cast<ChordMessage*>(data);
- } catch (simgrid::TimeoutError& e) {
+ } catch (const simgrid::TimeoutError&) {
XBT_DEBUG("Failed to receive the answer to my 'Predecessor Alive' request");
pred_id_ = -1;
}
XBT_DEBUG("Sending a 'Get Predecessor' request to %d", ask_to);
try {
mailbox->put(message, 10, timeout);
- } catch (simgrid::TimeoutError& e) {
+ } catch (const simgrid::TimeoutError&) {
XBT_DEBUG("Failed to send the 'Get Predecessor' request to %d", ask_to);
delete message;
return predecessor_id;
answer->answer_id);
predecessor_id = answer->answer_id;
delete answer;
- } catch (simgrid::TimeoutError& e) {
+ } catch (const simgrid::TimeoutError&) {
XBT_DEBUG("Failed to receive the answer to my 'Get Predecessor' request");
delete static_cast<ChordMessage*>(data);
}
XBT_DEBUG("Sending a 'Find Successor' request to %d for id %d", ask_to, id);
try {
mailbox->put(message, 10, timeout);
- } catch (simgrid::TimeoutError& e) {
+ } catch (const simgrid::TimeoutError&) {
XBT_DEBUG("Failed to send the 'Find Successor' request to %d for id %d", ask_to, id_);
delete message;
return successor;
answer->request_id, id_, answer->answer_id);
successor = answer->answer_id;
delete answer;
- } catch (simgrid::TimeoutError& e) {
+ } catch (const simgrid::TimeoutError&) {
XBT_DEBUG("Failed to receive the answer to my 'Find Successor' request");
delete static_cast<ChordMessage*>(data);
}
simgrid::s4u::this_actor::parallel_execute(hosts, computation_amounts, communication_amounts,
10.0 /* timeout (in seconds)*/);
xbt_die("Woops, this did not timeout as expected... Please report that bug.");
- } catch (simgrid::TimeoutError& e) {
+ } catch (const simgrid::TimeoutError&) {
XBT_INFO("Caught the expected timeout exception.");
}
XBT_INFO("Send a message to %s", mailbox->get_cname());
mailbox->put(payload, comm_size, 10.0);
XBT_INFO("Send to %s completed", mailbox->get_cname());
- } catch (simgrid::TimeoutError& e) {
+ } catch (const simgrid::TimeoutError&) {
delete payload;
XBT_INFO("Mmh. Got timeouted while speaking to '%s'. Nevermind. Let's keep going!", mailbox->get_cname());
} catch (xbt_ex& e) {
double* payload = new double(-1.0);
try {
mailbox->put(payload, 0, 1.0);
- } catch (simgrid::TimeoutError& e) {
+ } catch (const simgrid::TimeoutError&) {
delete payload;
XBT_INFO("Mmh. Got timeouted while speaking to '%s'. Nevermind. Let's keep going!", mailbox->get_cname());
} catch (xbt_ex& e) {
try {
this->num_groups_ = std::stoi(tmp[0]);
- } catch (std::invalid_argument& ia) {
+ } catch (const std::invalid_argument&) {
throw std::invalid_argument(std::string("Invalid number of groups:") + tmp[0]);
}
try {
this->num_links_blue_ = std::stoi(tmp[1]);
- } catch (std::invalid_argument& ia) {
+ } catch (const std::invalid_argument&) {
throw std::invalid_argument(std::string("Invalid number of links for the blue level:") + tmp[1]);
}
// Black network : number of chassis/group, number of links between each router on the black network
try {
this->num_chassis_per_group_ = std::stoi(tmp[0]);
- } catch (std::invalid_argument& ia) {
+ } catch (const std::invalid_argument&) {
throw std::invalid_argument(std::string("Invalid number of groups:") + tmp[0]);
}
try {
this->num_links_black_ = std::stoi(tmp[1]);
- } catch (std::invalid_argument& ia) {
+ } catch (const std::invalid_argument&) {
throw std::invalid_argument(std::string("Invalid number of links for the black level:") + tmp[1]);
}
try {
this->num_blades_per_chassis_ = std::stoi(tmp[0]);
- } catch (std::invalid_argument& ia) {
+ } catch (const std::invalid_argument&) {
throw std::invalid_argument(std::string("Invalid number of groups:") + tmp[0]);
}
try {
this->num_links_green_ = std::stoi(tmp[1]);
- } catch (std::invalid_argument& ia) {
+ } catch (const std::invalid_argument&) {
throw std::invalid_argument(std::string("Invalid number of links for the green level:") + tmp[1]);
}
// The last part of topo_parameters should be the number of nodes per blade
try {
this->num_nodes_per_blade_ = std::stoi(parameters[3]);
- } catch (std::invalid_argument& ia) {
+ } catch (const std::invalid_argument&) {
throw std::invalid_argument(std::string("Last parameter is not the amount of nodes per blade:") + parameters[3]);
}
// The first parts of topo_parameters should be the levels number
try {
this->levels_ = std::stoi(parameters[0]);
- } catch (std::invalid_argument& ia) {
+ } catch (const std::invalid_argument&) {
throw std::invalid_argument(std::string("First parameter is not the amount of levels:") + parameters[0]);
}
for (size_t i = 0; i < tmp.size(); i++) {
try {
this->num_children_per_node_.push_back(std::stoi(tmp[i]));
- } catch (std::invalid_argument& ia) {
+ } catch (const std::invalid_argument&) {
throw std::invalid_argument(std::string("Invalid lower level node number:") + tmp[i]);
}
}
for (size_t i = 0; i < tmp.size(); i++) {
try {
this->num_parents_per_node_.push_back(std::stoi(tmp[i]));
- } catch (std::invalid_argument& ia) {
+ } catch (const std::invalid_argument&) {
throw std::invalid_argument(std::string("Invalid upper level node number:") + tmp[i]);
}
}
for (size_t i = 0; i < tmp.size(); i++) {
try {
this->num_port_lower_level_.push_back(std::stoi(tmp[i]));
- } catch (std::invalid_argument& ia) {
+ } catch (const std::invalid_argument&) {
throw std::invalid_argument(std::string("Invalid lower level port number:") + tmp[i]);
}
}
int res = SIMGRID_MC_EXIT_SUCCESS;
try {
checker->run();
- } catch (simgrid::mc::DeadlockError& de) {
+ } catch (const simgrid::mc::DeadlockError&) {
res = SIMGRID_MC_EXIT_DEADLOCK;
- } catch (simgrid::mc::TerminationError& te) {
+ } catch (const simgrid::mc::TerminationError&) {
res = SIMGRID_MC_EXIT_NON_TERMINATION;
- } catch (simgrid::mc::LivenessError& le) {
+ } catch (const simgrid::mc::LivenessError&) {
res = SIMGRID_MC_EXIT_LIVENESS;
}
checker = nullptr;
/* I am the receiver */
(*task_received)->set_not_used();
}
- } catch (simgrid::TimeoutError& e) {
+ } catch (const simgrid::TimeoutError&) {
status_ = MSG_TIMEOUT;
finished = true;
- } catch (simgrid::CancelException& e) {
+ } catch (const simgrid::CancelException&) {
status_ = MSG_TASK_CANCELED;
finished = true;
} catch (xbt_ex& e) {
}
/* FIXME: these functions are not traceable */
- } catch (simgrid::TimeoutError& e) {
+ } catch (const simgrid::TimeoutError&) {
status_ = MSG_TIMEOUT;
- } catch (simgrid::CancelException& e) {
+ } catch (const simgrid::CancelException&) {
status_ = MSG_TASK_CANCELED;
} catch (xbt_ex& e) {
if (e.category == network_error)
try {
sg_actor_sleep_for(duration);
return MSG_OK;
- } catch (simgrid::HostFailureException& e) {
+ } catch (const simgrid::HostFailureException&) {
return MSG_HOST_FAILURE;
}
}
set_not_used();
XBT_DEBUG("Execution task '%s' finished", get_cname());
- } catch (HostFailureException& e) {
+ } catch (const HostFailureException&) {
status = MSG_HOST_FAILURE;
- } catch (TimeoutError& e) {
+ } catch (const TimeoutError&) {
status = MSG_TIMEOUT;
- } catch (CancelException& e) {
+ } catch (const CancelException&) {
status = MSG_TASK_CANCELED;
}
s4u::CommPtr s4u_comm = send_async(alias, nullptr, false);
comm = s4u_comm;
comm->wait_for(timeout);
- } catch (simgrid::TimeoutError& e) {
+ } catch (const simgrid::TimeoutError&) {
ret = MSG_TIMEOUT;
- } catch (simgrid::CancelException& e) {
+ } catch (const simgrid::CancelException&) {
ret = MSG_HOST_FAILURE;
} catch (xbt_ex& e) {
if (e.category == network_error)
*task = static_cast<msg_task_t>(payload);
XBT_DEBUG("Got task %s from %s", (*task)->get_cname(), alias);
(*task)->set_not_used();
- } catch (simgrid::HostFailureException& e) {
+ } catch (const simgrid::HostFailureException&) {
ret = MSG_HOST_FAILURE;
- } catch (simgrid::TimeoutError& e) {
+ } catch (const simgrid::TimeoutError&) {
ret = MSG_TIMEOUT;
- } catch (simgrid::CancelException& e) {
+ } catch (const simgrid::CancelException&) {
ret = MSG_TASK_CANCELED;
} catch (xbt_ex& e) {
if (e.category == network_error)
if (off_power_str != nullptr) {
try {
this->watts_off_ = std::stod(std::string(off_power_str));
- } catch (std::invalid_argument& ia) {
+ } catch (const std::invalid_argument&) {
throw std::invalid_argument(std::string("Invalid value for property watt_off of host ") + host_->get_cname() +
": " + off_power_str);
}
/* max_power is the power consumed at 100% link load */
try {
idle_ = std::stod(current_power_values.front());
- } catch (std::invalid_argument& ia) {
+ } catch (const std::invalid_argument&) {
throw std::invalid_argument(std::string("Invalid idle power value for link ") + this->link_->get_cname());
}
try {
busy_ = std::stod(current_power_values.back());
- } catch (std::invalid_argument& ia) {
+ } catch (const std::invalid_argument&) {
throw std::invalid_argument(std::string("Invalid busy power value for link ") + this->link_->get_cname());
}
}
comm = mbox->put_init(msg, size)->set_rate(mig_speed)->wait_for(timeout);
else
comm = mbox->put_async(msg, size)->wait_for(timeout);
- } catch (xbt_ex& e) {
+ } catch (const xbt_ex&) {
if (comm) {
sg_size_t remaining = static_cast<sg_size_t>(comm->get_remaining());
XBT_VERB("timeout (%lf s) in sending_migration_data, remaining %llu bytes of %llu", timeout, remaining, size);
} else if (sent > ramsize)
XBT_CRITICAL("bug");
- } catch (xbt_ex& e) {
+ } catch (const xbt_ex&) {
// hostfailure (if you want to know whether this is the SRC or the DST check directly in send_migration_data code)
// Stop the dirty page tracking an return (there is no memory space to release)
sg_vm_stop_dirty_page_tracking(vm_);
try {
XBT_DEBUG("Stage 2, gonna send %llu", updated_size);
sent = sendMigrationData(updated_size, 2, stage2_round, mig_speed, mig_timeout);
- } catch (xbt_ex& e) {
+ } catch (const xbt_ex&) {
// hostfailure (if you want to know whether this is the SRC or the DST check directly in send_migration_data
// code)
// Stop the dirty page tracking an return (there is no memory space to release)
try {
XBT_DEBUG("Stage 3: Gonna send %zu bytes", remaining_size);
sendMigrationData(remaining_size, 3, 0, mig_speed, -1);
- } catch (xbt_ex& e) {
+ } catch (const xbt_ex&) {
// hostfailure (if you want to know whether this is the SRC or the DST check directly in send_migration_data code)
// Stop the dirty page tracking an return (there is no memory space to release)
vm_->resume();
try {
double version = std::stod(std::string(A_dax__adag_version));
xbt_assert(version == 2.1, "Expected version 2.1 in <adag> tag, got %f. Fix the parser or your file", version);
- } catch (std::invalid_argument& ia) {
+ } catch (const std::invalid_argument&) {
throw std::invalid_argument(std::string("Parse error: ") + A_dax__adag_version + " is not a double");
}
}
current_job = SD_task_create_comp_seq(name.c_str(), nullptr, runtime);
jobs.insert({A_dax__job_id, current_job});
xbt_dynar_push(result, ¤t_job);
- } catch (std::invalid_argument& ia) {
+ } catch (const std::invalid_argument&) {
throw std::invalid_argument(std::string("Parse error: ") + A_dax__job_runtime + " is not a double");
}
}
double size;
try {
size = std::stod(std::string(A_dax__uses_size));
- } catch (std::invalid_argument& ia) {
+ } catch (const std::invalid_argument&) {
throw std::invalid_argument(std::string("Parse error: ") + A_dax__uses_size + " is not a double");
}
bool is_input = (A_dax__uses_link == A_dax__uses_link_input);
parse_status = surf_parse();
surf_parse_close();
xbt_assert(not parse_status, "Parse error at %s:%d", file.c_str(), surf_parse_lineno);
- }
- catch (xbt_ex& e) {
+ } catch (const xbt_ex&) {
XBT_ERROR(
"Unrecoverable error at %s:%d. The full exception stack follows, in case it helps you to diagnose the problem.",
file.c_str(), surf_parse_lineno);
if (factor_iter == factor_values.begin()) { /* first element */
try {
fact.factor = std::stoi(*factor_iter);
- } catch (std::invalid_argument& ia) {
+ } catch (const std::invalid_argument&) {
throw std::invalid_argument(std::string("Invalid factor in chunk ") + std::to_string(smpi_factor.size() + 1) +
": " + *factor_iter);
}
} else {
try {
fact.values.push_back(surf_parse_get_time((*factor_iter).c_str(), "smpi factor", ""));
- } catch (std::invalid_argument& ia) {
+ } catch (const std::invalid_argument&) {
throw std::invalid_argument(std::string("Invalid factor value ") + std::to_string(iteration) + " in chunk " +
std::to_string(smpi_factor.size() + 1) + ": " + *factor_iter);
}
if ((*request)->action_ != nullptr){
try{
*flag = simcall_comm_test((*request)->action_);
- }catch (xbt_ex& e) {
+ } catch (const xbt_ex&) {
*flag = 0;
return ret;
}
simcall_process_sleep(nsleeps*smpi_test_sleep);
try{
i = simcall_comm_testany(comms.data(), comms.size()); // The i-th element in comms matches!
- }catch (xbt_ex& e) {
+ } catch (const xbt_ex&) {
return 0;
}
try{
// this is not a detached send
simcall_comm_wait((*request)->action_, -1.0);
- }catch (xbt_ex& e) {
+ } catch (const xbt_ex&) {
XBT_VERB("Request cancelled");
}
}
try{
// this is not a detached send
i = simcall_comm_waitany(comms.data(), comms.size(), -1);
- }catch (xbt_ex& e) {
- XBT_INFO("request %d cancelled ",i);
+ } catch (const xbt_ex&) {
+ XBT_INFO("request %d cancelled ", i);
return i;
}
{
try {
return std::stod(s);
- } catch (std::invalid_argument& ia) {
+ } catch (const std::invalid_argument&) {
surf_parse_error(s + " is not a double");
}
}
{
try {
return std::stoi(s);
- } catch (std::invalid_argument& ia) {
+ } catch (const std::invalid_argument&) {
surf_parse_error(s + " is not a double");
}
}
std::abort();
}
- catch (simgrid::ForcefulKillException const& e) {
+ catch (const simgrid::ForcefulKillException&) {
XBT_ERROR("Received a ForcefulKillException at the top-level exception handler. Maybe a Java->C++ call that is not "
"protected "
"in a try/catch?");
try {
simgrid::dwarf::execute(ops, 3, state, stack);
- }
- catch(std::runtime_error& e) {
+ } catch (const std::runtime_error&) {
fprintf(stderr,"Expression evaluation error");
}
try {
ops[0].atom = DW_OP_drop;
simgrid::dwarf::execute(ops, 1, state, stack);
- } catch (simgrid::dwarf::evaluation_error& e) {
+ } catch (const simgrid::dwarf::evaluation_error&) {
caught_ex = true;
}
if (not caught_ex)
assert(stack.top() == a);
assert(stack.top(1) == b);
- }
- catch(std::runtime_error& e) {
+ } catch (const std::runtime_error&) {
fprintf(stderr,"Expression evaluation error");
}
}
assert(stack.size() == 1);
assert(stack.top() == foo);
- }
- catch(std::runtime_error& e) {
+ } catch (const std::runtime_error&) {
fprintf(stderr,"Expression evaluation error");
}
}
mfree(heapA, pointers[i]);
try {
mfree(heapA, pointers[i]);
- } catch(xbt_ex& e) {
+ } catch (const xbt_ex&) {
gotit = true;
}
if (not gotit)
bool gotit = false;
try {
mfree(heapA, pointers[i]);
- } catch(xbt_ex& e) {
+ } catch (const xbt_ex&) {
gotit = true;
}
if (not gotit)