Kaynağa Gözat

merge trunk@9680, trunk@9683: tests/sched_policies/prio.c: use portable random function, drand48 returns values between 0 and 1

Nathalie Furmento 11 yıl önce
ebeveyn
işleme
0d7c8ed948
1 değiştirilmiş dosya ile 3 ekleme ve 1 silme
  1. 3 1
      tests/sched_policies/prio.c

+ 3 - 1
tests/sched_policies/prio.c

@@ -74,10 +74,12 @@ run(struct starpu_sched_policy *policy)
 		.nbuffers = 0
 	};
 
+        starpu_srand48(0);
+
 	for (i = 0; i < NTASKS; i++) {
 		struct starpu_task *task = starpu_task_create();
 
-		if (random()%2) {
+		if (((int)(starpu_drand48()*2))%2) {
 			task->cl = &clA;
 			task->priority=STARPU_MIN_PRIO;
 		} else {