Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid
[simgrid.git] / src / surf / host_interface.cpp
index 9433fe7..025df7c 100644 (file)
@@ -1,4 +1,4 @@
-/* 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
@@ -6,12 +6,12 @@
 
 #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");
@@ -39,16 +39,6 @@ void host_add_traces(){
 /*********
  * 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
@@ -60,7 +50,7 @@ void HostModel::adjustWeightOfDummyCpuActions()
          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");
 
@@ -116,42 +106,6 @@ void Host::setState(e_surf_resource_state_t state){
   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();
@@ -368,14 +322,14 @@ int Host::fileMove(surf_file_t fd, const char* fullpath){
 
 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);
   }
@@ -383,12 +337,12 @@ xbt_dynar_t Host::getVms()
   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;