X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/55a08c7439db5b0335a5b26e40b3a46e1e03d3e8..ccf671a80a47f0489c33fb1dc2a8aadfc28b5b88:/src/surf/network_ib.cpp diff --git a/src/surf/network_ib.cpp b/src/surf/network_ib.cpp index 0a8c889a61..9653b666e9 100644 --- a/src/surf/network_ib.cpp +++ b/src/surf/network_ib.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2014-2020. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2014-2021. 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. */ @@ -12,7 +12,7 @@ #include #include -XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_network); +XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(res_network); static void IB_create_host_callback(simgrid::s4u::Host const& host) { @@ -43,9 +43,9 @@ static void IB_action_state_changed_callback(simgrid::kernel::resource::NetworkA static void IB_action_init_callback(simgrid::kernel::resource::NetworkAction& action) { - simgrid::kernel::resource::NetworkIBModel* ibModel = (simgrid::kernel::resource::NetworkIBModel*)surf_network_model; - simgrid::kernel::resource::IBNode* act_src = &ibModel->active_nodes.at(action.get_src().get_name()); - simgrid::kernel::resource::IBNode* act_dst = &ibModel->active_nodes.at(action.get_dst().get_name()); + auto* ibModel = static_cast(surf_network_model); + auto* act_src = &ibModel->active_nodes.at(action.get_src().get_name()); + auto* act_dst = &ibModel->active_nodes.at(action.get_dst().get_name()); ibModel->active_comms[&action] = std::make_pair(act_src, act_dst); ibModel->updateIBfactors(&action, act_src, act_dst, 0); @@ -186,9 +186,8 @@ void NetworkIBModel::updateIBfactors(NetworkAction* action, IBNode* from, IBNode to->ActiveCommsDown[from] -= 1; to->nbActiveCommsDown--; - std::vector::iterator it = - std::find_if(begin(from->ActiveCommsUp), end(from->ActiveCommsUp), - [action](const ActiveComm* comm) { return comm->action == action; }); + auto it = std::find_if(begin(from->ActiveCommsUp), end(from->ActiveCommsUp), + [action](const ActiveComm* comm) { return comm->action == action; }); if (it != std::end(from->ActiveCommsUp)) { delete *it; from->ActiveCommsUp.erase(it); @@ -196,7 +195,7 @@ void NetworkIBModel::updateIBfactors(NetworkAction* action, IBNode* from, IBNode action->unref(); } else { action->ref(); - ActiveComm* comm = new ActiveComm(); + auto* comm = new ActiveComm(); comm->action = action; comm->destination = to; from->ActiveCommsUp.push_back(comm);