-/* Copyright (c) 2013-2014. The SimGrid Team.
+/* Copyright (c) 2013-2015. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
#include "host_interface.hpp"
-#include "simix/smx_private.h"
+#include "src/simix/smx_private.h"
#include "cpu_cas01.hpp"
#include "simgrid/sg_config.h"
#include "network_interface.hpp"
-#include "vm_interface.hpp"
+#include "virtual_machine.hpp"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_host, surf,
"Logging specific to the SURF host module");
/*********
* Model *
*********/
-HostModel::HostModel(const char *name)
- : Model(name)
-{}
-
-HostModel::HostModel()
-: Model("Host") {}
-
-HostModel::~HostModel() {
-}
-
/* Each VM has a dummy CPU action on the PM layer. This CPU action works as the
* constraint (capacity) of the VM in the PM layer. If the VM does not have any
* active task, the dummy CPU action must be deactivated, so that the VM does
VMModel::ws_vms.begin();
iter != VMModel::ws_vms.end(); ++iter) {
- VM *ws_vm = &*iter;
+ VirtualMachine *ws_vm = &*iter;
CpuCas01 *cpu_cas01 = static_cast<CpuCas01*>(ws_vm->p_cpu);
xbt_assert(cpu_cas01, "cpu-less host");
p_cpu->setState(state);
}
-int Host::getCore(){
- return p_cpu->getCore();
-}
-
-double Host::getSpeed(double load){
- return p_cpu->getSpeed(load);
-}
-
-double Host::getAvailableSpeed(){
- return p_cpu->getAvailableSpeed();
-}
-
-double Host::getCurrentPowerPeak()
-{
- return p_cpu->getCurrentPowerPeak();
-}
-
-double Host::getPowerPeakAt(int pstate_index)
-{
- return p_cpu->getPowerPeakAt(pstate_index);
-}
-
-int Host::getNbPstates()
-{
- return p_cpu->getNbPstates();
-}
-
-void Host::setPstate(int pstate_index)
-{
- p_cpu->setPstate(pstate_index);
-}
-int Host::getPstate()
-{
- return p_cpu->getPstate();
-}
-
xbt_dict_t Host::getProperties()
{
return p_cpu->getProperties();
xbt_dynar_t Host::getVms()
{
- xbt_dynar_t dyn = xbt_dynar_new(sizeof(VM*), NULL);
+ xbt_dynar_t dyn = xbt_dynar_new(sizeof(VirtualMachine*), NULL);
/* iterate for all virtual machines */
for (VMModel::vm_list_t::iterator iter =
VMModel::ws_vms.begin();
iter != VMModel::ws_vms.end(); ++iter) {
- VM *ws_vm = &*iter;
+ VirtualMachine *ws_vm = &*iter;
if (this == ws_vm->p_subWs)
xbt_dynar_push(dyn, &ws_vm);
}
return dyn;
}
-void Host::getParams(ws_params_t params)
+void Host::getParams(vm_params_t params)
{
*params = p_params;
}
-void Host::setParams(ws_params_t params)
+void Host::setParams(vm_params_t params)
{
/* may check something here. */
p_params = *params;