Kaynağa Gözat

make maxerror a relative percentage, thus allowing values bigger than 100

Samuel Thibault 11 yıl önce
ebeveyn
işleme
d514e5f3af
2 değiştirilmiş dosya ile 6 ekleme ve 10 silme
  1. 2 7
      configure.ac
  2. 4 3
      src/core/perfmodel/perfmodel_history.c

+ 2 - 7
configure.ac

@@ -1606,13 +1606,8 @@ 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
+AC_MSG_RESULT($calibration_heuristic)
+AC_DEFINE_UNQUOTED(STARPU_HISTORYMAXERROR, [$calibration_heuristic], [calibration heuristic value])
 
 
 ###############################################################################

+ 4 - 3
src/core/perfmodel/perfmodel_history.c

@@ -35,7 +35,6 @@
 #include <windows.h>
 #endif
 
-#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)
 
@@ -1320,9 +1319,11 @@ void _starpu_update_perfmodel_history(struct _starpu_job *j, struct starpu_perfm
 			{
 				/* There is already an entry with the same footprint */
 
-				double local_deviation = (measured/entry->mean)*100;
+				double local_deviation = measured/entry->mean;
 				
-				if (entry->nsample && (local_deviation < (100 - HISTORYMAXERROR) || local_deviation > (100 + HISTORYMAXERROR)))
+				if (entry->nsample &&
+					(100 * local_deviation > (100 + STARPU_HISTORYMAXERROR)
+					 || (100 / local_deviation > (100 + STARPU_HISTORYMAXERROR))))
 				{
 					entry->nerror++;