X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/4ab3513687a36569218810261a173e189a9af5a5..f06041cf2c450457a0b47a49b66b19cb9133c18e:/teshsuite/msg/host_on_off/host_on_off.c diff --git a/teshsuite/msg/host_on_off/host_on_off.c b/teshsuite/msg/host_on_off/host_on_off.c index 3b42831c95..530fdd0304 100644 --- a/teshsuite/msg/host_on_off/host_on_off.c +++ b/teshsuite/msg/host_on_off/host_on_off.c @@ -5,7 +5,7 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include -#include "msg/msg.h" /* Yeah! If you want to use msg, you need to include msg/msg.h */ +#include "simgrid/msg.h" /* Yeah! If you want to use msg, you need to include simgrid/msg.h */ #include "xbt/sysdep.h" /* calloc, printf */ /* Create a log channel to have nice outputs. */ @@ -25,7 +25,7 @@ int master(int argc, char *argv[]) char mailbox[256]; msg_task_t task = NULL; - + msg_host_t jupiter = MSG_get_host_by_name("Jupiter"); sprintf(mailbox, "jupi"); task = MSG_task_create("task on", task_comp_size, task_comm_size, NULL); @@ -34,14 +34,19 @@ int master(int argc, char *argv[]) MSG_task_destroy(task); MSG_process_sleep(1); - MSG_host_off(MSG_get_host_by_name("Jupiter")); + MSG_host_off(jupiter); task = MSG_task_create("task off", task_comp_size, task_comm_size, NULL); XBT_INFO("Sending \"%s\"", task->name); if (MSG_task_send_with_timeout(task, mailbox, 1) != MSG_OK) MSG_task_destroy(task); - MSG_host_on(MSG_get_host_by_name("Jupiter")); + MSG_host_on(jupiter); + xbt_swag_t jupi_processes = MSG_host_get_process_list(jupiter); + void *process; + xbt_swag_foreach(process, jupi_processes) { + MSG_process_kill(process); + } task = MSG_task_create("task on without proc", task_comp_size, task_comm_size, NULL); XBT_INFO("Sending \"%s\"", task->name);