commit 967eb02c05fc3aa83bab6c5f304b9886261d26ff
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Sun Sep 8 13:46:42 2019 +0200

    Fix detecting flops computation incoherency, and make it emit a warning

diff --git a/src/core/perfmodel/perfmodel_history.c b/src/core/perfmodel/perfmodel_history.c
index ef1f5a622..dd990940a 100644
--- a/src/core/perfmodel/perfmodel_history.c
+++ b/src/core/perfmodel/perfmodel_history.c
@@ -1938,13 +1938,16 @@ void _starpu_update_perfmodel_history(struct _starpu_job *j, struct starpu_perfm
 					entry->deviation = sqrt((fabs(entry->sum2 - (entry->sum*entry->sum)/n))/n);
 				}
 
-				if (j->task->flops != 0.)
+				if (j->task->flops != 0. && !isnan(entry->flops))
 				{
 					if (entry->flops == 0.)
 						entry->flops = j->task->flops;
-					else if (((entry->flops - j->task->flops) / entry->flops) > 0.00001)
+					else if ((fabs(entry->flops - j->task->flops) / entry->flops) > 0.00001)
+					{
 						/* Incoherent flops! forget about trying to record flops */
+						_STARPU_DISP("Incoherent flops in model %s: %f vs previous %f, stopping recording flops\n", model->symbol, j->task->flops, entry->flops);
 						entry->flops = NAN;
+					}
 				}
 			}
 
