Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright lines for 2023.
[simgrid.git] / src / msg / msg_task.cpp
index 1718beb..051de74 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004-2021. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2004-2023. 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. */
@@ -27,8 +27,7 @@ Task::Task(const std::string& name, double flops_amount, double bytes_amount, vo
   static std::atomic_ullong counter{0};
   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,
@@ -104,7 +103,7 @@ s4u::CommPtr Task::send_async(const std::string& alias, void_f_pvoid_t cleanup,
 {
   if (TRACE_actor_is_enabled()) {
     auto* process_container       = instr::Container::by_name(instr_pid(*MSG_process_self()));
-    std::string key               = std::string("p") + std::to_string(get_id());
+    std::string key               = "p" + std::to_string(get_id());
     instr::Container::get_root()->get_link("ACTOR_LINK")->start_event(process_container, "SR", key);
   }
 
@@ -221,7 +220,7 @@ msg_task_t MSG_task_create(const char *name, double flop_amount, double message_
  * A constructor for #msg_task_t taking six arguments.
  *
  * @beginrst
- * See :cpp:func:`void simgrid::s4u::this_actor::parallel_execute(int, s4u::Host**, double*, double*)` for
+ * See :ref:`simgrid::s4u::this_actor::parallel_execute() <API_s4u_parallel_execute>` for
  * the exact semantic of the parameters.
  * @endrst
  *
@@ -246,7 +245,7 @@ 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(const_msg_task_t task)
 {
-  return task->get_data();
+  return task->get_data<void>();
 }
 
 /** @brief Sets the user data of a given task */
@@ -575,7 +574,7 @@ msg_error_t MSG_task_receive_with_timeout_bounded(msg_task_t* task, const char*
   if (TRACE_actor_is_enabled() && ret != MSG_HOST_FAILURE && ret != MSG_TRANSFER_FAILURE && ret != MSG_TIMEOUT) {
     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());
+    std::string key = "p" + std::to_string((*task)->get_id());
     simgrid::instr::Container::get_root()->get_link("ACTOR_LINK")->end_event(process_container, "SR", key);
   }
   return ret;
@@ -737,7 +736,7 @@ void MSG_task_set_bytes_amount(msg_task_t task, double data_size)
  */
 double MSG_task_get_remaining_communication(const_msg_task_t task)
 {
-  XBT_DEBUG("calling simcall_communication_get_remains(%p)", task->comm.get());
+  XBT_DEBUG("calling s4u::Comm::get_remaining (%p)", task->comm.get());
   return task->comm->get_remaining();
 }
 
@@ -783,8 +782,6 @@ void MSG_task_set_bound(msg_task_t task, double bound)
  *
  * @param task the task that is going to be categorized
  * @param category the name of the category to be associated to the task
- *
- * @see MSG_task_get_category, TRACE_category, TRACE_category_with_color
  */
 void MSG_task_set_category(msg_task_t task, const char* category)
 {