/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
* @param name a name for the object. It is for user-level information and can be nullptr.
* @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 name a name for the object. It is for user-level information and can be nullptr.
* @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.
* be transfered 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.
* be transfered 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.
*/
msg_task_t MSG_task_create(const char *name, double flop_amount, double message_size, void *data)
{
* @return The new corresponding object.
*/
msg_task_t MSG_task_create(const char *name, double flop_amount, double message_size, void *data)
{
- TRACE_msg_task_create(task);
+ task->counter = counter++;
+ task->category = nullptr;
+
+ if (MC_is_active())
+ MC_ignore_heap(&(task->counter), sizeof(task->counter));
*
* \rst
* See :cpp:func:`void simgrid::s4u::this_actor::parallel_execute(int, s4u::Host**, double*, double*)` for
*
* \rst
* See :cpp:func:`void simgrid::s4u::this_actor::parallel_execute(int, s4u::Host**, double*, double*)` for
-/** @ingroup m_task_management
- * @brief Sets the user data of a #msg_task_t.
- *
- * This function allows to associate a new pointer to the user data associated of @a task.
- */
+/** @brief Sets the user data of a given task */
void MSG_task_set_name(msg_task_t task, const char *name)
{
task->name = xbt_strdup(name);
}
void MSG_task_set_name(msg_task_t task, const char *name)
{
task->name = xbt_strdup(name);
}
-/** @brief Cancel a #msg_task_t.
- * @param task the task to cancel. If it was executed or transfered, it stops the process that were working on it.
+/** @brief Cancel the given task
+ *
+ * If it was currently executed or transfered, the working process is stopped.
*
* @warning If the computation is ongoing (already started and not finished),
* it is not modified by this call. Moreover, after its completion, the ongoing execution with set the flops_amount to
*
* @warning If the computation is ongoing (already started and not finished),
* it is not modified by this call. Moreover, after its completion, the ongoing execution with set the flops_amount to
-/** @brief Returns the total amount received by a task #msg_task_t.
- * If the communication does not exist it will return 0.
- * So, if the communication has FINISHED or FAILED it returns zero.
+/** @brief Returns the total amount received by the given task
+ *
+ * If the communication does not exist it will return 0.
+ * So, if the communication has FINISHED or FAILED it returns zero.
*/
double MSG_task_get_remaining_communication(msg_task_t task)
{
XBT_DEBUG("calling simcall_communication_get_remains(%p)", task->simdata->comm.get());
*/
double MSG_task_get_remaining_communication(msg_task_t task)
{
XBT_DEBUG("calling simcall_communication_get_remains(%p)", task->simdata->comm.get());
double MSG_task_get_bytes_amount(msg_task_t task)
{
xbt_assert((task != nullptr) && (task->simdata != nullptr), "Invalid parameter");
return task->simdata->bytes_amount;
}
double MSG_task_get_bytes_amount(msg_task_t task)
{
xbt_assert((task != nullptr) && (task->simdata != nullptr), "Invalid parameter");
return task->simdata->bytes_amount;
}
-/** @brief Changes the priority of a computation task. This priority doesn't affect the transfer rate. A priority of 2
- * will make a task receive two times more cpu power than the other ones.
+/** @brief Changes the priority of a computation task.
+ *
+ * This priority doesn't affect the transfer rate. A priority of 2
+ * will make a task receive two times more cpu power than regular tasks.
*/
void MSG_task_set_priority(msg_task_t task, double priority)
{
task->simdata->priority = 1 / priority;
*/
void MSG_task_set_priority(msg_task_t task, double priority)
{
task->simdata->priority = 1 / priority;