-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2013. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
src_id, dst_id, links, nb_link);
/* Build the list of gtnets link IDs */
- gtnets_links = (int *) calloc(nb_link, sizeof(int));
+ gtnets_links = xbt_new0(int, nb_link);
i = 0;
xbt_dynar_foreach(links, cursor, link) {
gtnets_links[i++] = link->id;
surf_action_state_set(action, state);
}
-static double share_resources(double now)
+static double share_resources(surf_model_t network_model, double now)
{
xbt_swag_t running_actions =
surf_network_model->states.running_action_set;
XBT_DEBUG("Calling gtnets_get_time_to_next_flow_completion");
time_to_next_flow_completion = gtnets_get_time_to_next_flow_completion();
- XBT_DEBUG("gtnets_get_time_to_next_flow_completion received %lg",
+ XBT_DEBUG("gtnets_get_time_to_next_flow_completion received %g",
time_to_next_flow_completion);
return time_to_next_flow_completion;
}
-static void update_actions_state(double now, double delta)
+static void update_actions_state(surf_model_t network_model, double now, double delta)
{
surf_action_network_GTNETS_t action = NULL;
xbt_swag_t running_actions =
- surf_network_model->states.running_action_set;
+ network_model->states.running_action_set;
/* If there are no running flows, just return */
if (time_to_next_flow_completion < 0.0) {
}
#endif
-static void finalize(void)
+static void finalize(surf_model_t network_model)
{
gtnets_finalize();
}
surf_network_model = surf_model_init();
surf_network_model->name = "network GTNetS";
+ surf_network_model->type = SURF_MODEL_TYPE_NETWORK;
surf_network_model->action_unref = action_unref;
surf_network_model->action_cancel = action_cancel;
surf_network_model->action_recycle = action_recycle;