-/* 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
XBT_INFO("Master starting");
MSG_process_sleep(0.5);
- msg_comm_t comm = NULL;
- {
- msg_task_t task = MSG_task_create("COMM", 0, 100000000, NULL);
- comm = MSG_task_isend(task, mailbox);
- }
+ msg_task_t task = MSG_task_create("COMM", 0, 100000000, NULL);
+ msg_comm_t comm = MSG_task_isend(task, mailbox);
MSG_process_sleep(0.5);
MSG_host_off(jupiter);
if (comm) {
+ MSG_task_destroy(task);
MSG_comm_wait(comm, -1);
MSG_comm_destroy(comm);
}
msg_task_t task = NULL;
msg_error_t error = MSG_task_receive(&(task), mailbox);
if (error) {
- XBT_ERROR("Error while receiving message");
+ if (error != MSG_HOST_FAILURE)
+ XBT_ERROR("Error while receiving message");
+ else
+ XBT_DEBUG("The host has been turned off, this was expected");
return 1;
}