X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/a73d204e173f35c0abb92b26e061929066b8b283..8b3c1c7507bdf1c21b9484fac5c09b8420ca25c3:/src/msg/msg_task.cpp diff --git a/src/msg/msg_task.cpp b/src/msg/msg_task.cpp index b83396b648..f87e1d8561 100644 --- a/src/msg/msg_task.cpp +++ b/src/msg/msg_task.cpp @@ -19,10 +19,11 @@ namespace simgrid { namespace msg { Task::Task(const std::string& name, double flops_amount, double bytes_amount, void* data) - : name_(name), userdata_(data), flops_amount(flops_amount), bytes_amount(bytes_amount) + : name_(name), flops_amount(flops_amount), bytes_amount(bytes_amount) { static std::atomic_ullong counter{0}; id_ = counter++; + set_data(data); if (MC_is_active()) MC_ignore_heap(&(id_), sizeof(id_)); } @@ -203,7 +204,7 @@ void Task::report_multiple_use() const * @param flop_amount a value of the processing amount (in flop) needed to process this new task. * If 0, then it cannot be executed with MSG_task_execute(). This value has to be >=0. * @param message_size a value of the amount of data (in bytes) needed to transfer this new task. If 0, then it cannot - * be transfered with MSG_task_send() and MSG_task_recv(). This value has to be >=0. + * be transferred with MSG_task_send() and MSG_task_recv(). This value has to be >=0. * @param data a pointer to any data may want to attach to the new object. It is for user-level information and can * be nullptr. It can be retrieved with the function @ref MSG_task_get_data. * @return The new corresponding object. @@ -243,13 +244,13 @@ msg_task_t MSG_parallel_task_create(const char *name, int host_nb, const msg_hos /** @brief Return the user data of the given task */ void* MSG_task_get_data(msg_task_t task) { - return task->get_user_data(); + return task->get_data(); } /** @brief Sets the user data of a given task */ void MSG_task_set_data(msg_task_t task, void *data) { - task->set_user_data(data); + task->set_data(data); } /** @brief Returns the sender of the given task */ @@ -517,7 +518,7 @@ msg_error_t MSG_task_receive_bounded(msg_task_t* task, const char* alias, double */ msg_error_t MSG_task_receive_with_timeout(msg_task_t* task, const char* alias, double timeout) { - return MSG_task_receive_ext_bounded(task, alias, timeout, nullptr, -1); + return MSG_task_receive_with_timeout_bounded(task, alias, timeout, -1); } /** @@ -539,33 +540,8 @@ msg_error_t MSG_task_receive_with_timeout(msg_task_t* task, const char* alias, d */ msg_error_t MSG_task_receive_with_timeout_bounded(msg_task_t* task, const char* alias, double timeout, double rate) { - return MSG_task_receive_ext_bounded(task, alias, timeout, nullptr, rate); -} - -/** - * @brief Receives a task from a mailbox from a specific host with a given timeout and at a given rate. - * - * @param task a memory location for storing a #msg_task_t. - * @param alias name of the mailbox to receive the task from - * @param timeout is the maximum wait time for completion (provide -1 for no timeout) - * @param host a #msg_host_t host from where the task was sent - * @param rate limit the reception to rate bandwidth (byte/sec) - * - * The rate parameter can be used to receive a task with a limited bandwidth (smaller than the physical available - * value). Use MSG_task_receive_ext() if you don't limit the rate (or pass -1 as a rate value do disable this feature). - * - * @return Returns - * #MSG_OK if the task was successfully received, - * #MSG_HOST_FAILURE, or #MSG_TRANSFER_FAILURE, or #MSG_TIMEOUT otherwise. - */ -msg_error_t MSG_task_receive_ext_bounded(msg_task_t* task, const char* alias, double timeout, msg_host_t host, - double rate) -{ - XBT_DEBUG("MSG_task_receive_ext: Trying to receive a message on mailbox '%s'", alias); + XBT_DEBUG("MSG_task_receive_with_timeout_bounded: Trying to receive a message on mailbox '%s'", alias); msg_error_t ret = MSG_OK; - /* We no longer support getting a task from a specific host */ - if (host) - THROW_UNIMPLEMENTED; /* Sanity check */ xbt_assert(task, "Null pointer for the task storage"); @@ -693,7 +669,7 @@ msg_error_t MSG_task_destroy(msg_task_t task) /** @brief Cancel the given task * - * If it was currently executed or transfered, the working process is stopped. + * If it was currently executed or transferred, the working process is stopped. */ msg_error_t MSG_task_cancel(msg_task_t task) {