Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
sanitizes the msg_task fields default value
authorMartin Quinson <martin.quinson@loria.fr>
Tue, 21 Mar 2017 12:17:19 +0000 (13:17 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Tue, 21 Mar 2017 12:17:19 +0000 (13:17 +0100)
src/msg/msg_private.h
src/msg/msg_task.cpp

index 7ccb878..add80f2 100644 (file)
@@ -50,9 +50,10 @@ typedef struct simdata_task {
   msg_process_t sender = nullptr;
   msg_process_t receiver = nullptr;
   msg_host_t source = nullptr;
-  double priority = 0.0;
-  double bound = 0.0; /* Capping for CPU resource */
-  double rate = 0.0;  /* Capping for network resource */
+
+  double priority = 1.0;
+  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 */
   int host_nb = 0;      /* ==0 if sequential task; parallel task if not */
index 8d0f635..98752c1 100644 (file)
@@ -58,22 +58,9 @@ msg_task_t MSG_task_create(const char *name, double flop_amount, double message_
   task->data = data;
 
   /* Simulator Data */
-  simdata->compute = nullptr;
-  simdata->comm = nullptr;
   simdata->bytes_amount = message_size;
   simdata->flops_amount = flop_amount;
-  simdata->sender = nullptr;
-  simdata->receiver = nullptr;
-  simdata->source = nullptr;
-  simdata->priority = 1.0;
-  simdata->bound = 0;
-  simdata->rate = -1.0;
-  simdata->isused = 0;
-
-  simdata->host_nb = 0;
-  simdata->host_list = nullptr;
-  simdata->flops_parallel_amount = nullptr;
-  simdata->bytes_parallel_amount = nullptr;
+
   TRACE_msg_task_create(task);
 
   return task;