Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
please sonar
[simgrid.git] / src / msg / msg_gos.cpp
index 6ac5ddf..bab4a4d 100644 (file)
@@ -10,6 +10,8 @@
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_gos, msg, "Logging specific to MSG (gos)");
 
+SG_BEGIN_DECL()
+
 /** \ingroup msg_task_usage
  * \brief Executes a task and waits for its termination.
  *
@@ -45,7 +47,6 @@ msg_error_t MSG_parallel_task_execute(msg_task_t task)
 msg_error_t MSG_parallel_task_execute_with_timeout(msg_task_t task, double timeout)
 {
   simdata_task_t simdata = task->simdata;
-  simdata_process_t p_simdata = static_cast<simdata_process_t>(SIMIX_process_self_get_data());
   e_smx_state_t comp_state;
   msg_error_t status = MSG_OK;
 
@@ -73,10 +74,8 @@ msg_error_t MSG_parallel_task_execute_with_timeout(msg_task_t task, double timeo
           simcall_execution_start(task->name, simdata->flops_amount, simdata->priority, simdata->bound));
     }
     simcall_set_category(simdata->compute, task->category);
-    p_simdata->waiting_action = simdata->compute;
     comp_state = simcall_execution_wait(simdata->compute);
 
-    p_simdata->waiting_action = nullptr;
     simdata->setNotUsed();
 
     XBT_DEBUG("Execution task '%s' finished in state %d", task->name, (int)comp_state);
@@ -310,7 +309,7 @@ static inline msg_comm_t MSG_task_isend_internal(msg_task_t task, const char *al
   /* Prepare the task to send */
   t_simdata = task->simdata;
   t_simdata->sender = myself;
-  t_simdata->source = (static_cast<simdata_process_t>(SIMIX_process_self_get_data()))->m_host;
+  t_simdata->source = MSG_host_self();
   t_simdata->setUsed();
   t_simdata->comm = nullptr;
   msg_global->sent_msg++;
@@ -703,7 +702,7 @@ msg_task_t MSG_comm_get_task(msg_comm_t comm)
 
 /**
  * \brief This function is called by SIMIX in kernel mode to copy the data of a comm.
- * \param comm the comm
+ * \param synchro the comm
  * \param buff the data copied
  * \param buff_size size of the buffer
  */
@@ -775,7 +774,6 @@ msg_error_t MSG_task_send_with_timeout(msg_task_t task, const char *alias, doubl
   msg_error_t ret = MSG_OK;
   simdata_task_t t_simdata = nullptr;
   msg_process_t process = MSG_process_self();
-  simdata_process_t p_simdata = static_cast<simdata_process_t>(SIMIX_process_self_get_data());
   simgrid::s4u::MailboxPtr mailbox = simgrid::s4u::Mailbox::byName(alias);
 
   int call_end = TRACE_msg_task_put_start(task);    //must be after CHECK_HOST()
@@ -783,15 +781,13 @@ msg_error_t MSG_task_send_with_timeout(msg_task_t task, const char *alias, doubl
   /* Prepare the task to send */
   t_simdata = task->simdata;
   t_simdata->sender = process;
-  t_simdata->source = (static_cast<simdata_process_t>(SIMIX_process_self_get_data()))   ->m_host;
+  t_simdata->source = MSG_host_self();
 
   t_simdata->setUsed();
 
   t_simdata->comm = nullptr;
   msg_global->sent_msg++;
 
-  p_simdata->waiting_task = task;
-
   /* Try to send it by calling SIMIX network layer */
   try {
     smx_activity_t comm = nullptr; /* MC needs the comm to be set to nullptr during the simix call  */
@@ -821,7 +817,6 @@ msg_error_t MSG_task_send_with_timeout(msg_task_t task, const char *alias, doubl
     t_simdata->setNotUsed();
   }
 
-  p_simdata->waiting_task = nullptr;
   if (call_end)
     TRACE_msg_task_put_end();
   return ret;
@@ -913,3 +908,5 @@ const char *MSG_task_get_category (msg_task_t task)
 {
   return task->category;
 }
+
+SG_END_DECL()