Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright notices
[simgrid.git] / src / surf / host_ptask_L07.hpp
index dc91dc1..d3466c9 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
@@ -21,7 +21,7 @@ class HostL07;
 class CpuL07;
 class LinkL07;
 
-class HostL07Action;
+class L07Action;
 
 /*********
  * Tools *
@@ -39,19 +39,18 @@ public:
   void updateActionsState(double now, double delta);
   Host *createHost(const char *name);
   Action *executeParallelTask(int host_nb,
-                                        void **host_list,
-                                        double *flops_amount,
-                                        double *bytes_amount,
-                                        double rate);
+                              sg_host_t *host_list,
+                                                         double *flops_amount,
+                                                         double *bytes_amount,
+                                                         double rate);
   xbt_dynar_t getRoute(Host *src, Host *dst);
-  Action *communicate(Host *src, Host *dst, double size, double rate);
   void addTraces();
   NetworkModel *p_networkModel;
 };
 
 class CpuL07Model : public CpuModel {
 public:
-  CpuL07Model() : CpuModel("cpuL07") {};
+  CpuL07Model() : CpuModel() {};
   ~CpuL07Model() {surf_cpu_model_pm = NULL;};
   Cpu *createCpu(const char *name,  xbt_dynar_t powerPeak,
                           int pstate, double power_scale,
@@ -79,8 +78,10 @@ public:
                                                   e_surf_link_sharing_policy_t
                                                   policy, xbt_dict_t properties);
 
-  Action *communicate(RoutingEdge */*src*/, RoutingEdge */*dst*/, double /*size*/, double /*rate*/) {DIE_IMPOSSIBLE;};
+  Action *communicate(RoutingEdge *src, RoutingEdge *dst, double size, double rate);
   void addTraces() {DIE_IMPOSSIBLE;};
+  bool shareResourcesIsIdempotent() {return true;}
+
   HostL07Model *p_hostModel;
 };
 
@@ -156,18 +157,18 @@ public:
 /**********
  * Action *
  **********/
-class HostL07Action : public HostAction {
+class L07Action : public HostAction {
   friend Action *HostL07::execute(double size);
   friend Action *HostL07::sleep(double duration);
   friend Action *HostL07Model::executeParallelTask(int host_nb,
-                                                     void **host_list,
+                                                   sg_host_t*host_list,
                                                    double *flops_amount,
                                                                                                   double *bytes_amount,
                                                    double rate);
 public:
-  HostL07Action(Model *model, double cost, bool failed)
+  L07Action(Model *model, double cost, bool failed)
   : HostAction(model, cost, failed) {};
- ~HostL07Action();
+ ~L07Action();
 
   void updateBound();
 
@@ -180,8 +181,7 @@ public:
   void setPriority(double priority);
   double getRemains();
 
-  int m_hostNb;
-  Host **p_hostList;
+  vector<RoutingEdge*> * p_edgeList = new vector<RoutingEdge*>();
   double *p_computationAmount;
   double *p_communicationAmount;
   double m_latency;