Explorar el Código

When STARPU_SCHED is specified, only execute tests for this scheduler

Samuel Thibault hace 5 años
padre
commit
ed3fa8d283

+ 1 - 0
examples/cholesky/cholesky.sh

@@ -16,6 +16,7 @@
 #
 
 ROOT=${0%.sh}
+[ -z "$STARPU_SCHED" ] || STARPU_SCHEDS="$STARPU_SCHED"
 #[ -n "$STARPU_SCHEDS" ] || STARPU_SCHEDS=`$(dirname $0)/../../tools/starpu_sched_display`
 [ -n "$STARPU_SCHEDS" ] || STARPU_SCHEDS="dmdas modular-heft2 modular-heft modular-heft-prio modular-heteroprio dmdap dmdar dmda dmdasd prio lws"
 [ -n "$STARPU_HOSTNAME" ] || export STARPU_HOSTNAME=mirage

+ 5 - 4
examples/scheduler/dummy_modular_sched.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010-2018                                Université de Bordeaux
+ * Copyright (C) 2010-2019                                Université de Bordeaux
  * Copyright (C) 2012,2013,2015                           Inria
  * Copyright (C) 2010-2013,2015-2017                      CNRS
  *
@@ -229,9 +229,10 @@ int main(void)
 	int ret;
 	struct starpu_conf conf;
 
-#ifdef STARPU_HAVE_UNSETENV
-	unsetenv("STARPU_SCHED");
-#endif
+	char *sched = getenv("STARPU_SCHED");
+	if (sched && sched[0])
+		/* Testing a specific scheduler, no need to run this */
+		return 77;
 
 	starpu_conf_init(&conf);
 	conf.sched_policy = &dummy_sched_policy,

+ 5 - 4
examples/scheduler/dummy_sched.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2011-2013,2015                           Inria
- * Copyright (C) 2010-2018                                Université de Bordeaux
+ * Copyright (C) 2010-2019                                Université de Bordeaux
  * Copyright (C) 2010-2013,2015-2017                      CNRS
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -158,9 +158,10 @@ int main(void)
 	int ret;
 	struct starpu_conf conf;
 
-#ifdef STARPU_HAVE_UNSETENV
-	unsetenv("STARPU_SCHED");
-#endif
+	char *sched = getenv("STARPU_SCHED");
+	if (sched && sched[0])
+		/* Testing a specific scheduler, no need to run this */
+		return 77;
 
 	starpu_conf_init(&conf);
 	conf.sched_policy = &dummy_sched_policy,

+ 6 - 1
examples/scheduler/schedulers.sh

@@ -30,7 +30,12 @@ then
     exit 77
 fi
 
-SCHEDULERS=`../tools/starpu_sched_display | grep -v heteroprio`
+if [ -n "$STARPU_SCHED" ]
+then
+	SCHEDULERS=$STARPU_SCHED
+else
+	SCHEDULERS=`../tools/starpu_sched_display | grep -v heteroprio`
+fi
 
 for sched in $SCHEDULERS
 do

+ 6 - 1
examples/scheduler/schedulers_context.sh

@@ -29,7 +29,12 @@ then
     exit 77
 fi
 
-SCHEDULERS=`../tools/starpu_sched_display | grep -v pheft | grep -v peager | grep -v heteroprio | grep -v modular-gemm`
+if [ -n "$STARPU_SCHED" ]
+then
+	SCHEDULERS="$STARPU_SCHED"
+else
+	SCHEDULERS=`../tools/starpu_sched_display | grep -v pheft | grep -v peager | grep -v heteroprio | grep -v modular-gemm`
+fi
 
 for sched in $SCHEDULERS
 do

+ 4 - 1
tests/cholesky/sched.sh

@@ -1,7 +1,7 @@
 #!/bin/bash
 # StarPU --- Runtime system for heterogeneous multicore architectures.
 #
