Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
obey our coding standards + kill dead code
authorMartin Quinson <martin.quinson@loria.fr>
Thu, 16 Feb 2017 00:36:13 +0000 (01:36 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Thu, 16 Feb 2017 00:40:35 +0000 (01:40 +0100)
MSG is tiring nowadays

src/msg/msg_gos.cpp
src/msg/msg_private.h
src/msg/msg_process.cpp

index 643143c..f6e2c8e 100644 (file)
@@ -45,7 +45,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;
-  MsgActorExt* p_simdata = static_cast<MsgActorExt*>(SIMIX_process_self_get_data());
   e_smx_state_t comp_state;
   msg_error_t status = MSG_OK;
 
@@ -73,10 +72,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 +307,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<MsgActorExt*>(SIMIX_process_self_get_data()))->m_host;
+  t_simdata->source = (static_cast<MsgActorExt*>(SIMIX_process_self_get_data()))->host_;
   t_simdata->setUsed();
   t_simdata->comm = nullptr;
   msg_global->sent_msg++;
@@ -775,7 +772,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();
-  MsgActorExt* p_simdata           = static_cast<MsgActorExt*>(process->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 +779,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<MsgActorExt*>(SIMIX_process_self_get_data()))->m_host;
+  t_simdata->source = (static_cast<MsgActorExt*>(SIMIX_process_self_get_data()))->host_;
 
   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 +815,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;
index 79a7c92..b0aea86 100644 (file)
@@ -75,11 +75,8 @@ typedef struct simdata_file {
 
 class MsgActorExt {
 public:
-  msg_host_t m_host; /* the host on which the process is running */
-  smx_activity_t waiting_action = nullptr;
-  msg_task_t waiting_task       = nullptr;
-  msg_error_t last_errno        = MSG_OK; /* the last value returned by a MSG_function */
-
+  msg_host_t host_; /* the host on which the process is running */
+  msg_error_t errno_ = MSG_OK;  /* the last value returned by a MSG_function */
   void* data = nullptr; /* user data */
 };
 
index 91ebad6..aaefa59 100644 (file)
@@ -144,7 +144,7 @@ msg_process_t MSG_process_create_with_environment(
   MsgActorExt* simdata = new MsgActorExt();
 
   /* Simulator data for MSG */
-  simdata->m_host = host;
+  simdata->host_ = host;
   simdata->data = data;
 
   /* Let's create the process: SIMIX may decide to start it right now,
@@ -175,7 +175,7 @@ msg_process_t MSG_process_attach(const char *name, void *data, msg_host_t host,
   MsgActorExt* msgExt = new MsgActorExt();
 
   /* Simulator data for MSG */
-  msgExt->m_host = host;
+  msgExt->host_  = host;
   msgExt->data   = data;
 
   /* Let's create the process: SIMIX may decide to start it right now, even before returning the flow control to us */
@@ -227,8 +227,8 @@ msg_error_t MSG_process_join(msg_process_t process, double timeout){
 msg_error_t MSG_process_migrate(msg_process_t process, msg_host_t host)
 {
   MsgActorExt* msgExt = (MsgActorExt*)process->data;
-  msgExt->m_host      = host;
-  msg_host_t now      = msgExt->m_host;
+  msgExt->host_       = host;
+  msg_host_t now      = msgExt->host_;
   TRACE_msg_process_change_host(process, now, host);
   simcall_process_set_host(process, host);
   return MSG_OK;
@@ -294,7 +294,7 @@ msg_host_t MSG_process_get_host(msg_process_t process)
   else {
     msgExt = (MsgActorExt*)process->data;
   }
-  return msgExt ? msgExt->m_host : nullptr;
+  return msgExt ? msgExt->host_ : nullptr;
 }
 
 /** \ingroup m_process_management