+ double *ir = NULL;
+
+ xbt_dict_get(dict, key, (void *) &ir);
+
+ return *ir;
+}
+
+int gras_bench_always_begin(const char *location, int line)
+{
+ xbt_assert0(!benchmarking,"Already benchmarking");
+ benchmarking = 1;
+
+ timer = sys_time();
+ return 0;
+}
+
+int gras_bench_always_end(void)
+{
+ m_task_t task = NULL;
+
+ xbt_assert0(benchmarking,"Not benchmarking yet");
+ benchmarking = 0;
+ duration = sys_time()-timer;
+ task = MSG_task_create("task", (duration)/reference, 0 , NULL);
+ MSG_task_execute(task);
+ /* printf("---> %lg <--- \n", sys_time()-timer); */
+ MSG_task_destroy(task);
+ return 0;
+}
+
+int gras_bench_once_begin(const char *location, int line)
+{
+ double *ir = NULL;
+ xbt_assert0(!benchmarking,"Already benchmarking");
+ benchmarking = 1;
+
+ __location__=location;
+ xbt_dict_get(benchmark_set, __location__, (void *) &ir);
+ if(!ir) {
+/* printf("%s:%d\n",location,line); */
+ duration = sys_time();
+ return 1;
+ } else {
+ duration = -1.0;
+ return 0;
+ }
+}
+
+int gras_bench_once_end(void)
+{
+ m_task_t task = NULL;
+
+ xbt_assert0(benchmarking,"Not benchmarking yet");
+ benchmarking = 0;
+ if(duration>0) {
+ duration = sys_time()-duration;
+ store_in_dict(benchmark_set, __location__, duration);
+ } else {
+ duration = get_from_dict(benchmark_set,__location__);
+ }
+ task = MSG_task_create("task", (duration)/reference, 0 , NULL);
+ MSG_task_execute(task);
+ MSG_task_destroy(task);
+ return 0;