Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
move createHost higher in the surf::HostModel hierarchy
authorMartin Quinson <martin.quinson@loria.fr>
Wed, 23 Dec 2015 01:07:30 +0000 (02:07 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Wed, 23 Dec 2015 01:07:33 +0000 (02:07 +0100)
There is no need to specialize that function, actually

src/surf/host_clm03.cpp
src/surf/host_clm03.hpp
src/surf/host_interface.cpp
src/surf/host_interface.hpp
src/surf/host_ptask_L07.cpp
src/surf/host_ptask_L07.hpp
src/surf/virtual_machine.hpp

index 33457c9..21fd55e 100644 (file)
@@ -47,14 +47,6 @@ void surf_host_model_init_compound()
 namespace simgrid {
 namespace surf {
 
-Host *HostCLM03Model::createHost(const char *name,RoutingEdge *netElm, Cpu *cpu, xbt_dict_t props){
-  Host *host = new simgrid::surf::Host(surf_host_model, name, props,
-                 (xbt_dynar_t)xbt_lib_get_or_null(storage_lib, name, ROUTING_STORAGE_HOST_LEVEL),
-                 netElm, cpu);
-  XBT_DEBUG("Create host %s with %ld mounted disks", name, xbt_dynar_length(host->p_storage));
-  return host;
-}
-
 double HostCLM03Model::shareResources(double now){
   adjustWeightOfDummyCpuActions();
 
index ef4ec1c..9c9c123 100644 (file)
@@ -31,7 +31,6 @@ class HostCLM03Model : public HostModel {
 public:
   HostCLM03Model(): HostModel(){}
   ~HostCLM03Model() {}
-  Host *createHost(const char *name, RoutingEdge *netElm, Cpu *cpu, xbt_dict_t props) override;
   double shareResources(double now) override;
 
   void updateActionsState(double now, double delta) override;
index 9d740e6..5899b01 100644 (file)
@@ -36,6 +36,13 @@ simgrid::xbt::Extension<simgrid::Host, Host> Host::EXTENSION_ID;
 /*********
  * Model *
  *********/
+Host *HostModel::createHost(const char *name,RoutingEdge *netElm, Cpu *cpu, xbt_dict_t props){
+  Host *host = new simgrid::surf::Host(surf_host_model, name, props,
+                 (xbt_dynar_t)xbt_lib_get_or_null(storage_lib, name, ROUTING_STORAGE_HOST_LEVEL),
+                 netElm, cpu);
+  XBT_DEBUG("Create host %s with %ld mounted disks", name, xbt_dynar_length(host->p_storage));
+  return host;
+}
 
 /* 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
index 7e1095d..9755b61 100644 (file)
@@ -52,7 +52,7 @@ public:
   HostModel() : Model() {}
   ~HostModel() {}
 
-  virtual Host *createHost(const char *name, RoutingEdge *net, Cpu *cpu, xbt_dict_t props)=0;
+  Host *createHost(const char *name, RoutingEdge *net, Cpu *cpu, xbt_dict_t props);
   void addTraces() override {DIE_IMPOSSIBLE;}
 
   virtual void adjustWeightOfDummyCpuActions();
index 7a6c1eb..9ac974c 100644 (file)
@@ -270,13 +270,6 @@ Action *HostL07Model::executeParallelTask(int host_nb,
   return action;
 }
 
-Host *HostL07Model::createHost(const char *name,RoutingEdge *netElm, Cpu *cpu, xbt_dict_t props)
-{
-  return new simgrid::surf::Host(this, name, props,
-                 (xbt_dynar_t)xbt_lib_get_or_null(storage_lib, name, ROUTING_STORAGE_HOST_LEVEL),
-                 netElm, cpu);
-}
-
 Action *NetworkL07Model::communicate(RoutingEdge *src, RoutingEdge *dst,
                                        double size, double rate)
 {
index e5a892a..b69b496 100644 (file)
@@ -45,7 +45,6 @@ public:
 
   double shareResources(double now) override;
   void updateActionsState(double now, double delta);
-  Host *createHost(const char *name,RoutingEdge *netElm, Cpu *cpu, xbt_dict_t props) override;
   Action *executeParallelTask(int host_nb,
                               sg_host_t *host_list,
                                                          double *flops_amount,
index baef9f2..fff482a 100644 (file)
@@ -111,8 +111,6 @@ public:
   VMModel() :HostModel(){}
   ~VMModel(){};
 
-  Host *createHost(const char *name, RoutingEdge *netElm, Cpu *cpu,xbt_dict_t props) override {DIE_IMPOSSIBLE;}
-
   /**
    * @brief Create a new VM
    *