Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Unify models apis
[simgrid.git] / src / surf / vm_workstation_hl13.hpp
index 4278426..a17605c 100644 (file)
@@ -1,9 +1,9 @@
-/*
- * vm_workstation.hpp
- *
- *  Created on: Nov 12, 2013
- *      Author: bedaride
- */
+/* Copyright (c) 2013-2014. The SimGrid Team.
+ * All rights reserved.                                                     */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
 #include "vm_workstation_interface.hpp"
 #include "workstation_clm03.hpp"
 
@@ -13,8 +13,6 @@
 #define GUESTOS_NOISE 100 // This value corresponds to the cost of the global action associated to the VM
                           // It corresponds to the cost of a VM running no tasks.
 
-void surf_vm_workstation_model_init(void);
-
 /***********
  * Classes *
  ***********/
@@ -22,35 +20,37 @@ void surf_vm_workstation_model_init(void);
 class WorkstationVMHL13Model;
 typedef WorkstationVMHL13Model *WorkstationVMHL13ModelPtr;
 
-class WorkstationVMHL13Lmm;
-typedef WorkstationVMHL13Lmm *WorkstationVMHL13LmmPtr;
-
-/*********
- * Tools *
- *********/
+class WorkstationVMHL13;
+typedef WorkstationVMHL13 *WorkstationVMHL13Ptr;
 
 /*********
  * Model *
  *********/
-class WorkstationVMHL13Model : public WorkstationVMModel, public WorkstationCLM03Model {
+class WorkstationVMHL13Model : public WorkstationVMModel {
 public:
   WorkstationVMHL13Model();
   ~WorkstationVMHL13Model(){};
-  void createResource(const char *name, void *ind_phys_workstation);
+
+  WorkstationVMPtr createWorkstationVM(const char *name, surf_resource_t ind_phys_workstation);
   double shareResources(double now);
   void adjustWeightOfDummyCpuActions() {};
-  xbt_dynar_t getRoute(WorkstationPtr src, WorkstationPtr dst);
   ActionPtr communicate(WorkstationPtr src, WorkstationPtr dst, double size, double rate);
+  ActionPtr executeParallelTask(int workstation_nb,
+                                          void **workstation_list,
+                                          double *computation_amount,
+                                          double *communication_amount,
+                                          double rate);
+  void updateActionsState(double /*now*/, double /*delta*/);
 };
 
 /************
  * Resource *
  ************/
 
-class WorkstationVMHL13Lmm : public WorkstationVMLmm, public WorkstationCLM03Lmm {
+class WorkstationVMHL13 : public WorkstationVM {
 public:
-  WorkstationVMHL13Lmm(WorkstationVMModelPtr model, const char* name, xbt_dict_t props, surf_resource_t ind_phys_workstation);
-  ~WorkstationVMHL13Lmm();
+  WorkstationVMHL13(WorkstationVMModelPtr model, const char* name, xbt_dict_t props, surf_resource_t ind_phys_workstation);
+  ~WorkstationVMHL13();
 
   void suspend();
   void resume();
@@ -66,20 +66,14 @@ public:
   surf_resource_t getPm(); // will be vm_ws_get_pm()
 
   void setBound(double bound);
-  void setAffinity(CpuLmmPtr cpu, unsigned long mask);
+  void setAffinity(CpuPtr cpu, unsigned long mask);
 
   //FIXME: remove
-  void updateState(tmgr_trace_event_t event_type, double value, double date) {
-       WorkstationCLM03Lmm::updateState(event_type, value, date);
-  }
-  bool isUsed() {
-    return WorkstationCLM03Lmm::isUsed();
-  }
-  xbt_dict_t getProperties() {
-    return WorkstationCLM03Lmm::getProperties();
-  }
-  ActionPtr execute(double size);
+  void updateState(tmgr_trace_event_t event_type, double value, double date);
+  bool isUsed();
 
+  ActionPtr execute(double size);
+  ActionPtr sleep(double duration);
 };
 
 /**********