-/* Copyright (c) 2004-2020. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2004-2021. The SimGrid Team. All rights reserved. */
/* 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. */
id_ = counter++;
set_data(data);
if (MC_is_active())
- MC_ignore_heap(&(id_), sizeof(id_));
+ MC_ignore_heap(&id_, sizeof id_);
}
Task::Task(const std::string& name, std::vector<s4u::Host*>&& hosts, std::vector<double>&& flops_amount,
s4u::CommPtr Task::send_async(const std::string& alias, void_f_pvoid_t cleanup, bool detached)
{
if (TRACE_actor_is_enabled()) {
- container_t process_container = instr::Container::by_name(instr_pid(*MSG_process_self()));
+ auto* process_container = instr::Container::by_name(instr_pid(*MSG_process_self()));
std::string key = std::string("p") + std::to_string(get_id());
- instr::Container::get_root()->get_link("ACTOR_TASK_LINK")->start_event(process_container, "SR", key);
+ instr::Container::get_root()->get_link("ACTOR_LINK")->start_event(process_container, "SR", key);
}
/* Prepare the task to send */
*
* A constructor for #msg_task_t taking six arguments.
*
- * \rst
- * See :cpp:func:`void simgrid::s4u::this_actor::parallel_execute(int, s4u::Host**, double*, double*)` for
+ * @beginrst
+ * See :ref:`simgrid::s4u::this_actor::parallel_execute() <API_s4u_parallel_execute>` for
* the exact semantic of the parameters.
- * \endrst
+ * @endrst
*
* @param name a name for the object. It is for user-level information and can be nullptr.
* @param host_nb the number of hosts implied in the parallel task.
}
if (TRACE_actor_is_enabled() && ret != MSG_HOST_FAILURE && ret != MSG_TRANSFER_FAILURE && ret != MSG_TIMEOUT) {
- container_t process_container = simgrid::instr::Container::by_name(instr_pid(*MSG_process_self()));
+ auto* process_container = simgrid::instr::Container::by_name(instr_pid(*MSG_process_self()));
std::string key = std::string("p") + std::to_string((*task)->get_id());
- simgrid::instr::Container::get_root()->get_link("ACTOR_TASK_LINK")->end_event(process_container, "SR", key);
+ simgrid::instr::Container::get_root()->get_link("ACTOR_LINK")->end_event(process_container, "SR", key);
}
return ret;
}
*/
double MSG_task_get_flops_amount(const_msg_task_t task)
{
- if (task->compute != nullptr) {
+ if (task->compute != nullptr && task->compute->get_state() == simgrid::s4u::Activity::State::STARTED) {
return task->compute->get_remaining();
} else {
// Not started or already done.
* (or with #TRACE_category_with_color).
*
* @beginrst
- * See :ref:`outcomes_vizu` for details on how to trace the (categorized) resource utilization.
+ * See :ref:`outcome_vizu` for details on how to trace the (categorized) resource utilization.
* @endrst
*
* @param task the task that is going to be categorized