- data->started = 0;
- xbt_dict_set(samples, loc, data, &free);
- return 0;
+ data->benching = 1; // If we have no data, we need at least one
+ data->mean = 0;
+ xbt_dict_set(samples, loc, data, NULL);
+ XBT_DEBUG("XXXXX First time ever on benched nest %s.",loc);
+ } else {
+ if (data->iters != iters || data->threshold != threshold) {
+ XBT_ERROR("Asked to bench block %s with different settings %d, %f is not %d, %f. How did you manage to give two numbers at the same line??",
+ loc, data->iters, data->threshold, iters,threshold);
+ THROW_IMPOSSIBLE;
+ }
+
+ // if we already have some data, check whether sample_2 should get one more bench or whether it should emulate the computation instead
+ data->benching = !sample_enough_benchs(data);
+ XBT_DEBUG("XXXX Re-entering the benched nest %s. %s",loc, (data->benching?"more benching needed":"we have enough data, skip computes"));