-/* Copyright (c) 2014-2018. The SimGrid Team.
-*All rights reserved. */
+/* Copyright (c) 2014-2018. 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. */
-#include <utility>
-
+#include "src/surf/network_ib.hpp"
#include "simgrid/sg_config.hpp"
-#include "src/kernel/lmm/maxmin.hpp"
#include "src/surf/HostImpl.hpp"
-#include "src/surf/network_ib.hpp"
#include "src/surf/xml/platf.hpp"
+#include "surf/surf.hpp"
+
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_network);
static void IB_create_host_callback(simgrid::s4u::Host& host){
- using simgrid::surf::NetworkIBModel;
- using simgrid::surf::IBNode;
+ using simgrid::kernel::resource::IBNode;
+ using simgrid::kernel::resource::NetworkIBModel;
static int id=0;
// pour t->id -> rajouter une nouvelle struct dans le dict, pour stocker les comms actives
IBNode* act = new IBNode(id);
id++;
- ((NetworkIBModel*)surf_network_model)->active_nodes.insert({host.getName(), act});
+ ((NetworkIBModel*)surf_network_model)->active_nodes.insert({host.get_name(), act});
}
-static void IB_action_state_changed_callback(simgrid::surf::NetworkAction* action)
+static void IB_action_state_changed_callback(simgrid::kernel::resource::NetworkAction* action)
{
- using simgrid::surf::NetworkIBModel;
- using simgrid::surf::IBNode;
+ using simgrid::kernel::resource::IBNode;
+ using simgrid::kernel::resource::NetworkIBModel;
if (action->get_state() != simgrid::kernel::resource::Action::State::done)
return;
}
-static void IB_action_init_callback(simgrid::surf::NetworkAction* action, simgrid::s4u::Host* src,
+static void IB_action_init_callback(simgrid::kernel::resource::NetworkAction* action, simgrid::s4u::Host* src,
simgrid::s4u::Host* dst)
{
- simgrid::surf::NetworkIBModel* ibModel = (simgrid::surf::NetworkIBModel*)surf_network_model;
- simgrid::surf::IBNode* act_src;
- simgrid::surf::IBNode* act_dst;
+ simgrid::kernel::resource::NetworkIBModel* ibModel = (simgrid::kernel::resource::NetworkIBModel*)surf_network_model;
+ simgrid::kernel::resource::IBNode* act_src;
+ simgrid::kernel::resource::IBNode* act_dst;
- auto asrc = ibModel->active_nodes.find(src->getName());
+ auto asrc = ibModel->active_nodes.find(src->get_name());
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 !");
+ throw std::out_of_range(std::string("Could not find '") + src->get_cname() + "' active comms !");
}
- auto adst = ibModel->active_nodes.find(dst->getName());
+ auto adst = ibModel->active_nodes.find(dst->get_name());
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 !");
+ throw std::out_of_range(std::string("Could not find '") + dst->get_cname() + "' active comms !");
}
ibModel->active_comms[action]=std::make_pair(act_src, act_dst);
if (surf_network_model)
return;
- surf_network_model = new simgrid::surf::NetworkIBModel();
+ surf_network_model = new simgrid::kernel::resource::NetworkIBModel();
all_existing_models->push_back(surf_network_model);
simgrid::s4u::Link::onCommunicationStateChange.connect(IB_action_state_changed_callback);
simgrid::s4u::Link::onCommunicate.connect(IB_action_init_callback);
}
namespace simgrid {
-namespace surf {
+namespace kernel {
+namespace resource {
NetworkIBModel::NetworkIBModel() : NetworkSmpiModel()
{
}
}
}
+} // namespace simgrid