#include <simgrid/kernel/routing/NetPoint.hpp>
-#include "simgrid/sg_config.hpp"
#include "src/kernel/EngineImpl.hpp"
#include "src/kernel/activity/CommImpl.hpp"
#include "src/kernel/resource/HostImpl.hpp"
#include "src/kernel/resource/models/network_ib.hpp"
+#include "src/simgrid/math_utils.h"
+#include "src/simgrid/module.hpp"
+#include "src/simgrid/sg_config.hpp"
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(res_network);
-/*********
- * Model *
- *********/
-
-/************************************************************************/
-/* New model based on MPI contention model for Infiniband platforms */
-/************************************************************************/
+/****************************************************************/
+/* Model based on MPI contention model for Infiniband platforms */
+/****************************************************************/
/* @Inproceedings{mescal_vienne_phd, */
/* author={Jérôme Vienne}, */
/* title={prédiction de performances d’applications de calcul haute performance sur réseau Infiniband}, */
engine->get_netzone_root()->set_network_model(net_model);
simgrid::s4u::Link::on_communication_state_change_cb(NetworkIBModel::IB_action_state_changed_callback);
- simgrid::kernel::activity::CommImpl::on_start.connect(NetworkIBModel::IB_comm_start_callback);
+ simgrid::s4u::Comm::on_start_cb(NetworkIBModel::IB_comm_start_callback);
simgrid::s4u::Host::on_creation_cb(NetworkIBModel::IB_create_host_callback);
simgrid::config::set_default<double>("network/weight-S", 8775);
});
auto [src, dst] = ibModel->active_comms[&action];
XBT_DEBUG("IB callback - action %p finished", &action);
- ibModel->update_IB_factors(&action, src, dst, 1);
+ ibModel->update_IB_factors(&action, src, dst, true);
ibModel->active_comms.erase(&action);
}
-void NetworkIBModel::IB_comm_start_callback(const activity::CommImpl& comm)
+void NetworkIBModel::IB_comm_start_callback(const s4u::Comm& comm)
{
- auto* action = static_cast<NetworkAction*>(comm.model_action_);
+ auto* action = static_cast<NetworkAction*>(static_cast<activity::CommImpl*>(comm.get_impl())->model_action_);
auto* ibModel = static_cast<NetworkIBModel*>(action->get_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->update_IB_factors(action, act_src, act_dst, 0);
+ ibModel->update_IB_factors(action, act_src, act_dst, false);
}
NetworkIBModel::NetworkIBModel(const std::string& name) : NetworkCm02Model(name)
}
}
-void NetworkIBModel::update_IB_factors(NetworkAction* action, IBNode* from, IBNode* to, int remove) const
+void NetworkIBModel::update_IB_factors(NetworkAction* action, IBNode* from, IBNode* to, bool remove) const
{
if (from == to) // disregard local comms (should use loopback)
return;