+ smpi_bench_end();
+ double resolution = (1/sg_maxmin_precision);
+ smpi_bench_begin();
+ return (unsigned long long)resolution;
+}
+
+unsigned long long smpi_rastro_timestamp (void)
+{
+ smpi_bench_end();
+ double now = SIMIX_get_clock();
+
+ unsigned long long sec = (unsigned long long)now;
+ unsigned long long pre = (now - sec) * smpi_rastro_resolution();
+ smpi_bench_begin();
+ return (unsigned long long)sec * smpi_rastro_resolution() + pre;
+}
+
+/* ****************************** Functions related to the SMPI_SAMPLE_ macros ************************************/
+typedef struct {
+ int iters; /* amount of requested iterations */
+ int count; /* amount of iterations done so far */
+ double threshold; /* maximal stderr requested (if positive) */
+ double relstderr; /* observed stderr so far */
+ double mean; /* mean of benched times, to be used if the block is disabled */
+ double sum; /* sum of benched times (to compute the mean and stderr) */
+ double sum_pow2; /* sum of the square of the benched times (to compute the stderr) */
+ int benching; /* 1: we are benchmarking; 0: we have enough data, no bench anymore */
+} local_data_t;
+
+static char *sample_location(int global, const char *file, int line) {