Browse Source

Avoid helgrind warnings on statistics

Samuel Thibault 8 years ago
parent
commit
72c5144f39
1 changed files with 14 additions and 6 deletions
  1. 14 6
      src/sched_policies/deque_modeling_policy_data_aware.c

+ 14 - 6
src/sched_policies/deque_modeling_policy_data_aware.c

@@ -982,21 +982,29 @@ static void dmda_add_workers(unsigned sched_ctx_id, int *workerids, unsigned nwo
 	unsigned i;
 	for (i = 0; i < nworkers; i++)
 	{
+		struct _starpu_fifo_taskq *q;
 		int workerid = workerids[i];
 		/* if the worker has alreadry belonged to this context
 		   the queue and the synchronization variables have been already initialized */
-		if(dt->queue_array[workerid] == NULL)
-			dt->queue_array[workerid] = _starpu_create_fifo();
+		q = dt->queue_array[workerid];
+		if(q == NULL)
+		{
+			q = dt->queue_array[workerid] = _starpu_create_fifo();
+			/* These are only stats, they can be read with races */
+			STARPU_HG_DISABLE_CHECKING(q->exp_start);
+			STARPU_HG_DISABLE_CHECKING(q->exp_len);
+			STARPU_HG_DISABLE_CHECKING(q->exp_end);
+		}
 
 		if(dt->num_priorities != -1)
 		{
-			_STARPU_MALLOC(dt->queue_array[workerid]->exp_len_per_priority, dt->num_priorities*sizeof(double));
-			_STARPU_MALLOC(dt->queue_array[workerid]->ntasks_per_priority, dt->num_priorities*sizeof(unsigned));
+			_STARPU_MALLOC(q->exp_len_per_priority, dt->num_priorities*sizeof(double));
+			_STARPU_MALLOC(q->ntasks_per_priority, dt->num_priorities*sizeof(unsigned));
 			int j;
 			for(j = 0; j < dt->num_priorities; j++)
 			{
-				dt->queue_array[workerid]->exp_len_per_priority[j] = 0.0;
-				dt->queue_array[workerid]->ntasks_per_priority[j] = 0;
+				q->exp_len_per_priority[j] = 0.0;
+				q->ntasks_per_priority[j] = 0;
 			}
 		}
 	}