double timeout)
{
xbt_ex_t e;
- size_t task_size = sizeof(void*);
MSG_error_t ret = MSG_OK;
smx_comm_t comm;
+
+ /* We no longer support getting a task from a specific host */
+ if (host) THROW_UNIMPLEMENTED;
+
CHECK_HOST();
+ memset(&comm,0,sizeof(comm));
+
/* Kept for compatibility with older implementation */
xbt_assert1(!MSG_mailbox_get_cond(mailbox),
"A process is already blocked on this channel %s",
xbt_assert0(task, "Null pointer for the task storage");
if (*task)
- CRITICAL0
- ("MSG_task_get() was asked to write in a non empty task struct.");
-
- /* We no loger support getting a task from a specific host */
- if(host)
- THROW_UNIMPLEMENTED;
+ CRITICAL0("MSG_task_get() was asked to write in a non empty task struct.");
/* Try to receive it by calling SIMIX network layer */
TRY{
- SIMIX_network_recv(mailbox->rdv, timeout, task, &task_size, &comm);
+ SIMIX_network_recv(mailbox->rdv, timeout, task, NULL, &comm);
+ //INFO2("Got task %s from %s",(*task)->name,mailbox->alias);
(*task)->simdata->refcount--;
}
CATCH(e){
ret = MSG_TRANSFER_FAILURE;
break;
case timeout_error:
- ret = MSG_TRANSFER_FAILURE;
+ ret = MSG_TIMEOUT_FAILURE;
break;
default:
- xbt_die("Unhandled SIMIX network exception");
+ xbt_die(bprintf("Unhandled SIMIX network exception: %s",e.msg));
}
xbt_ex_free(e);
}
SIMIX_cond_signal(mailbox->cond);
SIMIX_network_send(mailbox->rdv, t_simdata->message_size, t_simdata->rate,
- timeout, &task, sizeof(void*), &t_simdata->comm, task);
+ timeout, task, sizeof(void*), &t_simdata->comm, task);
}
CATCH(e){
ret = MSG_TRANSFER_FAILURE;
break;
case timeout_error:
- ret = MSG_TRANSFER_FAILURE;
+ ret = MSG_TIMEOUT_FAILURE;
break;
default:
- xbt_die("Unhandled SIMIX network exception");
+ xbt_die(bprintf("Unhandled SIMIX network exception: %s",e.msg));
}
xbt_ex_free(e);