-# Copyright (C) 2008-2011,2014                           Université de Bordeaux
+# Copyright (C) 2008-2011,2014,2019                      Université de Bordeaux
 # Copyright (C) 2010,2015,2017                           CNRS
 #
 # StarPU is free software; you can redistribute it and/or modify
@@ -16,6 +16,9 @@
 # See the GNU Lesser General Public License in COPYING.LGPL for more details.
 #
 
+# Testing another specific scheduler, no need to run this
+[ -z "$STARPU_SCHED" -a "$STARPU_SCHED" != greedy -a "$STARPU_SCHED" != no-prio -a "$STARPU_SCHED" != dm -a "$STARPU_SCHED" != random ] || exit 77
+
 maxiter=10
 MAXCPU=3
 

+ 4 - 1
tests/cholesky/sched_one_gpu.sh

@@ -1,7 +1,7 @@
 #!/bin/bash
 # StarPU --- Runtime system for heterogeneous multicore architectures.
 #
-# Copyright (C) 2009-2011,2014                           Université de Bordeaux
+# Copyright (C) 2009-2011,2014,2019                      Université de Bordeaux
 # Copyright (C) 2010,2015,2017                           CNRS
 #
 # StarPU is free software; you can redistribute it and/or modify
@@ -19,6 +19,9 @@ maxiter=5
 ROOTDIR=../../
 TIMINGDIR=$PWD/timing/
 
+# Testing another specific scheduler, no need to run this
+[ -z "$STARPU_SCHED" -a "$STARPU_SCHED" != dm -a "$STARPU_SCHED" != greedy ] || exit 77
+
 export STARPU_WORKERS_CUDAID="1"
 
 trace_sched()

+ 4 - 1
tests/datawizard/locality.sh

@@ -4,7 +4,7 @@
 # Copyright (C) 2018                                     Federal University of Rio Grande do Sul (UFRGS)
 # Copyright (C) 2017                                     CNRS
 # Copyright (C) 2017                                     Inria
-# Copyright (C) 2017,2018                                Université de Bordeaux
+# Copyright (C) 2017,2018-2019                           Université de Bordeaux
 #
 # StarPU is free software; you can redistribute it and/or modify
 # it under the terms of the GNU Lesser General Public License as published by
@@ -19,6 +19,9 @@
 #
 # Test generation of FxT traces
 
+# Testing another specific scheduler, no need to run this
+[ -z "$STARPU_SCHED" -a "$STARPU_SCHED" != modular-eager ] || exit 77
+
 set -e
 
 PREFIX=$(dirname $0)

+ 4 - 1
tests/heat/dmda.sh

@@ -1,7 +1,7 @@
 #!/bin/bash
 # StarPU --- Runtime system for heterogeneous multicore architectures.
 #
-# Copyright (C) 2009-2011,2014                           Université de Bordeaux
+# Copyright (C) 2009-2011,2014, 2019                           Université de Bordeaux
 # Copyright (C) 2010,2015,2017                           CNRS
 #
 # StarPU is free software; you can redistribute it and/or modify
@@ -17,6 +17,9 @@
 #
 maxiter=2
 
