Browse Source

The STARPU_SCHED_ALPHA and STARPU_SCHED_BETA environnement variables allow the
user to set the parameters of the "dmda" policy at runtime.

Cédric Augonnet 15 years ago
parent
commit
1eccacdf5f
1 changed files with 12 additions and 4 deletions
  1. 12 4
      src/core/policies/deque-modeling-policy-data-aware.c

+ 12 - 4
src/core/policies/deque-modeling-policy-data-aware.c

@@ -1,6 +1,6 @@
 /*
  * StarPU
- * Copyright (C) INRIA 2008-2009 (see AUTHORS file)
+ * Copyright (C) INRIA 2008-2010 (see AUTHORS file)
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -21,6 +21,9 @@ static unsigned nworkers;
 static struct jobq_s *queue_array[STARPU_NMAXWORKERS];
 static int use_prefetch = 0;
 
+static double alpha = 1.0;
+static double beta = 1.0;
+
 static job_t dmda_pop_task(struct jobq_s *q)
 {
 	struct job_s *j;
@@ -109,9 +112,6 @@ static int _dmda_push_task(struct jobq_s *q __attribute__ ((unused)) , job_t j,
 		}
 	}
 
-	double alpha = 1.0;
-	double beta = 1.0;
-
 	double best_fitness = -1;
 	
 	if (forced_best == -1)
@@ -216,6 +216,14 @@ static void initialize_dmda_policy(struct machine_config_s *config,
 	if (use_prefetch == -1)
 		use_prefetch = 0;
 
+	const char *strval_alpha = getenv("STARPU_SCHED_ALPHA");
+	if (strval_alpha)
+		beta = atof(strval_alpha);
+
+	const char *strval_beta = getenv("STARPU_SCHED_BETA");
+	if (strval_beta)
+		beta = atof(strval_beta);
+
 	setup_queues(init_fifo_queues_mechanisms, init_dmda_fifo, config);
 }