X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/865f97c868ce92518b1cf4f23e23bd1b16b7917c..fe657d473727f5f9e71ab147673d902bef1a54d4:/src/simdag/sd_global.c diff --git a/src/simdag/sd_global.c b/src/simdag/sd_global.c index bfcb6330f9..093b77ed65 100644 --- a/src/simdag/sd_global.c +++ b/src/simdag/sd_global.c @@ -1,3 +1,9 @@ +/* Copyright (c) 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. */ + #include "private.h" #include "xbt/sysdep.h" #include "xbt/dynar.h" @@ -13,14 +19,6 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(sd_kernel, sd, SD_global_t sd_global = NULL; -/* $Id$ */ - -/* Copyright (c) 2007 Arnaud Legrand. - 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. */ - XBT_LOG_EXTERNAL_CATEGORY(sd_kernel); XBT_LOG_EXTERNAL_CATEGORY(sd_task); XBT_LOG_EXTERNAL_CATEGORY(sd_workstation); @@ -75,7 +73,7 @@ void SD_init(int *argc, char **argv) sd_global->task_number = 0; surf_init(argc, argv); - xbt_cfg_set_string(_surf_cfg_set, "workstation_model", "ptask_L07"); + xbt_cfg_set_string(_surf_cfg_set, "workstation/model", "ptask_L07"); } /** @@ -156,7 +154,6 @@ void SD_create_environment(const char *platform_file) DEBUG0("SD_create_environment"); - surf_timer_model_init(platform_file); surf_config_models_setup(platform_file); parse_platform_file(platform_file); @@ -167,7 +164,7 @@ void SD_create_environment(const char *platform_file) __SD_workstation_create(surf_workstation, NULL); } - xbt_dict_foreach(link_set, cursor, name, surf_link) { + xbt_dict_foreach(surf_model_resource_set(surf_network_model), cursor, name, surf_link) { __SD_link_create(surf_link, NULL); } @@ -241,10 +238,10 @@ SD_task_t *SD_simulate(double how_long) /* let's see which tasks are done */ xbt_dynar_foreach(model_list, iter, model) { - while ((action = - xbt_swag_extract(model->common_public.states. - done_action_set))) { + while ((action = xbt_swag_extract(model->states.done_action_set))) { task = action->data; + task->start_time = surf_workstation_model->action_get_start_time(task->surf_action); + task->finish_time = surf_get_clock(); INFO1("Task '%s' done", SD_task_get_name(task)); DEBUG0("Calling __SD_task_just_done"); __SD_task_just_done(task); @@ -272,13 +269,13 @@ SD_task_t *SD_simulate(double how_long) } /* let's see which tasks have just failed */ - while ((action = - xbt_swag_extract(model->common_public.states. - failed_action_set))) { + while ((action = xbt_swag_extract(model->states.failed_action_set))) { task = action->data; + task->start_time = surf_workstation_model->action_get_start_time(task->surf_action); + task->finish_time = surf_get_clock(); INFO1("Task '%s' failed", SD_task_get_name(task)); __SD_task_set_state(task, SD_FAILED); - surf_workstation_model->common_public.action_free(action); + surf_workstation_model->action_unref(action); task->surf_action = NULL; if (!xbt_dynar_member(changed_tasks, &task))