X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/ccafe2d8af6c598a53ab9a6fa588ce39c776555d..84402e8e2ee2a2d0bef25fdceb0a263ed8b471f6:/src/surf/network_ib.cpp diff --git a/src/surf/network_ib.cpp b/src/surf/network_ib.cpp index 66cc73017b..70782d1115 100644 --- a/src/surf/network_ib.cpp +++ b/src/surf/network_ib.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2014-2019. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2014-2020. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -41,8 +41,8 @@ static void IB_action_state_changed_callback(simgrid::kernel::resource::NetworkA ((NetworkIBModel*)surf_network_model)->active_comms.erase(&action); } -static void IB_action_init_callback(simgrid::kernel::resource::NetworkAction& action, simgrid::s4u::Host* src, - simgrid::s4u::Host* dst) +static void IB_action_init_callback(simgrid::kernel::resource::NetworkAction& action, const simgrid::s4u::Host* src, + const simgrid::s4u::Host* dst) { simgrid::kernel::resource::NetworkIBModel* ibModel = (simgrid::kernel::resource::NetworkIBModel*)surf_network_model; simgrid::kernel::resource::IBNode* act_src = &ibModel->active_nodes.at(src->get_name()); @@ -94,26 +94,26 @@ NetworkIBModel::NetworkIBModel() : NetworkSmpiModel() try { Be = std::stod(radical_elements.front()); - } catch (std::invalid_argument& ia) { + } catch (const std::invalid_argument& ia) { throw std::invalid_argument(std::string("First part of smpi/IB-penalty-factors is not numerical:") + ia.what()); } try { Bs = std::stod(radical_elements.at(1)); - } catch (std::invalid_argument& ia) { + } catch (const std::invalid_argument& ia) { throw std::invalid_argument(std::string("Second part of smpi/IB-penalty-factors is not numerical:") + ia.what()); } try { ys = std::stod(radical_elements.back()); - } catch (std::invalid_argument& ia) { + } catch (const std::invalid_argument& ia) { throw std::invalid_argument(std::string("Third part of smpi/IB-penalty-factors is not numerical:") + ia.what()); } } void NetworkIBModel::computeIBfactors(IBNode* root) { - double num_comm_out = static_cast(root->ActiveCommsUp.size()); + double num_comm_out = root->ActiveCommsUp.size(); double max_penalty_out = 0.0; // first, compute all outbound penalties to get their max for (std::vector::iterator it = root->ActiveCommsUp.begin(); it != root->ActiveCommsUp.end(); ++it) {