Browse Source

Switch default scheduler to lws

Samuel Thibault 7 years ago
parent
commit
fd41c28030

+ 1 - 0
ChangeLog

@@ -51,6 +51,7 @@ Small features:
 
 Changes:
   * Vastly improve simgrid simulation time.
+  * Switch default scheduler to lws.
 
 Small changes:
   * Use asynchronous transfers for task data fetches with were not prefetched.

+ 2 - 2
doc/doxygen/chapters/320_scheduling.doxy

@@ -23,8 +23,8 @@ This means scheduling policies usually contain at least one queue of tasks to
 store them between the time when they become available, and the time when a
 worker gets to grab them.
 
-By default, StarPU uses the simple greedy scheduler <c>eager</c>. This is
-because it provides correct load balance even if the application codelets do
+By default, StarPU uses the work-stealing scheduler <c>lws</c>. This is
+because it provides correct load balance and locality even if the application codelets do
 not have performance models. Other non-modelling scheduling policies can be
 selected among the list below, thanks to the environment variable \ref
 STARPU_SCHED. For instance <c>export STARPU_SCHED=dmda</c> . Use <c>help</c> to

+ 1 - 1
src/core/sched_policy.c

@@ -195,7 +195,7 @@ struct starpu_sched_policy *_starpu_select_sched_policy(struct _starpu_machine_c
 		return selected_policy;
 
 	/* If no policy was specified, we use the eager policy by default */
-	return &_starpu_sched_eager_policy;
+	return &_starpu_sched_lws_policy;
 }
 
 void _starpu_init_sched_policy(struct _starpu_machine_config *config, struct _starpu_sched_ctx *sched_ctx, struct starpu_sched_policy *selected_policy)

+ 1 - 3
src/sched_policies/eager_central_policy.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010-2016  Université de Bordeaux
+ * Copyright (C) 2010-2017  Université de Bordeaux
  * Copyright (C) 2010-2013, 2016  CNRS
  * Copyright (C) 2011, 2017  INRIA
  * Copyright (C) 2016  Uppsala University
@@ -40,8 +40,6 @@ static void initialize_eager_center_policy(unsigned sched_ctx_id)
 	struct _starpu_eager_center_policy_data *data;
 	_STARPU_MALLOC(data, sizeof(struct _starpu_eager_center_policy_data));
 
-	_STARPU_DISP("Warning: you are running the default eager scheduler, which is not a very smart scheduler. Make sure to read the StarPU documentation about adding performance models in order to be able to use the dmda or dmdas scheduler instead.\n");
-
 	/* there is only a single queue in that trivial design */
 	data->fifo =  _starpu_create_fifo();
 	data->waiters = starpu_bitmap_create();

+ 7 - 0
src/sched_policies/work_stealing_policy.c

@@ -828,6 +828,13 @@ static void initialize_lws_policy(unsigned sched_ctx_id)
 	/* lws is loosely based on ws, except that it might use hwloc. */
 	initialize_ws_policy(sched_ctx_id);
 
+	if (starpu_worker_get_count() != starpu_cpu_worker_get_count()
+			|| starpu_memory_nodes_get_numa_count() > 1
+		)
+	{
+		_STARPU_DISP("Warning: you are running the default lws scheduler, which is not a very smart scheduler, while the system has GPUs or several memory nodes. Make sure to read the StarPU documentation about adding performance models in order to be able to use the dmda or dmdas scheduler instead.\n");
+	}
+
 #ifdef STARPU_HAVE_HWLOC
 	struct _starpu_work_stealing_data *ws = (struct _starpu_work_stealing_data *)starpu_sched_ctx_get_policy_data(sched_ctx_id);
 	ws->select_victim = lws_select_victim;