소스 검색

In case the calibrate field of the starpu_conf structure that is passed to
starpu_init is -1, we use the default value (eg. 0 or the value of
STARPU_CALIBRATE environment variable if it is set).

Cédric Augonnet 15 년 전
부모
커밋
cda1b0d229
3개의 변경된 파일6개의 추가작업 그리고 5개의 파일을 삭제
  1. 3 2
      doc/starpu.texi
  2. 2 2
      include/starpu.h
  3. 1 1
      src/core/policies/sched_policy.c

+ 3 - 2
doc/starpu.texi

@@ -964,8 +964,9 @@ OpenCL devices in a round-robin fashion.
 
 @item @code{calibrate} (default = 0):
 If this flag is set, StarPU will calibrate the performance models when
-executing tasks. This can also be specified with the @code{STARPU_CALIBRATE}
-environment variable.
+executing tasks. If this value is equal to -1, the default value is used. The
+default value is overwritten by the @code{STARPU_CALIBRATE} environment
+variable when it is set.
 @end table
 
 @end table

+ 2 - 2
include/starpu.h

@@ -60,8 +60,8 @@ struct starpu_conf {
 	unsigned use_explicit_workers_opencl_gpuid;
 	unsigned workers_opencl_gpuid[STARPU_NMAXWORKERS];
 
-	/* calibrate performance models, if any */
-	unsigned calibrate;
+	/* calibrate performance models, if any (-1 for default) */
+	int calibrate;
 };
 
 /* Initialization method: it must be called prior to any other StarPU call

+ 1 - 1
src/core/policies/sched_policy.c

@@ -172,7 +172,7 @@ void _starpu_init_sched_policy(struct starpu_machine_config_s *config)
 
 	/* By default, we don't calibrate */
 	unsigned do_calibrate = 0;
-	if (config->user_conf)
+	if (config->user_conf && (config->user_conf->calibrate != -1))
 	{
 		do_calibrate = config->user_conf->calibrate;
 	}