#include "network_interface.hpp"
#include "virtual_machine.hpp"
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_host, surf,
- "Logging specific to the SURF host module");
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_host, surf, "Logging specific to the SURF host module");
simgrid::surf::HostModel *surf_host_model = nullptr;
/*********
* Model *
*********/
-HostImpl *HostModel::createHost(const char *name, routing::NetCard *netElm, Cpu *cpu){
+HostImpl *HostModel::createHost(const char *name, kernel::routing::NetCard *netElm, Cpu *cpu){
xbt_dynar_t storageList = (xbt_dynar_t)xbt_lib_get_or_null(storage_lib, name, ROUTING_STORAGE_HOST_LEVEL);
HostImpl *host = new simgrid::surf::HostImpl(surf_host_model, name, storageList, cpu);
}
}
if (nb == 1) {
- action = surf_network_model->communicate(host_list[0]->pimpl_netcard,
- host_list[1]->pimpl_netcard,
- value, rate);
+ action = surf_network_model->communicate(host_list[0]->pimpl_netcard, host_list[1]->pimpl_netcard, value, rate);
} else if (nb == 0) {
xbt_die("Cannot have a communication with no flop to exchange in this model. You should consider using the ptask model");
} else {
void HostImpl::attach(simgrid::s4u::Host* host)
{
- if (p_host != nullptr)
+ if (piface != nullptr)
xbt_die("Already attached to host %s", host->name().c_str());
host->extension_set(this);
- p_host = host;
+ piface = host;
}
bool HostImpl::isOn() const {
void HostImpl::turnOn(){
if (isOff()) {
p_cpu->turnOn();
- simgrid::s4u::Host::onStateChange(*this->p_host);
+ simgrid::s4u::Host::onStateChange(*this->piface);
}
}
void HostImpl::turnOff(){
if (isOn()) {
p_cpu->turnOff();
- simgrid::s4u::Host::onStateChange(*this->p_host);
+ simgrid::s4u::Host::onStateChange(*this->piface);
}
}
unsigned int cursor;
XBT_DEBUG("Search for storage name '%s' on '%s'", mount, getName());
- xbt_dynar_foreach(p_storage,cursor,mnt)
- {
+ xbt_dynar_foreach(p_storage,cursor,mnt){
XBT_DEBUG("See '%s'",mnt.name);
if(!strcmp(mount,mnt.name)){
st = static_cast<simgrid::surf::Storage*>(mnt.storage);
break;
}
}
- if(!st) xbt_die("Can't find mount '%s' for '%s'", mount, getName());
+ if(!st)
+ xbt_die("Can't find mount '%s' for '%s'", mount, getName());
return st;
}
p_params = *params;
}
-}
-}
+}}