X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/07ce716b44d53a070fc2358ec727bb1975198200..5e2dd3ecf166c2d82974beb220aeb8dd4200f105:/src/surf/workstation.c diff --git a/src/surf/workstation.c b/src/surf/workstation.c index b859aa3eba..b104f008d9 100644 --- a/src/surf/workstation.c +++ b/src/surf/workstation.c @@ -1,6 +1,5 @@ -/* $Id$ */ - -/* Copyright (c) 2004 Arnaud Legrand. All rights reserved. */ +/* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. 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. */ @@ -45,8 +44,9 @@ void create_workstations(void) xbt_dict_foreach(surf_model_resource_set(surf_cpu_model), cursor, name, cpu) { int *id = NULL; - if (used_routing && used_routing->host_id) - id = xbt_dict_get_or_null(used_routing->host_id,name); +// COMMENTED BY DAVID +// if (used_routing && used_routing->host_id) +// id = xbt_dict_get_or_null(used_routing->host_id,name); workstation_new(name, cpu, id ? *id : 0); } @@ -185,6 +185,14 @@ static void ws_action_set_priority(surf_action_t action, double priority) DIE_IMPOSSIBLE; } +static int ws_get_latency_limited(surf_action_t action) +{ + if (action->model_type == surf_network_model) + return surf_network_model->get_latency_limited(action); + INFO0("You tried to ask if a non network action is limited by latency, aborting..."); + DIE_IMPOSSIBLE; +} + static double ws_action_get_remains(surf_action_t action) { if (action->model_type == surf_network_model) @@ -292,6 +300,7 @@ static void surf_workstation_model_init_internal(void) surf_workstation_model->set_max_duration = ws_action_set_max_duration; surf_workstation_model->set_priority = ws_action_set_priority; surf_workstation_model->get_remains = ws_action_get_remains; + surf_workstation_model->get_latency_limited = ws_get_latency_limited; surf_workstation_model->extension.workstation.execute = ws_execute; surf_workstation_model->extension.workstation.sleep = ws_action_sleep; @@ -311,6 +320,7 @@ static void surf_workstation_model_init_internal(void) surf_workstation_model->extension.workstation.link_shared = ws_link_shared; surf_workstation_model->extension.workstation.get_properties = ws_get_properties; + } /********************************************************************/