X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/9f54e5c450791e19b01f31e86c93e5a603fd0c4b..e89f9f044e0a5071de93ec27bfca5993b9c86d1f:/examples/msg/parallel_task/parallel_task.c diff --git a/examples/msg/parallel_task/parallel_task.c b/examples/msg/parallel_task/parallel_task.c index 8f13bd362f..ced1cf2014 100644 --- a/examples/msg/parallel_task/parallel_task.c +++ b/examples/msg/parallel_task/parallel_task.c @@ -1,6 +1,5 @@ -/* $Id$ */ - -/* Copyright (c) 2002,2003,2004 Arnaud Legrand. All rights reserved. */ +/* Copyright (c) 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. */ @@ -49,11 +48,12 @@ int test(int argc, char *argv[]) communication_amount, NULL); MSG_parallel_task_execute(ptask); + MSG_task_destroy(ptask); /* There is no need to free that! */ /* free(communication_amount); */ /* free(computation_amount); */ - INFO0("Goodbye now!"); + XBT_INFO("Goodbye now!"); free(slaves); return 0; } @@ -62,15 +62,18 @@ int test(int argc, char *argv[]) MSG_error_t test_all(const char *platform_file) { MSG_error_t res = MSG_OK; + m_host_t *hosts; MSG_config("workstation/model", "ptask_L07"); MSG_set_channel_number(1); MSG_create_environment(platform_file); - MSG_process_create("test", test, NULL, MSG_get_host_table()[0]); + hosts = MSG_get_host_table(); + MSG_process_create("test", test, NULL, hosts[0]); res = MSG_main(); + xbt_free(hosts); - INFO1("Simulation time %g", MSG_get_clock()); + XBT_INFO("Simulation time %g", MSG_get_clock()); return res; }