+# Testing another specific scheduler, no need to run this
+[ -z "$STARPU_SCHED" -a "$STARPU_SCHED" != dm -a "$STARPU_SCHED" != dmda ] || exit 77
+
 calibrate_point()
 {
 	strat=$1

+ 4 - 1
tests/heat/granularity.sh

@@ -1,7 +1,7 @@
 #!/bin/bash
 # StarPU --- Runtime system for heterogeneous multicore architectures.
 #
-# Copyright (C) 2008-2011,2014                           Université de Bordeaux
+# Copyright (C) 2008-2011,2014, 2019                           Université de Bordeaux
 # Copyright (C) 2010,2015,2017                           CNRS
 #
 # StarPU is free software; you can redistribute it and/or modify
@@ -24,6 +24,9 @@ maxiter=5
 MINSIZE=$((30*1024))
 MAXSIZE=$((31*1024))
 
+# Testing another specific scheduler, no need to run this
+[ -z "$STARPU_SCHED" -a "$STARPU_SCHED" != dm -a "$STARPU_SCHED" != dmda ] || exit 77
+
 trace_granularity()
 {
 	grain=$1

+ 4 - 1
tests/heat/model_perturbation.sh

@@ -1,7 +1,7 @@
 #!/bin/bash
 # StarPU --- Runtime system for heterogeneous multicore architectures.
 #
-# Copyright (C) 2008-2011,2014                           Université de Bordeaux
+# Copyright (C) 2008-2011,2014, 2019                           Université de Bordeaux
 # Copyright (C) 2010,2015,2017                           CNRS
 #
 # StarPU is free software; you can redistribute it and/or modify
@@ -20,6 +20,9 @@
 #ampllist="1.0 0.50 0.25 0.1 0.0"
 ampllist="1.0 0.5"
 
+# Testing another specific scheduler, no need to run this
+[ -z "$STARPU_SCHED" -a "$STARPU_SCHED" != dm ] || exit 77
+
 maxiter=1
 MAXCPU=3
 

+ 4 - 1
tests/heat/sched.sh

@@ -1,7 +1,7 @@
 #!/bin/bash
 # StarPU --- Runtime system for heterogeneous multicore architectures.
 #
-# Copyright (C) 2008-2011,2014                           Université de Bordeaux
+# Copyright (C) 2008-2011,2014, 2019                           Université de Bordeaux
 # Copyright (C) 2010,2015,2017                           CNRS
 #
 # StarPU is free software; you can redistribute it and/or modify
@@ -17,6 +17,9 @@
 #
 maxiter=5
 
+# Testing another specific scheduler, no need to run this
+[ -z "$STARPU_SCHED" -a "$STARPU_SCHED" != greedy -a "$STARPU_SCHED" != dm -a "$STARPU_SCHED" != dmda ] || exit 77
+
 calibrate_point()
 {
 	strat=$1

+ 4 - 1
tests/main/combined_workers/bfs/run.sh

@@ -3,7 +3,7 @@
 #
 # Copyright (C) 2012,2016,2017                           CNRS
 # Copyright (C) 2012                                     Inria
-# Copyright (C) 2014                                     Université de Bordeaux
+# Copyright (C) 2014,2019                                Université de Bordeaux
 #
 # StarPU is free software; you can redistribute it and/or modify
 # it under the terms of the GNU Lesser General Public License as published by
@@ -16,6 +16,9 @@
 #
 # See the GNU Lesser General Public License in COPYING.LGPL for more details.
 #
+# Testing another specific scheduler, no need to run this
+[ -z "$STARPU_SCHED" -a "$STARPU_SCHED" != pheft ] || exit 77
+
 #export STARPU_GENERATE_TRACE=1
 #export GOMP_CPU_AFFINITY="0 6 1 7 2 8 3 9 4 10 5 11"
 #export OMP_WAIT_POLICY=PASSIVE

+ 7 - 1
tests/microbenchs/microbench.sh

@@ -23,7 +23,13 @@
 
 set -e
 
-SCHEDS=`$(dirname $0)/../../tools/starpu_sched_display`
+# Testing a specific scheduler
+if [ -n "$STARPU_SCHED" ]
+then
+	SCHEDS=$STARPU_SCHED
+else
+	SCHEDS=`$(dirname $0)/../../tools/starpu_sched_display`
+fi
 
 test_scheds()
 {

+ 4 - 1
tests/mult/sched.sh

@@ -1,7 +1,7 @@
 #!/bin/bash
 # StarPU --- Runtime system for heterogeneous multicore architectures.
 #
-# Copyright (C) 2008-2011,2014                           Université de Bordeaux
+# Copyright (C) 2008-2011,2014,2019                      Université de Bordeaux
 # Copyright (C) 2010,2015,2017                           CNRS
 #
 # StarPU is free software; you can redistribute it and/or modify
@@ -17,6 +17,9 @@
 #
 maxiter=5
 
+# Testing another specific scheduler, no need to run this
+[ -z "$STARPU_SCHED" -a "$STARPU_SCHED" != random -a "$STARPU_SCHED" != greedy -a "$STARPU_SCHED" != dm ] || exit 77
+
 trace_sched()
 {
 	sched=$1

+ 3 - 0
tests/overlap/overlap.sh

@@ -19,6 +19,9 @@
 #
 # Test parsing of FxT traces
 
+# Testing another specific scheduler, no need to run this
+[ -z "$STARPU_SCHED" -a "$STARPU_SCHED" != dmdas ] || exit 77
+
 set -e
 
 PREFIX=$(dirname $0)

+ 4 - 1
tests/perf_models/bench_sgemm.sh

@@ -1,7 +1,7 @@
 #!/bin/bash
 # StarPU --- Runtime system for heterogeneous multicore architectures.
 #
-# Copyright (C) 2009-2011,2014                           Université de Bordeaux
+# Copyright (C) 2009-2011,2014,2019                      Université de Bordeaux
 # Copyright (C) 2010,2015,2017                           CNRS
 #
 # StarPU is free software; you can redistribute it and/or modify
@@ -21,6 +21,9 @@ BUILDDIR=$PWD/build/
 INSTALLDIR=$PWD/local/
 PERFDIR=$DIR/sampling/
 
+# Testing another specific scheduler, no need to run this
+[ -z "$STARPU_SCHED" -a "$STARPU_SCHED" != dm ] || exit 77
+
 make -C ../../ distclean
 
 mkdir -p $PERFDIR

+ 4 - 1
tests/perf_models/error_model.sh

@@ -1,7 +1,7 @@
 #!/bin/bash
 # StarPU --- Runtime system for heterogeneous multicore architectures.
 #
-# Copyright (C) 2009-2011,2014                           Université de Bordeaux
+# Copyright (C) 2009-2011,2014, 2019                           Université de Bordeaux
 # Copyright (C) 2010,2015,2017                           CNRS
 #
 # StarPU is free software; you can redistribute it and/or modify
@@ -25,6 +25,9 @@ niter=5
 #nblockslist="4 4"
 #niter=2
 
+# Testing another specific scheduler, no need to run this
+[ -z "$STARPU_SCHED" -a "$STARPU_SCHED" != dm ] || exit 77
+
 
 rm -f log
 

+ 7 - 4
tests/sched_policies/data_locality.c

@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2012,2013                                Inria
  * Copyright (C) 2012-2015,2017                           CNRS
- * Copyright (C) 2014,2016                                Université de Bordeaux
+ * Copyright (C) 2014,2016,2019                           Université de Bordeaux
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -200,13 +200,16 @@ int main(void)
 	int n_policies = sizeof(policies)/sizeof(policies[0]);
 	int global_ret = 0;
 
-#ifdef STARPU_HAVE_UNSETENV
-	unsetenv("STARPU_SCHED");
-#endif
+	char *sched = getenv("STARPU_SCHED");
 
 	for (i = 0; i < n_policies; ++i)
 	{
 		struct starpu_sched_policy *policy = policies[i];
+
+		if (sched && strcmp(sched, policy->policy_name))
+			/* Testing another specific scheduler, no need to run this */
+			continue;
+
 		FPRINTF(stdout, "Running with policy %s.\n", policy->policy_name);
 		int ret = run(policy);
 		if (ret == -ENODEV && global_ret == 0)

+ 6 - 4
tests/sched_policies/execute_all_tasks.c

@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2012                                     Inria
  * Copyright (C) 2012,2013,2015,2017                      CNRS
- * Copyright (C) 2013,2014,2016                           Université de Bordeaux
+ * Copyright (C) 2013,2014,2016,2019                      Université de Bordeaux
  * Copyright (C) 2013                                     Thibaut Lambert
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -102,13 +102,15 @@ int main(void)
 	struct starpu_sched_policy **policies;
 	struct starpu_sched_policy **policy;
 
-#ifdef STARPU_HAVE_UNSETENV
-	unsetenv("STARPU_SCHED");
-#endif
+	char *sched = getenv("STARPU_SCHED");
 
 	policies = starpu_sched_get_predefined_policies();
 	for(policy=policies ; *policy!=NULL ; policy++)
 	{
+		if (sched && strcmp(sched, (*policy)->policy_name))
+			/* Testing another specific scheduler, no need to run this */
+			continue;
+
 		FPRINTF(stderr, "Running with policy %s.\n", (*policy)->policy_name);
 		int ret;
 		ret = run(*policy);

+ 6 - 4
tests/sched_policies/prio.c

@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2013                                     Simon Archipoff
  * Copyright (C) 2013,2015,2017                           CNRS
- * Copyright (C) 2013-2016                                Université de Bordeaux
+ * Copyright (C) 2013-2016, 2019                                Université de Bordeaux
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -122,15 +122,17 @@ int main(void)
 	struct starpu_sched_policy **policies;
 	struct starpu_sched_policy **policy;
 
-#ifdef STARPU_HAVE_UNSETENV
-	unsetenv("STARPU_SCHED");
-#endif
+	char *sched = getenv("STARPU_SCHED");
 
 	policies = starpu_sched_get_predefined_policies();
 	for(policy=policies ; *policy!=NULL ; policy++)
 	{
 		int ret;
 
+		if (sched && strcmp(sched, (*policy)->policy_name))
+			/* Testing another specific scheduler, no need to run this */
+			continue;
+
 		FPRINTF(stderr, "Running with policy %s.\n", (*policy)->policy_name);
 		ret = run(*policy);
 		if (ret == -ENODEV)

+ 8 - 4
tests/sched_policies/simple_cpu_gpu_sched.c

@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2012,2014,2017                           Inria
  * Copyright (C) 2012-2017                                CNRS
- * Copyright (C) 2013,2014,2016                           Université de Bordeaux
+ * Copyright (C) 2013,2014,2016,2019                      Université de Bordeaux
  * Copyright (C) 2013                                     Thibaut Lambert
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -262,9 +262,8 @@ int main(void)
 #else
 	setenv("STARPU_SCHED_BETA", "0", 1);
 
-#ifdef STARPU_HAVE_UNSETENV
-	unsetenv("STARPU_SCHED");
-#endif
+	char *sched = getenv("STARPU_SCHED");
+
 	if (starpu_get_env_number_default("STARPU_NWORKER_PER_CUDA", 1) != 1)
 		return STARPU_TEST_SKIPPED;
 
@@ -273,6 +272,11 @@ int main(void)
 	for (i = 0; i < n_policies; ++i)
 	{
 		struct starpu_sched_policy *policy = policies[i];
+
+		if (sched && strcmp(sched, policy->policy_name))
+			/* Testing another specific scheduler, no need to run this */
+			continue;
+
 		FPRINTF(stdout, "Running with policy %s.\n",
 			policy->policy_name);
 		int ret;

+ 6 - 4
tests/sched_policies/simple_deps.c

@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2012                                     Inria
  * Copyright (C) 2012,2013,2015,2017                      CNRS
- * Copyright (C) 2014-2016                                Université de Bordeaux
+ * Copyright (C) 2014-2016,2019                           Université de Bordeaux
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -93,15 +93,17 @@ int main(void)
 	struct starpu_sched_policy **policies;
 	struct starpu_sched_policy **policy;
 
-#ifdef STARPU_HAVE_UNSETENV
-	unsetenv("STARPU_SCHED");
-#endif
+	char *sched = getenv("STARPU_SCHED");
 
 	policies = starpu_sched_get_predefined_policies();
 	for(policy=policies ; *policy!=NULL ; policy++)
 	{
 		int ret;
 
+		if (sched && strcmp(sched, (*policy)->policy_name))
+			/* Testing another specific scheduler, no need to run this */
+			continue;
+
 		FPRINTF(stderr, "Running with policy %s.\n", (*policy)->policy_name);
 		ret = run(*policy);
 		if (ret == -ENODEV)