Forráskód Böngészése

Adding configure option --enable-calibration-heuristic and associated ChangeLog and documentation informations

Marc Sergent 11 éve
szülő
commit
6d61fcd64d

+ 3 - 0
ChangeLog

@@ -75,6 +75,9 @@ Small features:
   * Functions starpu_insert_task and starpu_mpi_insert_task are
     renamed in starpu_task_insert and starpu_mpi_task_insert. Old
     names are kept to avoid breaking old codes.
+  * New configure option --enable-calibration-heuristic which allows
+    the user to set the maximum authorized deviation of the 
+    history-based calibrator. 
 
 Changes:
   * Fix of the livelock issue discovered while executing applications

+ 13 - 0
configure.ac

@@ -1601,6 +1601,19 @@ STARPU_HAVE_LIBRARY(LEVELDB, [leveldb])
 AM_CONDITIONAL(STARPU_HAVE_LEVELDB, test "x$ac_cv_lib_leveldb_main" = "xyes")
 AC_LANG_POP([C++])
 
+# Defines the calibration heuristic for the history-based calibration of StarPU
+AC_MSG_CHECKING(calibration heuristic of history-based StarPU calibrator)
+AC_ARG_ENABLE(calibration-heuristic, [AS_HELP_STRING([--enable-calibration-heuristic=<number>],
+			[Define the maximum authorized deviation of StarPU history-based calibrator.])],
+			calibration_heuristic=$enableval, calibration_heuristic=10)
+if test $calibration_heuristic -gt 100; then
+	AC_MSG_RESULT(uncorrect parameter $calibration_heuristic  set default parameter 10)
+	AC_DEFINE_UNQUOTED(STARPU_HISTORYMAXERROR, [$calibration_heuristic], [calibration heuristic value])
+else
+	AC_MSG_RESULT($calibration_heuristic)
+	AC_DEFINE_UNQUOTED(STARPU_HISTORYMAXERROR, [$calibration_heuristic], [calibration heuristic value])
+fi
+
 
 ###############################################################################
 #                                                                             #

+ 10 - 0
doc/doxygen/chapters/configure_options.doxy

@@ -526,6 +526,16 @@ export SIMGRID_LIBS="-L/usr/local/simgrid/lib -lsimgrid"
 
 </dd>
 
+<dt>--enable-calibration-heuristic</dt>
+<dd>
+\anchor enable-calibration-heuristic
+\addindex __configure__--enable-calibration-heuristic
+Allows to set the maximum authorized percentage of deviation 
+for the history-based calibrator of StarPU. A correct value 
+of this parameter must be in [0..100]. The default value of 
+this parameter is 10. Experimental.
+</dd>
+
 </dl>
 
 */

+ 6 - 6
src/core/perfmodel/perfmodel_history.c

@@ -35,8 +35,7 @@
 #include <windows.h>
 #endif
 
-/* TODO: Replace the define by a configure parameter ?*/
-#define HISTORYMAXERROR 0.1
+#define HISTORYMAXERROR	(STARPU_HISTORYMAXERROR > 100 ? 10 : STARPU_HISTORYMAXERROR)
 #define HASH_ADD_UINT32_T(head,field,add) HASH_ADD(hh,head,field,sizeof(uint32_t),add)
 #define HASH_FIND_UINT32_T(head,find,out) HASH_FIND(hh,head,find,sizeof(uint32_t),out)
 
@@ -1319,14 +1318,15 @@ void _starpu_update_perfmodel_history(struct _starpu_job *j, struct starpu_perfm
 			}
 			else
 			{
-				/* there is already some entry with the same footprint */
+				/* There is already an entry with the same footprint */
 				
-				// if (entry->nsample && (measured/entry->mean > HISTORYMAXERROR || entry->mean/measured > HISTORYMAXERROR))
-				if (entry->nsample && (measured/entry->mean < (1 - HISTORYMAXERROR) || measured/entry->mean > (1 + HISTORYMAXERROR)))
+				double local_deviation = (measured/entry->mean)*100;
+			
+				if (entry->nsample && (local_deviation < (100 - HISTORYMAXERROR) || local_deviation > (100 + HISTORYMAXERROR)))
 				{
 					entry->nerror++;
 
-					/* Too much errors: we flush out all the entries */
+					/* Too many errors: we flush out all the entries */
 					if (entry->nerror >= entry->nsample)
 					{
 						entry->sum = 0.0;