From b68718b7a32ec80574ef05330b6d9dc639454038 Mon Sep 17 00:00:00 2001
From: Mathieu Faverge <mathieu.faverge@inria.fr>
Date: Mon, 20 Jul 2015 13:40:24 +0000
Subject: [PATCH] Cleanup some todo

---
 runtime/starpu/control/runtime_control.c | 32 +++++++++++++-----------
 1 file changed, 17 insertions(+), 15 deletions(-)

diff --git a/runtime/starpu/control/runtime_control.c b/runtime/starpu/control/runtime_control.c
index 54e838e12..88968fd84 100644
--- a/runtime/starpu/control/runtime_control.c
+++ b/runtime/starpu/control/runtime_control.c
@@ -48,27 +48,29 @@ int RUNTIME_init_scheduler( MORSE_context_t *morse, int ncpus, int ncudas, int n
     conf->ncuda = ncudas;
     conf->nopencl = 0;
 
-    /* By default, use the dmdas strategy */
-    if (!getenv("STARPU_SCHED"))
-        conf->sched_policy_name = "dmdas";
-
     /* By default, enable calibration */
     if (!getenv("STARPU_CALIBRATE"))
         conf->calibrate = 1;
 
-    /* Set scheduling to "ws" if no cuda devices used because it behaves better
-     * on homognenous architecture. If the user wants to use another
-     * scheduling strategy, he can set STARPU_SCHED env. var. to whatever he
-     * wants
-     * TODO: discuss this with ManuMathieu
-     * reference, we should use "lws" strategy
-     */
-    if ( !getenv("STARPU_SCHED") && conf->ncuda == 0)
-#if STARPU_MAJOR_VERSION > 1 || (STARPU_MAJOR_VERSION == 1 && STARPU_MINOR_VERSION >= 2)
-        conf->sched_policy_name = "lws";
+    /* By default, use the dmdas strategy */
+    if (!getenv("STARPU_SCHED")) {
+        if (conf->ncuda > 0) {
+            conf->sched_policy_name = "dmdas";
+        }
+        else {
+            /**
+             * Set scheduling to "ws"/"lws" if no cuda devices used because it
+             * behaves better on homogneneous architectures. If the user wants
+             * to use another scheduling strategy, he can set STARPU_SCHED
+             * env. var. to whatever he wants
+             */
+#if (STARPU_MAJOR_VERSION > 1) || ((STARPU_MAJOR_VERSION == 1) && (STARPU_MINOR_VERSION >= 2))
+            conf->sched_policy_name = "lws";
 #else
-        conf->sched_policy_name = "ws";
+            conf->sched_policy_name = "ws";
 #endif
+        }
+    }
 
     if ((ncpus == -1)||(nthreads_per_worker == -1))
     {
-- 
GitLab