+int smpi_sample_2(int global, const char* file, int line) {
+ char* loc = sample_location(global, file, line);
+ local_data_t* data;
+
+ xbt_assert0(samples, "You did something very inconsistent, didn't you?");
+ data = xbt_dict_get_or_null(samples, loc);
+ if (!data) {
+ xbt_assert0(data, "Please, do thing in order");
+ }
+ if (!data->started) {
+ if (data->count < data->max) {
+ data->started = 1;
+ data->count++;
+ } else {
+ DEBUG1("Perform some wait of %f", data->time / (double)data->count);
+ smpi_execute(data->time / (double)data->count);
+ }
+ } else {
+ data->started = 0;
+ }
+ free(loc);
+ smpi_bench_begin(-1, NULL);
+ smpi_process_simulated_start();
+ return data->started;
+}
+
+void smpi_sample_3(int global, const char* file, int line) {
+ char* loc = sample_location(global, file, line);
+ local_data_t* data;
+
+ xbt_assert0(samples, "You did something very inconsistent, didn't you?");
+ data = xbt_dict_get_or_null(samples, loc);
+ if (!data || !data->started || data->count >= data->max) {
+ xbt_assert0(data, "Please, do thing in order");
+ }
+ smpi_bench_end(-1, NULL);
+ data->time += smpi_process_simulated_elapsed();
+ DEBUG2("Average mean after %d steps is %f", data->count, data->time / (double)data->count);