Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
remove the create_resource entry point in resource model APIs
[simgrid.git] / src / surf / workstation_ptask_L07.c
index b8fbf90..662b384 100644 (file)
@@ -302,19 +302,19 @@ static void ptask_update_actions_state(double now, double delta)
                                     i++))) {
         constraint_id = lmm_constraint_id(cnst);
 
-/*     if(((link_L07_t)constraint_id)->type== */
-/*        SURF_WORKSTATION_RESOURCE_LINK) { */
-/*       XBT_DEBUG("Checking for link %s (%p)", */
-/*              ((link_L07_t)constraint_id)->name, */
-/*              ((link_L07_t)constraint_id)); */
-/*     } */
-/*     if(((cpu_L07_t)constraint_id)->type== */
-/*        SURF_WORKSTATION_RESOURCE_CPU) { */
-/*       XBT_DEBUG("Checking for cpu %s (%p) : %s", */
-/*              ((cpu_L07_t)constraint_id)->name, */
-/*              ((cpu_L07_t)constraint_id), */
-/*              ((cpu_L07_t)constraint_id)->state_current==SURF_CPU_OFF?"Off":"On"); */
-/*     } */
+/*   if(((link_L07_t)constraint_id)->type== */
+/*      SURF_WORKSTATION_RESOURCE_LINK) { */
+/*     XBT_DEBUG("Checking for link %s (%p)", */
+/*      ((link_L07_t)constraint_id)->name, */
+/*      ((link_L07_t)constraint_id)); */
+/*   } */
+/*   if(((cpu_L07_t)constraint_id)->type== */
+/*      SURF_WORKSTATION_RESOURCE_CPU) { */
+/*     XBT_DEBUG("Checking for cpu %s (%p) : %s", */
+/*      ((cpu_L07_t)constraint_id)->name, */
+/*      ((cpu_L07_t)constraint_id), */
+/*      ((cpu_L07_t)constraint_id)->state_current==SURF_CPU_OFF?"Off":"On"); */
+/*   } */
 
         if (((((link_L07_t) constraint_id)->type ==
               SURF_WORKSTATION_RESOURCE_LINK) &&
@@ -344,7 +344,8 @@ static void ptask_update_resource_state(void *id,
   link_L07_t nw_link = id;
 
   if (nw_link->type == SURF_WORKSTATION_RESOURCE_LINK) {
-    XBT_DEBUG("Updating link %s (%p)", surf_resource_name(nw_link), nw_link);
+    XBT_DEBUG("Updating link %s (%p) with value=%f",
+      surf_resource_name(nw_link), nw_link, value);
     if (event_type == nw_link->bw_event) {
       nw_link->bw_current = value;
       lmm_update_constraint_bound(ptask_maxmin_system, nw_link->constraint,
@@ -447,7 +448,6 @@ static surf_action_t ptask_execute_parallel_task(int workstation_nb,
                                                  double
                                                  *computation_amount, double
                                                  *communication_amount,
-                                                 double amount,
                                                  double rate)
 {
   surf_action_workstation_L07_t action = NULL;
@@ -493,7 +493,7 @@ static surf_action_t ptask_execute_parallel_task(int workstation_nb,
       nb_host++;
 
   action =
-      surf_action_new(sizeof(s_surf_action_workstation_L07_t), amount,
+      surf_action_new(sizeof(s_surf_action_workstation_L07_t), 1,
                       surf_workstation_model, 0);
   XBT_DEBUG("Creating a parallel task (%p) with %d cpus and %d links.",
          action, workstation_nb, nb_link);
@@ -559,7 +559,7 @@ static surf_action_t ptask_execute(void *cpu, double size)
 
   return ptask_execute_parallel_task(1, workstation_list,
                                      computation_amount,
-                                     communication_amount, 1, -1);
+                                     communication_amount, -1);
 }
 
 static surf_action_t ptask_communicate(void *src, void *dst, double size,
@@ -576,7 +576,7 @@ static surf_action_t ptask_communicate(void *src, void *dst, double size,
 
   res = ptask_execute_parallel_task(2, workstation_list,
                                     computation_amount,
-                                    communication_amount, 1, rate);
+                                    communication_amount, rate);
 
   return res;
 }
@@ -668,13 +668,13 @@ static void* ptask_cpu_create_resource(const char *name, double power_scale,
 static void ptask_parse_cpu_init(sg_platf_host_cbarg_t host)
 {
   ptask_cpu_create_resource(
-                 host->id,
-                 host->power_peak,
-                 host->power_scale,
-                 host->power_trace,
-                 host->initial_state,
-                 host->state_trace,
-                 host->properties);
+      host->id,
+      host->power_peak,
+      host->power_scale,
+      host->power_trace,
+      host->initial_state,
+      host->state_trace,
+      host->properties);
 }
 
 static void* ptask_link_create_resource(const char *name,
@@ -799,7 +799,7 @@ static void ptask_add_traces(void)
   xbt_dict_foreach(trace_connect_list_link_avail, cursor, trace_name, elm) {
     tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
     link_L07_t link =
-               xbt_lib_get_or_null(link_lib, elm, SURF_LINK_LEVEL);
+        xbt_lib_get_or_null(link_lib, elm, SURF_LINK_LEVEL);
 
     xbt_assert(link, "Link %s undefined", elm);
     xbt_assert(trace, "Trace %s undefined", trace_name);
@@ -811,7 +811,7 @@ static void ptask_add_traces(void)
   xbt_dict_foreach(trace_connect_list_bandwidth, cursor, trace_name, elm) {
     tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
     link_L07_t link =
-               xbt_lib_get_or_null(link_lib, elm, SURF_LINK_LEVEL);
+        xbt_lib_get_or_null(link_lib, elm, SURF_LINK_LEVEL);
 
     xbt_assert(link, "Link %s undefined", elm);
     xbt_assert(trace, "Trace %s undefined", trace_name);
@@ -822,7 +822,7 @@ static void ptask_add_traces(void)
   xbt_dict_foreach(trace_connect_list_latency, cursor, trace_name, elm) {
     tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
     link_L07_t link =
-               xbt_lib_get_or_null(link_lib, elm, SURF_LINK_LEVEL);
+        xbt_lib_get_or_null(link_lib, elm, SURF_LINK_LEVEL);
 
     xbt_assert(link, "Link %s undefined", elm);
     xbt_assert(trace, "Trace %s undefined", trace_name);
@@ -890,10 +890,6 @@ static void ptask_model_init_internal(void)
       ptask_link_shared;
   surf_workstation_model->extension.workstation.get_properties =
       surf_resource_properties;
-  surf_workstation_model->extension.workstation.link_create_resource =
-      ptask_link_create_resource;
-  surf_workstation_model->extension.workstation.cpu_create_resource =
-      ptask_cpu_create_resource;
   surf_workstation_model->extension.workstation.add_traces =
       ptask_add_traces;
 
@@ -914,7 +910,6 @@ static void ptask_model_init_internal(void)
   surf_network_model->extension.network.get_link_latency = ptask_get_link_latency;
   surf_network_model->extension.network.link_shared = ptask_link_shared;
   surf_network_model->extension.network.add_traces = NULL;
-  surf_network_model->extension.network.create_resource = NULL;
 }
 
 /**************************************/