Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
getting rid of workstation_KCCFLN05_private.h
[simgrid.git] / src / surf / workstation_KCCFLN05.c
index 1108e11..7f4f822 100644 (file)
@@ -7,11 +7,92 @@
 
 #include "xbt/ex.h"
 #include "xbt/dict.h"
-#include "workstation_KCCFLN05_private.h"
+#include "surf_private.h"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_workstation, surf,
                                "Logging specific to the SURF workstation module (KCCFLN05)");
 
+typedef enum {
+  SURF_WORKSTATION_RESOURCE_CPU,
+  SURF_WORKSTATION_RESOURCE_LINK,
+} e_surf_workstation_model_type_t;
+
+
+/**************************************/
+/********* router object **************/
+/**************************************/
+typedef struct router_KCCFLN05 {
+  char *name;          
+  unsigned int id;
+} s_router_KCCFLN05_t, *router_KCCFLN05_t;
+
+
+/**************************************/
+/********* cpu object *****************/
+/**************************************/
+typedef struct cpu_KCCFLN05 {
+  surf_model_t model;
+  e_surf_workstation_model_type_t type;        /* Do not move this field */
+  char *name;                                  /* Do not move this field */
+  lmm_constraint_t constraint;
+  lmm_constraint_t bus;
+  double power_scale;
+  double power_current;
+  double interference_send;
+  double interference_recv;
+  double interference_send_recv;
+  tmgr_trace_event_t power_event;
+  e_surf_cpu_state_t state_current;
+  tmgr_trace_event_t state_event;
+  int id;                      /* cpu and network card are a single object... */
+  xbt_dynar_t incomming_communications;
+  xbt_dynar_t outgoing_communications;
+} s_cpu_KCCFLN05_t, *cpu_KCCFLN05_t;
+
+/**************************************/
+/*********** network object ***********/
+/**************************************/
+
+typedef struct network_link_KCCFLN05 {
+  surf_model_t model;
+  e_surf_workstation_model_type_t type;        /* Do not move this field */
+  char *name;                                  /* Do not move this field */
+  lmm_constraint_t constraint;
+  double lat_current;
+  tmgr_trace_event_t lat_event;
+  double bw_current;
+  tmgr_trace_event_t bw_event;
+  e_surf_network_link_state_t state_current;
+  tmgr_trace_event_t state_event;
+} s_network_link_KCCFLN05_t, *network_link_KCCFLN05_t;
+
+
+typedef struct s_route_KCCFLN05 {
+  double impact_on_src;
+  double impact_on_dst;
+  double impact_on_src_with_other_recv;
+  double impact_on_dst_with_other_send;
+  network_link_KCCFLN05_t *links;
+  int size;
+} s_route_KCCFLN05_t, *route_KCCFLN05_t;
+
+/**************************************/
+/*************** actions **************/
+/**************************************/
+typedef struct surf_action_workstation_KCCFLN05 {
+  s_surf_action_t generic_action;
+  double latency;
+  double lat_current;
+  lmm_variable_t variable;
+  double rate;
+  int suspended;
+  cpu_KCCFLN05_t src;          /* could be avoided */
+  cpu_KCCFLN05_t dst;          /* could be avoided */
+} s_surf_action_workstation_KCCFLN05_t,
+  *surf_action_workstation_KCCFLN05_t;
+
+
+
 static int nb_workstation = 0;
 static s_route_KCCFLN05_t *routing_table = NULL;
 #define ROUTE(i,j) routing_table[(i)+(j)*nb_workstation]
@@ -621,7 +702,7 @@ static surf_action_t communicate(void *src, void *dst, double size,
   }
 
   lmm_update_variable_latency(maxmin_system, action->variable,
-                             action->latency);
+                             action->latency); /* Should be useless */
 
   for (i = 0; i < route_size; i++)
     lmm_expand(maxmin_system, route->links[i]->constraint,
@@ -653,7 +734,7 @@ static surf_action_t execute_parallel_task(int workstation_nb,
        xbt_dict_new_ext(workstation_nb * workstation_nb * 10);
   }
 
-  /* Compute the number of affected models... */
+  /* Compute the number of affected resources... */
   for (i = 0; i < workstation_nb; i++) {
     for (j = 0; j < workstation_nb; j++) {
       cpu_KCCFLN05_t card_src = workstation_list[i];