- simgrid::surf::NetworkIBModel* ibModel = (simgrid::surf::NetworkIBModel*)surf_network_model;
- simgrid::surf::IBNode* act_src;
- simgrid::surf::IBNode* act_dst;
-
- auto asrc = ibModel->active_nodes.find(src->getName());
- if (asrc != ibModel->active_nodes.end()) {
- act_src = asrc->second;
- } else {
- throw std::out_of_range(std::string("Could not find '") + src->getCname() + "' active comms !");
- }
-
- auto adst = ibModel->active_nodes.find(dst->getName());
- if (adst != ibModel->active_nodes.end()) {
- act_dst = adst->second;
- } else {
- throw std::out_of_range(std::string("Could not find '") + dst->getCname() + "' active comms !");
- }
-
- ibModel->active_comms[action]=std::make_pair(act_src, act_dst);
+ auto* ibModel = static_cast<simgrid::kernel::resource::NetworkIBModel*>(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());