|
@@ -19,11 +19,6 @@
|
|
|
#include <starpu_scheduler.h>
|
|
|
#include <float.h>
|
|
|
|
|
|
-/* Alpha, Beta and Gamma are heft-specific values, which allows the
|
|
|
- * user to set more precisely the weight of each computing value.
|
|
|
- * Beta, for example, controls the weight of communications between
|
|
|
- * memories for the computation of the best node to choose.
|
|
|
- */
|
|
|
/* The two thresolds concerns the prio nodes, which contains queues
|
|
|
* who can handle the priority of StarPU tasks. You can tune your
|
|
|
* scheduling by benching those values and choose which one is the
|
|
@@ -31,62 +26,15 @@
|
|
|
* The current value of the ntasks_threshold is the best we found
|
|
|
* so far across several types of applications (cholesky, LU, stencil).
|
|
|
*/
|
|
|
-#define _STARPU_SCHED_ALPHA_DEFAULT 1.0
|
|
|
-#define _STARPU_SCHED_BETA_DEFAULT 1.0
|
|
|
-#define _STARPU_SCHED_GAMMA_DEFAULT 1000.0
|
|
|
#define _STARPU_SCHED_NTASKS_THRESHOLD_DEFAULT 30
|
|
|
#define _STARPU_SCHED_EXP_LEN_THRESHOLD_DEFAULT 1000000000.0
|
|
|
-static double alpha = _STARPU_SCHED_ALPHA_DEFAULT;
|
|
|
-static double beta = _STARPU_SCHED_BETA_DEFAULT;
|
|
|
-static double _gamma = _STARPU_SCHED_GAMMA_DEFAULT;
|
|
|
-static unsigned ntasks_threshold = _STARPU_SCHED_NTASKS_THRESHOLD_DEFAULT;
|
|
|
-static double exp_len_threshold = _STARPU_SCHED_EXP_LEN_THRESHOLD_DEFAULT;
|
|
|
-
|
|
|
-#ifdef STARPU_USE_TOP
|
|
|
-static const float alpha_minimum=0;
|
|
|
-static const float alpha_maximum=10.0;
|
|
|
-static const float beta_minimum=0;
|
|
|
-static const float beta_maximum=10.0;
|
|
|
-static const float gamma_minimum=0;
|
|
|
-static const float gamma_maximum=10000.0;
|
|
|
-static const float idle_power_minimum=0;
|
|
|
-static const float idle_power_maximum=10000.0;
|
|
|
-#endif /* !STARPU_USE_TOP */
|
|
|
-
|
|
|
-static double idle_power = 0.0;
|
|
|
-
|
|
|
-#ifdef STARPU_USE_TOP
|
|
|
-static void param_modified(struct starpu_top_param* d)
|
|
|
-{
|
|
|
-#ifdef STARPU_DEVEL
|
|
|
-#warning FIXME: get sched ctx to get alpha/beta/gamma/idle values
|
|
|
-#endif
|
|
|
- /* Just to show parameter modification. */
|
|
|
- fprintf(stderr,
|
|
|
- "%s has been modified : "
|
|
|
- "alpha=%f|beta=%f|gamma=%f|idle_power=%f !\n",
|
|
|
- d->name, alpha,beta,_gamma, idle_power);
|
|
|
-}
|
|
|
-#endif /* !STARPU_USE_TOP */
|
|
|
|
|
|
static void initialize_heft_center_policy(unsigned sched_ctx_id)
|
|
|
{
|
|
|
starpu_sched_ctx_create_worker_collection(sched_ctx_id, STARPU_WORKER_LIST);
|
|
|
- const char *strval_alpha = getenv("STARPU_SCHED_ALPHA");
|
|
|
- if (strval_alpha)
|
|
|
- alpha = atof(strval_alpha);
|
|
|
-
|
|
|
- const char *strval_beta = getenv("STARPU_SCHED_BETA");
|
|
|
- if (strval_beta)
|
|
|
- beta = atof(strval_beta);
|
|
|
-
|
|
|
- const char *strval_gamma = getenv("STARPU_SCHED_GAMMA");
|
|
|
- if (strval_gamma)
|
|
|
- _gamma = atof(strval_gamma);
|
|
|
|
|
|
- const char *strval_idle_power = getenv("STARPU_IDLE_POWER");
|
|
|
- if (strval_idle_power)
|
|
|
- idle_power = atof(strval_idle_power);
|
|
|
+ unsigned ntasks_threshold = _STARPU_SCHED_NTASKS_THRESHOLD_DEFAULT;
|
|
|
+ double exp_len_threshold = _STARPU_SCHED_EXP_LEN_THRESHOLD_DEFAULT;
|
|
|
|
|
|
const char *strval_ntasks_threshold = getenv("STARPU_NTASKS_THRESHOLD");
|
|
|
if (strval_ntasks_threshold)
|
|
@@ -96,17 +44,6 @@ static void initialize_heft_center_policy(unsigned sched_ctx_id)
|
|
|
if (strval_exp_len_threshold)
|
|
|
exp_len_threshold = atof(strval_exp_len_threshold);
|
|
|
|
|
|
-#ifdef STARPU_USE_TOP
|
|
|
- starpu_top_register_parameter_float("HEFT_ALPHA", &alpha,
|
|
|
- alpha_minimum, alpha_maximum, param_modified);
|
|
|
- starpu_top_register_parameter_float("HEFT_BETA", &beta,
|
|
|
- beta_minimum, beta_maximum, param_modified);
|
|
|
- starpu_top_register_parameter_float("HEFT_GAMMA", &_gamma,
|
|
|
- gamma_minimum, gamma_maximum, param_modified);
|
|
|
- starpu_top_register_parameter_float("HEFT_IDLE_POWER", &idle_power,
|
|
|
- idle_power_minimum, idle_power_maximum, param_modified);
|
|
|
-#endif /* !STARPU_USE_TOP */
|
|
|
-
|
|
|
|
|
|
/* The scheduling strategy look like this :
|
|
|
*
|
|
@@ -145,15 +82,7 @@ static void initialize_heft_center_policy(unsigned sched_ctx_id)
|
|
|
struct starpu_sched_node * window_node = starpu_sched_node_prio_create(NULL);
|
|
|
t->root = window_node;
|
|
|
|
|
|
- struct starpu_mct_data mct_data =
|
|
|
- {
|
|
|
- .alpha = alpha,
|
|
|
- .beta = beta,
|
|
|
- .gamma = _gamma,
|
|
|
- .idle_power = idle_power,
|
|
|
- };
|
|
|
-
|
|
|
- struct starpu_sched_node * perfmodel_node = starpu_sched_node_mct_create(&mct_data);
|
|
|
+ struct starpu_sched_node * perfmodel_node = starpu_sched_node_mct_create(NULL);
|
|
|
struct starpu_sched_node * no_perfmodel_node = starpu_sched_node_eager_create(NULL);
|
|
|
struct starpu_sched_node * calibrator_node = starpu_sched_node_eager_create(NULL);
|
|
|
|