Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
snake casing
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Fri, 22 Feb 2019 11:43:27 +0000 (12:43 +0100)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Fri, 22 Feb 2019 11:43:27 +0000 (12:43 +0100)
src/msg/msg_gos.cpp
src/msg/msg_private.hpp
src/msg/msg_task.cpp

index 5aa7a6f..77b2e76 100644 (file)
@@ -46,8 +46,7 @@ msg_error_t MSG_parallel_task_execute_with_timeout(msg_task_t task, double timeo
   e_smx_state_t comp_state;
   msg_error_t status = MSG_OK;
 
-
-  xbt_assert((not simdata->compute) && not task->simdata->isused,
+  xbt_assert((not simdata->compute) && not task->simdata->is_used,
              "This task is executed somewhere else. Go fix your code!");
 
   XBT_DEBUG("Computing on %s", MSG_process_get_name(MSG_process_self()));
@@ -60,7 +59,7 @@ msg_error_t MSG_parallel_task_execute_with_timeout(msg_task_t task, double timeo
     simgrid::instr::Container::by_name(instr_pid(MSG_process_self()))->get_state("ACTOR_STATE")->push_event("execute");
 
   try {
-    simdata->setUsed();
+    simdata->set_used();
 
     if (simdata->host_nb > 0) {
       simdata->compute =
@@ -86,7 +85,7 @@ msg_error_t MSG_parallel_task_execute_with_timeout(msg_task_t task, double timeo
 
     comp_state = simcall_execution_wait(simdata->compute);
 
-    simdata->setNotUsed();
+    simdata->set_not_used();
 
     XBT_DEBUG("Execution task '%s' finished in state %d", task->name, (int)comp_state);
   } catch (simgrid::HostFailureException& e) {
@@ -254,7 +253,7 @@ msg_error_t MSG_task_receive_ext_bounded(msg_task_t * task, const char *alias, d
         ->wait_for(timeout);
     *task = static_cast<msg_task_t>(payload);
     XBT_DEBUG("Got task %s from %s", (*task)->name, alias);
-    (*task)->simdata->setNotUsed();
+    (*task)->simdata->set_not_used();
   } catch (simgrid::HostFailureException& e) {
     ret = MSG_HOST_FAILURE;
   } catch (simgrid::TimeoutError& e) {
@@ -290,7 +289,7 @@ static inline msg_comm_t MSG_task_isend_internal(msg_task_t task, const char* al
   t_simdata = task->simdata;
   t_simdata->sender = myself;
   t_simdata->source = MSG_host_self();
-  t_simdata->setUsed();
+  t_simdata->set_used();
   t_simdata->comm = nullptr;
   msg_global->sent_msg++;
 
@@ -454,7 +453,7 @@ int MSG_comm_test(msg_comm_t comm)
     finished = comm->s_comm->test();
     if (finished && comm->task_received != nullptr) {
       /* I am the receiver */
-      (*comm->task_received)->simdata->setNotUsed();
+      (*comm->task_received)->simdata->set_not_used();
     }
   } catch (simgrid::TimeoutError& e) {
     comm->status = MSG_TIMEOUT;
@@ -519,7 +518,7 @@ int MSG_comm_testany(xbt_dynar_t comms)
 
     if (status == MSG_OK && comm->task_received != nullptr) {
       /* I am the receiver */
-      (*comm->task_received)->simdata->setNotUsed();
+      (*comm->task_received)->simdata->set_not_used();
     }
   }
 
@@ -547,7 +546,7 @@ msg_error_t MSG_comm_wait(msg_comm_t comm, double timeout)
 
     if (comm->task_received != nullptr) {
       /* I am the receiver */
-      (*comm->task_received)->simdata->setNotUsed();
+      (*comm->task_received)->simdata->set_not_used();
     }
 
     /* FIXME: these functions are not traceable */
@@ -623,7 +622,7 @@ int MSG_comm_waitany(xbt_dynar_t comms)
 
   if (comm->task_received != nullptr) {
     /* I am the receiver */
-    (*comm->task_received)->simdata->setNotUsed();
+    (*comm->task_received)->simdata->set_not_used();
   }
 
   return finished_index;
@@ -734,7 +733,7 @@ msg_error_t MSG_task_send_with_timeout(msg_task_t task, const char *alias, doubl
   simdata_task_t t_simdata = task->simdata;
   t_simdata->sender        = MSG_process_self();
   t_simdata->source = MSG_host_self();
-  t_simdata->setUsed();
+  t_simdata->set_used();
 
   msg_global->sent_msg++;
 
@@ -758,7 +757,7 @@ msg_error_t MSG_task_send_with_timeout(msg_task_t task, const char *alias, doubl
       throw;
 
     /* If the send failed, it is not used anymore */
-    t_simdata->setNotUsed();
+    t_simdata->set_not_used();
   }
 
   return ret;
index 63a3a42..fc99a2a 100644 (file)
@@ -22,8 +22,8 @@ struct s_simdata_task_t {
     delete[] flops_parallel_amount;
     delete[] bytes_parallel_amount;
   }
-  void setUsed();
-  void setNotUsed() { this->isused = false; }
+  void set_used();
+  void set_not_used() { this->is_used = false; }
 
   simgrid::kernel::activity::ExecImplPtr compute = nullptr; /* SIMIX modeling of computation */
   simgrid::s4u::CommPtr comm                     = nullptr; /* S4U modeling of communication */
@@ -37,7 +37,7 @@ struct s_simdata_task_t {
   double bound    = 0.0; /* Capping for CPU resource, or 0 for no capping */
   double rate     = -1;  /* Capping for network resource, or -1 for no capping*/
 
-  bool isused = false; /* Indicates whether the task is used in SIMIX currently */
+  bool is_used = false; /* Indicates whether the task is used in SIMIX currently */
   int host_nb = 0;     /* ==0 if sequential task; parallel task if not */
   /*******  Parallel Tasks Only !!!! *******/
   sg_host_t* host_list          = nullptr;
@@ -45,7 +45,7 @@ struct s_simdata_task_t {
   double* bytes_parallel_amount = nullptr;
 
 private:
-  void reportMultipleUse() const;
+  void report_multiple_use() const;
 };
 
 /******************************* Process *************************************/
@@ -85,12 +85,11 @@ XBT_PRIVATE void MSG_comm_copy_data_from_SIMIX(simgrid::kernel::activity::CommIm
 /* declaration of instrumentation functions from msg_task_instr.c */
 XBT_PRIVATE void TRACE_msg_task_put_start(msg_task_t task);
 
-
-inline void s_simdata_task_t::setUsed()
+inline void s_simdata_task_t::set_used()
 {
-  if (this->isused)
-    this->reportMultipleUse();
-  this->isused = true;
+  if (this->is_used)
+    this->report_multiple_use();
+  this->is_used = true;
 }
 
 #endif
index 7463547..67a3c53 100644 (file)
@@ -12,7 +12,7 @@
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_task, msg, "Logging specific to MSG (task)");
 
-void s_simdata_task_t::reportMultipleUse() const
+void s_simdata_task_t::report_multiple_use() const
 {
   if (msg_global->debug_multiple_use){
     XBT_ERROR("This task is already used in there:");
@@ -170,7 +170,7 @@ void MSG_task_set_name(msg_task_t task, const char *name)
  */
 msg_error_t MSG_task_destroy(msg_task_t task)
 {
-  if (task->simdata->isused) {
+  if (task->simdata->is_used) {
     /* the task is being sent or executed: cancel it first */
     MSG_task_cancel(task);
   }
@@ -199,7 +199,7 @@ msg_error_t MSG_task_cancel(msg_task_t task)
   } else if (simdata->comm) {
     simdata->comm->cancel();
   }
-  simdata->setNotUsed();
+  simdata->set_not_used();
   return MSG_OK;
 }