-/* Copyright (c) 2010-2015. The SimGrid Team.
+/* Copyright (c) 2010-2019. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
while (1) {
res = MSG_task_receive(&(task), mailbox);
+ if (res == MSG_HOST_FAILURE) {
+ XBT_DEBUG("The host has been turned off, this was expected");
+ return 1;
+ }
xbt_assert(res == MSG_OK, "MSG_task_get failed");
if (!strcmp(MSG_task_get_name(task), "finalize")) {
double task_comm_size = 1E6;
const char * mailbox = "jupi";
- msg_task_t task = NULL;
msg_host_t jupiter = MSG_host_by_name("Jupiter");
- task = MSG_task_create("task on", task_comp_size, task_comm_size, NULL);
+ msg_task_t task = MSG_task_create("task on", 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);