Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
kill network_common.h: empty
[simgrid.git] / src / surf / network_constant.c
index c75fb23..4bc123c 100644 (file)
@@ -6,7 +6,6 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "surf_private.h"
-#include "network_common.h"
 #include "surf/random_mgr.h"
 #include "xbt/dict.h"
 #include "xbt/str.h"
@@ -21,7 +20,6 @@ typedef struct surf_action_network_Constant {
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_network);
 static random_data_t random_latency = NULL;
-static int card_number = 0;
 static int host_number = 0;
 
 static void count_hosts(void)
@@ -107,8 +105,6 @@ static void update_actions_state(double now, double delta)
       surf_network_model->action_state_set((surf_action_t) action, SURF_ACTION_DONE);
     }
   }
-
-  return;
 }
 
 static void update_resource_state(void *id,
@@ -125,29 +121,18 @@ static surf_action_t communicate(const char *src_name,const char *dst_name,int s
 
   XBT_IN4("(%s,%s,%g,%g)", src_name, dst_name, size, rate);
 
-  action = xbt_new0(s_surf_action_network_Constant_t, 1);
+  action = surf_action_new(sizeof(s_surf_action_network_Constant_t),size,surf_network_model,0);
 
-  action->generic_action.refcount = 1;
-  action->generic_action.cost = size;
-  action->generic_action.remains = size;
-  action->generic_action.max_duration = NO_MAX_DURATION;
-  action->generic_action.start = surf_get_clock();
-  action->generic_action.finish = -1.0;
-  action->generic_action.model_type = surf_network_model;
   action->suspended = 0;
 
   action->latency = random_generate(random_latency);
   action->lat_init = action->latency;
 
-  if (action->latency <= 0.0)
+  if (action->latency <= 0.0) {
     action->generic_action.state_set =
       surf_network_model->states.done_action_set;
-  else
-    action->generic_action.state_set =
-      surf_network_model->states.running_action_set;
-
-  xbt_swag_insert(action, action->generic_action.state_set);
-
+    xbt_swag_insert(action, action->generic_action.state_set);
+  }
 
   XBT_OUT;
 
@@ -175,11 +160,6 @@ static int link_shared(const void *link)
   DIE_IMPOSSIBLE;
 }
 
-static xbt_dict_t get_properties(void *link)
-{
-  DIE_IMPOSSIBLE;
-}
-
 static void action_suspend(surf_action_t action)
 {
   ((surf_action_network_Constant_t) action)->suspended = 1;
@@ -205,8 +185,6 @@ static void finalize(void)
 {
   surf_model_exit(surf_network_model);
   surf_network_model = NULL;
-
-  card_number = 0;
 }
 
 static void surf_network_model_init_internal(void)
@@ -237,8 +215,6 @@ static void surf_network_model_init_internal(void)
   surf_network_model->extension.network.get_link_latency = get_link_latency;
   surf_network_model->extension.network.link_shared = link_shared;
 
-  surf_network_model->get_properties = get_properties;
-
   if (!random_latency)
     random_latency = random_new(RAND, 100, 0.0, 1.0, .125, .034);
 }