Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[simix] simcall to run code in kernel mode
[simgrid.git] / src / simix / popping_bodies.cpp
1 /**********************************************************************/
2 /* File generated by src/simix/simcalls.py from src/simix/simcalls.in */
3 /*                                                                    */
4 /*                    DO NOT EVER CHANGE THIS FILE                    */
5 /*                                                                    */
6 /* change simcalls specification in src/simix/simcalls.in             */
7 /**********************************************************************/
8
9 /*
10  * Note that the name comes from http://en.wikipedia.org/wiki/Popping
11  * Indeed, the control flow is doing a strange dance in there.
12  *
13  * That's not about http://en.wikipedia.org/wiki/Poop, despite the odor :)
14  */
15
16 #include "smx_private.h"
17 #include "src/mc/mc_forward.h"
18 #include "xbt/ex.h"
19 #include <simgrid/simix.hpp>
20   
21 inline static void simcall_BODY_host_on(sg_host_t host) {
22     smx_process_t self = SIMIX_process_self();
23
24     /* Go to that function to follow the code flow through the simcall barrier */
25     if (0) SIMIX_host_on(host);
26     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
27
28     self->simcall.call = SIMCALL_HOST_ON;
29     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
30     memset(self->simcall.args, 0, sizeof(self->simcall.args));
31     self->simcall.args[0].dp = (void*) host;
32     if (self != simix_global->maestro_process) {
33       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
34                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
35       SIMIX_process_yield(self);
36     } else {
37       SIMIX_simcall_handle(&self->simcall, 0);
38     }    
39     
40   }
41   
42 inline static void simcall_BODY_host_off(sg_host_t host) {
43     smx_process_t self = SIMIX_process_self();
44
45     /* Go to that function to follow the code flow through the simcall barrier */
46     if (0) simcall_HANDLER_host_off(&self->simcall, host);
47     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
48
49     self->simcall.call = SIMCALL_HOST_OFF;
50     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
51     memset(self->simcall.args, 0, sizeof(self->simcall.args));
52     self->simcall.args[0].dp = (void*) host;
53     if (self != simix_global->maestro_process) {
54       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
55                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
56       SIMIX_process_yield(self);
57     } else {
58       SIMIX_simcall_handle(&self->simcall, 0);
59     }    
60     
61   }
62   
63 inline static xbt_dict_t simcall_BODY_host_get_properties(sg_host_t host) {
64     smx_process_t self = SIMIX_process_self();
65
66     /* Go to that function to follow the code flow through the simcall barrier */
67     if (0) SIMIX_host_get_properties(host);
68     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
69
70     self->simcall.call = SIMCALL_HOST_GET_PROPERTIES;
71     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
72     memset(self->simcall.args, 0, sizeof(self->simcall.args));
73     self->simcall.args[0].dp = (void*) host;
74     if (self != simix_global->maestro_process) {
75       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
76                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
77       SIMIX_process_yield(self);
78     } else {
79       SIMIX_simcall_handle(&self->simcall, 0);
80     }    
81     return (xbt_dict_t) self->simcall.result.dp;
82   }
83   
84 inline static xbt_swag_t simcall_BODY_host_get_process_list(sg_host_t host) {
85     smx_process_t self = SIMIX_process_self();
86
87     /* Go to that function to follow the code flow through the simcall barrier */
88     if (0) SIMIX_host_get_process_list(host);
89     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
90
91     self->simcall.call = SIMCALL_HOST_GET_PROCESS_LIST;
92     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
93     memset(self->simcall.args, 0, sizeof(self->simcall.args));
94     self->simcall.args[0].dp = (void*) host;
95     if (self != simix_global->maestro_process) {
96       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
97                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
98       SIMIX_process_yield(self);
99     } else {
100       SIMIX_simcall_handle(&self->simcall, 0);
101     }    
102     return (xbt_swag_t) self->simcall.result.dp;
103   }
104   
105 inline static double simcall_BODY_host_get_current_power_peak(sg_host_t host) {
106     smx_process_t self = SIMIX_process_self();
107
108     /* Go to that function to follow the code flow through the simcall barrier */
109     if (0) SIMIX_host_get_current_power_peak(host);
110     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
111
112     self->simcall.call = SIMCALL_HOST_GET_CURRENT_POWER_PEAK;
113     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
114     memset(self->simcall.args, 0, sizeof(self->simcall.args));
115     self->simcall.args[0].dp = (void*) host;
116     if (self != simix_global->maestro_process) {
117       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
118                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
119       SIMIX_process_yield(self);
120     } else {
121       SIMIX_simcall_handle(&self->simcall, 0);
122     }    
123     return (double) self->simcall.result.d;
124   }
125   
126 inline static double simcall_BODY_host_get_power_peak_at(sg_host_t host, int pstate_index) {
127     smx_process_t self = SIMIX_process_self();
128
129     /* Go to that function to follow the code flow through the simcall barrier */
130     if (0) SIMIX_host_get_power_peak_at(host, pstate_index);
131     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
132
133     self->simcall.call = SIMCALL_HOST_GET_POWER_PEAK_AT;
134     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
135     memset(self->simcall.args, 0, sizeof(self->simcall.args));
136     self->simcall.args[0].dp = (void*) host;
137     self->simcall.args[1].i = (int) pstate_index;
138     if (self != simix_global->maestro_process) {
139       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
140                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
141       SIMIX_process_yield(self);
142     } else {
143       SIMIX_simcall_handle(&self->simcall, 0);
144     }    
145     return (double) self->simcall.result.d;
146   }
147   
148 inline static double simcall_BODY_host_get_wattmin_at(sg_host_t host, int pstate_index) {
149     smx_process_t self = SIMIX_process_self();
150
151     /* Go to that function to follow the code flow through the simcall barrier */
152     if (0) SIMIX_host_get_wattmin_at(host, pstate_index);
153     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
154
155     self->simcall.call = SIMCALL_HOST_GET_WATTMIN_AT;
156     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
157     memset(self->simcall.args, 0, sizeof(self->simcall.args));
158     self->simcall.args[0].dp = (void*) host;
159     self->simcall.args[1].i = (int) pstate_index;
160     if (self != simix_global->maestro_process) {
161       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
162                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
163       SIMIX_process_yield(self);
164     } else {
165       SIMIX_simcall_handle(&self->simcall, 0);
166     }    
167     return (double) self->simcall.result.d;
168   }
169   
170 inline static double simcall_BODY_host_get_wattmax_at(sg_host_t host, int pstate_index) {
171     smx_process_t self = SIMIX_process_self();
172
173     /* Go to that function to follow the code flow through the simcall barrier */
174     if (0) SIMIX_host_get_wattmax_at(host, pstate_index);
175     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
176
177     self->simcall.call = SIMCALL_HOST_GET_WATTMAX_AT;
178     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
179     memset(self->simcall.args, 0, sizeof(self->simcall.args));
180     self->simcall.args[0].dp = (void*) host;
181     self->simcall.args[1].i = (int) pstate_index;
182     if (self != simix_global->maestro_process) {
183       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
184                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
185       SIMIX_process_yield(self);
186     } else {
187       SIMIX_simcall_handle(&self->simcall, 0);
188     }    
189     return (double) self->simcall.result.d;
190   }
191   
192 inline static void simcall_BODY_host_set_pstate(sg_host_t host, int pstate_index) {
193     smx_process_t self = SIMIX_process_self();
194
195     /* Go to that function to follow the code flow through the simcall barrier */
196     if (0) SIMIX_host_set_pstate(host, pstate_index);
197     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
198
199     self->simcall.call = SIMCALL_HOST_SET_PSTATE;
200     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
201     memset(self->simcall.args, 0, sizeof(self->simcall.args));
202     self->simcall.args[0].dp = (void*) host;
203     self->simcall.args[1].i = (int) pstate_index;
204     if (self != simix_global->maestro_process) {
205       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
206                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
207       SIMIX_process_yield(self);
208     } else {
209       SIMIX_simcall_handle(&self->simcall, 0);
210     }    
211     
212   }
213   
214 inline static xbt_dict_t simcall_BODY_host_get_mounted_storage_list(sg_host_t host) {
215     smx_process_t self = SIMIX_process_self();
216
217     /* Go to that function to follow the code flow through the simcall barrier */
218     if (0) SIMIX_host_get_mounted_storage_list(host);
219     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
220
221     self->simcall.call = SIMCALL_HOST_GET_MOUNTED_STORAGE_LIST;
222     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
223     memset(self->simcall.args, 0, sizeof(self->simcall.args));
224     self->simcall.args[0].dp = (void*) host;
225     if (self != simix_global->maestro_process) {
226       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
227                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
228       SIMIX_process_yield(self);
229     } else {
230       SIMIX_simcall_handle(&self->simcall, 0);
231     }    
232     return (xbt_dict_t) self->simcall.result.dp;
233   }
234   
235 inline static xbt_dynar_t simcall_BODY_host_get_attached_storage_list(sg_host_t host) {
236     smx_process_t self = SIMIX_process_self();
237
238     /* Go to that function to follow the code flow through the simcall barrier */
239     if (0) SIMIX_host_get_attached_storage_list(host);
240     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
241
242     self->simcall.call = SIMCALL_HOST_GET_ATTACHED_STORAGE_LIST;
243     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
244     memset(self->simcall.args, 0, sizeof(self->simcall.args));
245     self->simcall.args[0].dp = (void*) host;
246     if (self != simix_global->maestro_process) {
247       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
248                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
249       SIMIX_process_yield(self);
250     } else {
251       SIMIX_simcall_handle(&self->simcall, 0);
252     }    
253     return (xbt_dynar_t) self->simcall.result.dp;
254   }
255   
256 inline static void simcall_BODY_host_get_params(sg_host_t ind_vm, vm_params_t params) {
257     smx_process_t self = SIMIX_process_self();
258
259     /* Go to that function to follow the code flow through the simcall barrier */
260     if (0) SIMIX_host_get_params(ind_vm, params);
261     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
262
263     self->simcall.call = SIMCALL_HOST_GET_PARAMS;
264     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
265     memset(self->simcall.args, 0, sizeof(self->simcall.args));
266     self->simcall.args[0].dp = (void*) ind_vm;
267     self->simcall.args[1].dp = (void*) params;
268     if (self != simix_global->maestro_process) {
269       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
270                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
271       SIMIX_process_yield(self);
272     } else {
273       SIMIX_simcall_handle(&self->simcall, 0);
274     }    
275     
276   }
277   
278 inline static void simcall_BODY_host_set_params(sg_host_t ind_vm, vm_params_t params) {
279     smx_process_t self = SIMIX_process_self();
280
281     /* Go to that function to follow the code flow through the simcall barrier */
282     if (0) SIMIX_host_set_params(ind_vm, params);
283     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
284
285     self->simcall.call = SIMCALL_HOST_SET_PARAMS;
286     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
287     memset(self->simcall.args, 0, sizeof(self->simcall.args));
288     self->simcall.args[0].dp = (void*) ind_vm;
289     self->simcall.args[1].dp = (void*) params;
290     if (self != simix_global->maestro_process) {
291       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
292                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
293       SIMIX_process_yield(self);
294     } else {
295       SIMIX_simcall_handle(&self->simcall, 0);
296     }    
297     
298   }
299   
300 inline static sg_host_t simcall_BODY_vm_create(const char* name, sg_host_t ind_pm) {
301     smx_process_t self = SIMIX_process_self();
302
303     /* Go to that function to follow the code flow through the simcall barrier */
304     if (0) SIMIX_vm_create(name, ind_pm);
305     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
306
307     self->simcall.call = SIMCALL_VM_CREATE;
308     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
309     memset(self->simcall.args, 0, sizeof(self->simcall.args));
310     self->simcall.args[0].cc = (const char*) name;
311     self->simcall.args[1].dp = (void*) ind_pm;
312     if (self != simix_global->maestro_process) {
313       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
314                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
315       SIMIX_process_yield(self);
316     } else {
317       SIMIX_simcall_handle(&self->simcall, 0);
318     }    
319     return (sg_host_t) self->simcall.result.dp;
320   }
321   
322 inline static void simcall_BODY_vm_start(sg_host_t ind_vm) {
323     smx_process_t self = SIMIX_process_self();
324
325     /* Go to that function to follow the code flow through the simcall barrier */
326     if (0) SIMIX_vm_start(ind_vm);
327     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
328
329     self->simcall.call = SIMCALL_VM_START;
330     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
331     memset(self->simcall.args, 0, sizeof(self->simcall.args));
332     self->simcall.args[0].dp = (void*) ind_vm;
333     if (self != simix_global->maestro_process) {
334       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
335                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
336       SIMIX_process_yield(self);
337     } else {
338       SIMIX_simcall_handle(&self->simcall, 0);
339     }    
340     
341   }
342   
343 inline static int simcall_BODY_vm_get_state(sg_host_t ind_vm) {
344     smx_process_t self = SIMIX_process_self();
345
346     /* Go to that function to follow the code flow through the simcall barrier */
347     if (0) SIMIX_vm_get_state(ind_vm);
348     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
349
350     self->simcall.call = SIMCALL_VM_GET_STATE;
351     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
352     memset(self->simcall.args, 0, sizeof(self->simcall.args));
353     self->simcall.args[0].dp = (void*) ind_vm;
354     if (self != simix_global->maestro_process) {
355       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
356                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
357       SIMIX_process_yield(self);
358     } else {
359       SIMIX_simcall_handle(&self->simcall, 0);
360     }    
361     return (int) self->simcall.result.i;
362   }
363   
364 inline static void simcall_BODY_vm_migrate(sg_host_t ind_vm, sg_host_t ind_dst_pm) {
365     smx_process_t self = SIMIX_process_self();
366
367     /* Go to that function to follow the code flow through the simcall barrier */
368     if (0) SIMIX_vm_migrate(ind_vm, ind_dst_pm);
369     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
370
371     self->simcall.call = SIMCALL_VM_MIGRATE;
372     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
373     memset(self->simcall.args, 0, sizeof(self->simcall.args));
374     self->simcall.args[0].dp = (void*) ind_vm;
375     self->simcall.args[1].dp = (void*) ind_dst_pm;
376     if (self != simix_global->maestro_process) {
377       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
378                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
379       SIMIX_process_yield(self);
380     } else {
381       SIMIX_simcall_handle(&self->simcall, 0);
382     }    
383     
384   }
385   
386 inline static void* simcall_BODY_vm_get_pm(sg_host_t ind_vm) {
387     smx_process_t self = SIMIX_process_self();
388
389     /* Go to that function to follow the code flow through the simcall barrier */
390     if (0) SIMIX_vm_get_pm(ind_vm);
391     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
392
393     self->simcall.call = SIMCALL_VM_GET_PM;
394     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
395     memset(self->simcall.args, 0, sizeof(self->simcall.args));
396     self->simcall.args[0].dp = (void*) ind_vm;
397     if (self != simix_global->maestro_process) {
398       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
399                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
400       SIMIX_process_yield(self);
401     } else {
402       SIMIX_simcall_handle(&self->simcall, 0);
403     }    
404     return (void*) self->simcall.result.dp;
405   }
406   
407 inline static void simcall_BODY_vm_set_bound(sg_host_t ind_vm, double bound) {
408     smx_process_t self = SIMIX_process_self();
409
410     /* Go to that function to follow the code flow through the simcall barrier */
411     if (0) SIMIX_vm_set_bound(ind_vm, bound);
412     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
413
414     self->simcall.call = SIMCALL_VM_SET_BOUND;
415     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
416     memset(self->simcall.args, 0, sizeof(self->simcall.args));
417     self->simcall.args[0].dp = (void*) ind_vm;
418     self->simcall.args[1].d = (double) bound;
419     if (self != simix_global->maestro_process) {
420       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
421                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
422       SIMIX_process_yield(self);
423     } else {
424       SIMIX_simcall_handle(&self->simcall, 0);
425     }    
426     
427   }
428   
429 inline static void simcall_BODY_vm_set_affinity(sg_host_t ind_vm, sg_host_t ind_pm, unsigned long mask) {
430     smx_process_t self = SIMIX_process_self();
431
432     /* Go to that function to follow the code flow through the simcall barrier */
433     if (0) SIMIX_vm_set_affinity(ind_vm, ind_pm, mask);
434     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
435
436     self->simcall.call = SIMCALL_VM_SET_AFFINITY;
437     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
438     memset(self->simcall.args, 0, sizeof(self->simcall.args));
439     self->simcall.args[0].dp = (void*) ind_vm;
440     self->simcall.args[1].dp = (void*) ind_pm;
441     self->simcall.args[2].ul = (unsigned long) mask;
442     if (self != simix_global->maestro_process) {
443       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
444                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
445       SIMIX_process_yield(self);
446     } else {
447       SIMIX_simcall_handle(&self->simcall, 0);
448     }    
449     
450   }
451   
452 inline static void simcall_BODY_vm_destroy(sg_host_t ind_vm) {
453     smx_process_t self = SIMIX_process_self();
454
455     /* Go to that function to follow the code flow through the simcall barrier */
456     if (0) SIMIX_vm_destroy(ind_vm);
457     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
458
459     self->simcall.call = SIMCALL_VM_DESTROY;
460     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
461     memset(self->simcall.args, 0, sizeof(self->simcall.args));
462     self->simcall.args[0].dp = (void*) ind_vm;
463     if (self != simix_global->maestro_process) {
464       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
465                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
466       SIMIX_process_yield(self);
467     } else {
468       SIMIX_simcall_handle(&self->simcall, 0);
469     }    
470     
471   }
472   
473 inline static void simcall_BODY_vm_suspend(sg_host_t ind_vm) {
474     smx_process_t self = SIMIX_process_self();
475
476     /* Go to that function to follow the code flow through the simcall barrier */
477     if (0) simcall_HANDLER_vm_suspend(&self->simcall, ind_vm);
478     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
479
480     self->simcall.call = SIMCALL_VM_SUSPEND;
481     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
482     memset(self->simcall.args, 0, sizeof(self->simcall.args));
483     self->simcall.args[0].dp = (void*) ind_vm;
484     if (self != simix_global->maestro_process) {
485       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
486                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
487       SIMIX_process_yield(self);
488     } else {
489       SIMIX_simcall_handle(&self->simcall, 0);
490     }    
491     
492   }
493   
494 inline static void simcall_BODY_vm_resume(sg_host_t ind_vm) {
495     smx_process_t self = SIMIX_process_self();
496
497     /* Go to that function to follow the code flow through the simcall barrier */
498     if (0) simcall_HANDLER_vm_resume(&self->simcall, ind_vm);
499     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
500
501     self->simcall.call = SIMCALL_VM_RESUME;
502     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
503     memset(self->simcall.args, 0, sizeof(self->simcall.args));
504     self->simcall.args[0].dp = (void*) ind_vm;
505     if (self != simix_global->maestro_process) {
506       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
507                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
508       SIMIX_process_yield(self);
509     } else {
510       SIMIX_simcall_handle(&self->simcall, 0);
511     }    
512     
513   }
514   
515 inline static void simcall_BODY_vm_shutdown(sg_host_t ind_vm) {
516     smx_process_t self = SIMIX_process_self();
517
518     /* Go to that function to follow the code flow through the simcall barrier */
519     if (0) simcall_HANDLER_vm_shutdown(&self->simcall, ind_vm);
520     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
521
522     self->simcall.call = SIMCALL_VM_SHUTDOWN;
523     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
524     memset(self->simcall.args, 0, sizeof(self->simcall.args));
525     self->simcall.args[0].dp = (void*) ind_vm;
526     if (self != simix_global->maestro_process) {
527       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
528                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
529       SIMIX_process_yield(self);
530     } else {
531       SIMIX_simcall_handle(&self->simcall, 0);
532     }    
533     
534   }
535   
536 inline static void simcall_BODY_vm_save(sg_host_t ind_vm) {
537     smx_process_t self = SIMIX_process_self();
538
539     /* Go to that function to follow the code flow through the simcall barrier */
540     if (0) simcall_HANDLER_vm_save(&self->simcall, ind_vm);
541     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
542
543     self->simcall.call = SIMCALL_VM_SAVE;
544     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
545     memset(self->simcall.args, 0, sizeof(self->simcall.args));
546     self->simcall.args[0].dp = (void*) ind_vm;
547     if (self != simix_global->maestro_process) {
548       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
549                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
550       SIMIX_process_yield(self);
551     } else {
552       SIMIX_simcall_handle(&self->simcall, 0);
553     }    
554     
555   }
556   
557 inline static void simcall_BODY_vm_restore(sg_host_t ind_vm) {
558     smx_process_t self = SIMIX_process_self();
559
560     /* Go to that function to follow the code flow through the simcall barrier */
561     if (0) simcall_HANDLER_vm_restore(&self->simcall, ind_vm);
562     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
563
564     self->simcall.call = SIMCALL_VM_RESTORE;
565     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
566     memset(self->simcall.args, 0, sizeof(self->simcall.args));
567     self->simcall.args[0].dp = (void*) ind_vm;
568     if (self != simix_global->maestro_process) {
569       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
570                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
571       SIMIX_process_yield(self);
572     } else {
573       SIMIX_simcall_handle(&self->simcall, 0);
574     }    
575     
576   }
577   
578 inline static void simcall_BODY_vm_migratefrom_resumeto(sg_host_t vm, sg_host_t src_pm, sg_host_t dst_pm) {
579     smx_process_t self = SIMIX_process_self();
580
581     /* Go to that function to follow the code flow through the simcall barrier */
582     if (0) SIMIX_vm_migratefrom_resumeto(vm, src_pm, dst_pm);
583     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
584
585     self->simcall.call = SIMCALL_VM_MIGRATEFROM_RESUMETO;
586     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
587     memset(self->simcall.args, 0, sizeof(self->simcall.args));
588     self->simcall.args[0].dp = (void*) vm;
589     self->simcall.args[1].dp = (void*) src_pm;
590     self->simcall.args[2].dp = (void*) dst_pm;
591     if (self != simix_global->maestro_process) {
592       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
593                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
594       SIMIX_process_yield(self);
595     } else {
596       SIMIX_simcall_handle(&self->simcall, 0);
597     }    
598     
599   }
600   
601 inline static void* simcall_BODY_process_create(const char* name, xbt_main_func_t code, void* data, const char* hostname, double kill_time, int argc, char** argv, xbt_dict_t properties, int auto_restart) {
602     smx_process_t self = SIMIX_process_self();
603
604     /* Go to that function to follow the code flow through the simcall barrier */
605     if (0) simcall_HANDLER_process_create(&self->simcall, name, code, data, hostname, kill_time, argc, argv, properties, auto_restart);
606     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
607
608     self->simcall.call = SIMCALL_PROCESS_CREATE;
609     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
610     memset(self->simcall.args, 0, sizeof(self->simcall.args));
611     self->simcall.args[0].cc = (const char*) name;
612     self->simcall.args[1].fp = (FPtr) code;
613     self->simcall.args[2].dp = (void*) data;
614     self->simcall.args[3].cc = (const char*) hostname;
615     self->simcall.args[4].d = (double) kill_time;
616     self->simcall.args[5].i = (int) argc;
617     self->simcall.args[6].dp = (void*) argv;
618     self->simcall.args[7].dp = (void*) properties;
619     self->simcall.args[8].i = (int) auto_restart;
620     if (self != simix_global->maestro_process) {
621       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
622                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
623       SIMIX_process_yield(self);
624     } else {
625       SIMIX_simcall_handle(&self->simcall, 0);
626     }    
627     return (void*) self->simcall.result.dp;
628   }
629   
630 inline static void simcall_BODY_process_kill(smx_process_t process) {
631     smx_process_t self = SIMIX_process_self();
632
633     /* Go to that function to follow the code flow through the simcall barrier */
634     if (0) simcall_HANDLER_process_kill(&self->simcall, process);
635     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
636
637     self->simcall.call = SIMCALL_PROCESS_KILL;
638     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
639     memset(self->simcall.args, 0, sizeof(self->simcall.args));
640     self->simcall.args[0].dp = (void*) process;
641     if (self != simix_global->maestro_process) {
642       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
643                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
644       SIMIX_process_yield(self);
645     } else {
646       SIMIX_simcall_handle(&self->simcall, 0);
647     }    
648     
649   }
650   
651 inline static void simcall_BODY_process_killall(int reset_pid) {
652     smx_process_t self = SIMIX_process_self();
653
654     /* Go to that function to follow the code flow through the simcall barrier */
655     if (0) simcall_HANDLER_process_killall(&self->simcall, reset_pid);
656     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
657
658     self->simcall.call = SIMCALL_PROCESS_KILLALL;
659     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
660     memset(self->simcall.args, 0, sizeof(self->simcall.args));
661     self->simcall.args[0].i = (int) reset_pid;
662     if (self != simix_global->maestro_process) {
663       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
664                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
665       SIMIX_process_yield(self);
666     } else {
667       SIMIX_simcall_handle(&self->simcall, 0);
668     }    
669     
670   }
671   
672 inline static void simcall_BODY_process_cleanup(smx_process_t process) {
673     smx_process_t self = SIMIX_process_self();
674
675     /* Go to that function to follow the code flow through the simcall barrier */
676     if (0) SIMIX_process_cleanup(process);
677     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
678
679     self->simcall.call = SIMCALL_PROCESS_CLEANUP;
680     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
681     memset(self->simcall.args, 0, sizeof(self->simcall.args));
682     self->simcall.args[0].dp = (void*) process;
683     if (self != simix_global->maestro_process) {
684       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
685                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
686       SIMIX_process_yield(self);
687     } else {
688       SIMIX_simcall_handle(&self->simcall, 0);
689     }    
690     
691   }
692   
693 inline static void simcall_BODY_process_suspend(smx_process_t process) {
694     smx_process_t self = SIMIX_process_self();
695
696     /* Go to that function to follow the code flow through the simcall barrier */
697     if (0) simcall_HANDLER_process_suspend(&self->simcall, process);
698     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
699
700     self->simcall.call = SIMCALL_PROCESS_SUSPEND;
701     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
702     memset(self->simcall.args, 0, sizeof(self->simcall.args));
703     self->simcall.args[0].dp = (void*) process;
704     if (self != simix_global->maestro_process) {
705       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
706                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
707       SIMIX_process_yield(self);
708     } else {
709       SIMIX_simcall_handle(&self->simcall, 0);
710     }    
711     
712   }
713   
714 inline static void simcall_BODY_process_resume(smx_process_t process) {
715     smx_process_t self = SIMIX_process_self();
716
717     /* Go to that function to follow the code flow through the simcall barrier */
718     if (0) simcall_HANDLER_process_resume(&self->simcall, process);
719     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
720
721     self->simcall.call = SIMCALL_PROCESS_RESUME;
722     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
723     memset(self->simcall.args, 0, sizeof(self->simcall.args));
724     self->simcall.args[0].dp = (void*) process;
725     if (self != simix_global->maestro_process) {
726       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
727                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
728       SIMIX_process_yield(self);
729     } else {
730       SIMIX_simcall_handle(&self->simcall, 0);
731     }    
732     
733   }
734   
735 inline static int simcall_BODY_process_count() {
736     smx_process_t self = SIMIX_process_self();
737
738     /* Go to that function to follow the code flow through the simcall barrier */
739     if (0) SIMIX_process_count();
740     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
741
742     self->simcall.call = SIMCALL_PROCESS_COUNT;
743     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
744     memset(self->simcall.args, 0, sizeof(self->simcall.args));
745
746     if (self != simix_global->maestro_process) {
747       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
748                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
749       SIMIX_process_yield(self);
750     } else {
751       SIMIX_simcall_handle(&self->simcall, 0);
752     }    
753     return (int) self->simcall.result.i;
754   }
755   
756 inline static int simcall_BODY_process_get_PID(smx_process_t process) {
757     smx_process_t self = SIMIX_process_self();
758
759     /* Go to that function to follow the code flow through the simcall barrier */
760     if (0) SIMIX_process_get_PID(process);
761     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
762
763     self->simcall.call = SIMCALL_PROCESS_GET_PID;
764     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
765     memset(self->simcall.args, 0, sizeof(self->simcall.args));
766     self->simcall.args[0].dp = (void*) process;
767     if (self != simix_global->maestro_process) {
768       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
769                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
770       SIMIX_process_yield(self);
771     } else {
772       SIMIX_simcall_handle(&self->simcall, 0);
773     }    
774     return (int) self->simcall.result.i;
775   }
776   
777 inline static int simcall_BODY_process_get_PPID(smx_process_t process) {
778     smx_process_t self = SIMIX_process_self();
779
780     /* Go to that function to follow the code flow through the simcall barrier */
781     if (0) SIMIX_process_get_PPID(process);
782     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
783
784     self->simcall.call = SIMCALL_PROCESS_GET_PPID;
785     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
786     memset(self->simcall.args, 0, sizeof(self->simcall.args));
787     self->simcall.args[0].dp = (void*) process;
788     if (self != simix_global->maestro_process) {
789       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
790                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
791       SIMIX_process_yield(self);
792     } else {
793       SIMIX_simcall_handle(&self->simcall, 0);
794     }    
795     return (int) self->simcall.result.i;
796   }
797   
798 inline static void* simcall_BODY_process_get_data(smx_process_t process) {
799     smx_process_t self = SIMIX_process_self();
800
801     /* Go to that function to follow the code flow through the simcall barrier */
802     if (0) SIMIX_process_get_data(process);
803     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
804
805     self->simcall.call = SIMCALL_PROCESS_GET_DATA;
806     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
807     memset(self->simcall.args, 0, sizeof(self->simcall.args));
808     self->simcall.args[0].dp = (void*) process;
809     if (self != simix_global->maestro_process) {
810       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
811                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
812       SIMIX_process_yield(self);
813     } else {
814       SIMIX_simcall_handle(&self->simcall, 0);
815     }    
816     return (void*) self->simcall.result.dp;
817   }
818   
819 inline static void simcall_BODY_process_set_data(smx_process_t process, void* data) {
820     smx_process_t self = SIMIX_process_self();
821
822     /* Go to that function to follow the code flow through the simcall barrier */
823     if (0) SIMIX_process_set_data(process, data);
824     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
825
826     self->simcall.call = SIMCALL_PROCESS_SET_DATA;
827     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
828     memset(self->simcall.args, 0, sizeof(self->simcall.args));
829     self->simcall.args[0].dp = (void*) process;
830     self->simcall.args[1].dp = (void*) data;
831     if (self != simix_global->maestro_process) {
832       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
833                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
834       SIMIX_process_yield(self);
835     } else {
836       SIMIX_simcall_handle(&self->simcall, 0);
837     }    
838     
839   }
840   
841 inline static void simcall_BODY_process_set_host(smx_process_t process, sg_host_t dest) {
842     smx_process_t self = SIMIX_process_self();
843
844     /* Go to that function to follow the code flow through the simcall barrier */
845     if (0) simcall_HANDLER_process_set_host(&self->simcall, process, dest);
846     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
847
848     self->simcall.call = SIMCALL_PROCESS_SET_HOST;
849     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
850     memset(self->simcall.args, 0, sizeof(self->simcall.args));
851     self->simcall.args[0].dp = (void*) process;
852     self->simcall.args[1].dp = (void*) dest;
853     if (self != simix_global->maestro_process) {
854       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
855                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
856       SIMIX_process_yield(self);
857     } else {
858       SIMIX_simcall_handle(&self->simcall, 0);
859     }    
860     
861   }
862   
863 inline static sg_host_t simcall_BODY_process_get_host(smx_process_t process) {
864     smx_process_t self = SIMIX_process_self();
865
866     /* Go to that function to follow the code flow through the simcall barrier */
867     if (0) SIMIX_process_get_host(process);
868     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
869
870     self->simcall.call = SIMCALL_PROCESS_GET_HOST;
871     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
872     memset(self->simcall.args, 0, sizeof(self->simcall.args));
873     self->simcall.args[0].dp = (void*) process;
874     if (self != simix_global->maestro_process) {
875       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
876                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
877       SIMIX_process_yield(self);
878     } else {
879       SIMIX_simcall_handle(&self->simcall, 0);
880     }    
881     return (sg_host_t) self->simcall.result.dp;
882   }
883   
884 inline static const char* simcall_BODY_process_get_name(smx_process_t process) {
885     smx_process_t self = SIMIX_process_self();
886
887     /* Go to that function to follow the code flow through the simcall barrier */
888     if (0) SIMIX_process_get_name(process);
889     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
890
891     self->simcall.call = SIMCALL_PROCESS_GET_NAME;
892     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
893     memset(self->simcall.args, 0, sizeof(self->simcall.args));
894     self->simcall.args[0].dp = (void*) process;
895     if (self != simix_global->maestro_process) {
896       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
897                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
898       SIMIX_process_yield(self);
899     } else {
900       SIMIX_simcall_handle(&self->simcall, 0);
901     }    
902     return (const char*) self->simcall.result.cc;
903   }
904   
905 inline static int simcall_BODY_process_is_suspended(smx_process_t process) {
906     smx_process_t self = SIMIX_process_self();
907
908     /* Go to that function to follow the code flow through the simcall barrier */
909     if (0) SIMIX_process_is_suspended(process);
910     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
911
912     self->simcall.call = SIMCALL_PROCESS_IS_SUSPENDED;
913     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
914     memset(self->simcall.args, 0, sizeof(self->simcall.args));
915     self->simcall.args[0].dp = (void*) process;
916     if (self != simix_global->maestro_process) {
917       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
918                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
919       SIMIX_process_yield(self);
920     } else {
921       SIMIX_simcall_handle(&self->simcall, 0);
922     }    
923     return (int) self->simcall.result.i;
924   }
925   
926 inline static xbt_dict_t simcall_BODY_process_get_properties(smx_process_t process) {
927     smx_process_t self = SIMIX_process_self();
928
929     /* Go to that function to follow the code flow through the simcall barrier */
930     if (0) SIMIX_process_get_properties(process);
931     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
932
933     self->simcall.call = SIMCALL_PROCESS_GET_PROPERTIES;
934     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
935     memset(self->simcall.args, 0, sizeof(self->simcall.args));
936     self->simcall.args[0].dp = (void*) process;
937     if (self != simix_global->maestro_process) {
938       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
939                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
940       SIMIX_process_yield(self);
941     } else {
942       SIMIX_simcall_handle(&self->simcall, 0);
943     }    
944     return (xbt_dict_t) self->simcall.result.dp;
945   }
946   
947 inline static int simcall_BODY_process_join(smx_process_t process, double timeout) {
948     smx_process_t self = SIMIX_process_self();
949
950     /* Go to that function to follow the code flow through the simcall barrier */
951     if (0) simcall_HANDLER_process_join(&self->simcall, process, timeout);
952     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
953
954     self->simcall.call = SIMCALL_PROCESS_JOIN;
955     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
956     memset(self->simcall.args, 0, sizeof(self->simcall.args));
957     self->simcall.args[0].dp = (void*) process;
958     self->simcall.args[1].d = (double) timeout;
959     if (self != simix_global->maestro_process) {
960       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
961                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
962       SIMIX_process_yield(self);
963     } else {
964       SIMIX_simcall_handle(&self->simcall, 0);
965     }    
966     return (int) self->simcall.result.i;
967   }
968   
969 inline static int simcall_BODY_process_sleep(double duration) {
970     smx_process_t self = SIMIX_process_self();
971
972     /* Go to that function to follow the code flow through the simcall barrier */
973     if (0) simcall_HANDLER_process_sleep(&self->simcall, duration);
974     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
975
976     self->simcall.call = SIMCALL_PROCESS_SLEEP;
977     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
978     memset(self->simcall.args, 0, sizeof(self->simcall.args));
979     self->simcall.args[0].d = (double) duration;
980     if (self != simix_global->maestro_process) {
981       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
982                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
983       SIMIX_process_yield(self);
984     } else {
985       SIMIX_simcall_handle(&self->simcall, 0);
986     }    
987     return (int) self->simcall.result.i;
988   }
989   
990 inline static smx_synchro_t simcall_BODY_process_execute(const char* name, double flops_amount, double priority, double bound, unsigned long affinity_mask) {
991     smx_process_t self = SIMIX_process_self();
992
993     /* Go to that function to follow the code flow through the simcall barrier */
994     if (0) simcall_HANDLER_process_execute(&self->simcall, name, flops_amount, priority, bound, affinity_mask);
995     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
996
997     self->simcall.call = SIMCALL_PROCESS_EXECUTE;
998     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
999     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1000     self->simcall.args[0].cc = (const char*) name;
1001     self->simcall.args[1].d = (double) flops_amount;
1002     self->simcall.args[2].d = (double) priority;
1003     self->simcall.args[3].d = (double) bound;
1004     self->simcall.args[4].ul = (unsigned long) affinity_mask;
1005     if (self != simix_global->maestro_process) {
1006       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1007                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1008       SIMIX_process_yield(self);
1009     } else {
1010       SIMIX_simcall_handle(&self->simcall, 0);
1011     }    
1012     return (smx_synchro_t) self->simcall.result.dp;
1013   }
1014   
1015 inline static smx_synchro_t simcall_BODY_process_parallel_execute(const char* name, int host_nb, sg_host_t* host_list, double* flops_amount, double* bytes_amount, double amount, double rate) {
1016     smx_process_t self = SIMIX_process_self();
1017
1018     /* Go to that function to follow the code flow through the simcall barrier */
1019     if (0) SIMIX_process_parallel_execute(name, host_nb, host_list, flops_amount, bytes_amount, amount, rate);
1020     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1021
1022     self->simcall.call = SIMCALL_PROCESS_PARALLEL_EXECUTE;
1023     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1024     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1025     self->simcall.args[0].cc = (const char*) name;
1026     self->simcall.args[1].i = (int) host_nb;
1027     self->simcall.args[2].dp = (void*) host_list;
1028     self->simcall.args[3].dp = (void*) flops_amount;
1029     self->simcall.args[4].dp = (void*) bytes_amount;
1030     self->simcall.args[5].d = (double) amount;
1031     self->simcall.args[6].d = (double) rate;
1032     if (self != simix_global->maestro_process) {
1033       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1034                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1035       SIMIX_process_yield(self);
1036     } else {
1037       SIMIX_simcall_handle(&self->simcall, 0);
1038     }    
1039     return (smx_synchro_t) self->simcall.result.dp;
1040   }
1041   
1042 inline static void simcall_BODY_process_execution_destroy(smx_synchro_t execution) {
1043     smx_process_t self = SIMIX_process_self();
1044
1045     /* Go to that function to follow the code flow through the simcall barrier */
1046     if (0) SIMIX_process_execution_destroy(execution);
1047     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1048
1049     self->simcall.call = SIMCALL_PROCESS_EXECUTION_DESTROY;
1050     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1051     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1052     self->simcall.args[0].dp = (void*) execution;
1053     if (self != simix_global->maestro_process) {
1054       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1055                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1056       SIMIX_process_yield(self);
1057     } else {
1058       SIMIX_simcall_handle(&self->simcall, 0);
1059     }    
1060     
1061   }
1062   
1063 inline static void simcall_BODY_process_execution_cancel(smx_synchro_t execution) {
1064     smx_process_t self = SIMIX_process_self();
1065
1066     /* Go to that function to follow the code flow through the simcall barrier */
1067     if (0) SIMIX_process_execution_cancel(execution);
1068     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1069
1070     self->simcall.call = SIMCALL_PROCESS_EXECUTION_CANCEL;
1071     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1072     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1073     self->simcall.args[0].dp = (void*) execution;
1074     if (self != simix_global->maestro_process) {
1075       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1076                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1077       SIMIX_process_yield(self);
1078     } else {
1079       SIMIX_simcall_handle(&self->simcall, 0);
1080     }    
1081     
1082   }
1083   
1084 inline static double simcall_BODY_process_execution_get_remains(smx_synchro_t execution) {
1085     smx_process_t self = SIMIX_process_self();
1086
1087     /* Go to that function to follow the code flow through the simcall barrier */
1088     if (0) SIMIX_process_execution_get_remains(execution);
1089     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1090
1091     self->simcall.call = SIMCALL_PROCESS_EXECUTION_GET_REMAINS;
1092     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1093     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1094     self->simcall.args[0].dp = (void*) execution;
1095     if (self != simix_global->maestro_process) {
1096       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1097                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1098       SIMIX_process_yield(self);
1099     } else {
1100       SIMIX_simcall_handle(&self->simcall, 0);
1101     }    
1102     return (double) self->simcall.result.d;
1103   }
1104   
1105 inline static e_smx_state_t simcall_BODY_process_execution_get_state(smx_synchro_t execution) {
1106     smx_process_t self = SIMIX_process_self();
1107
1108     /* Go to that function to follow the code flow through the simcall barrier */
1109     if (0) SIMIX_process_execution_get_state(execution);
1110     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1111
1112     self->simcall.call = SIMCALL_PROCESS_EXECUTION_GET_STATE;
1113     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1114     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1115     self->simcall.args[0].dp = (void*) execution;
1116     if (self != simix_global->maestro_process) {
1117       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1118                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1119       SIMIX_process_yield(self);
1120     } else {
1121       SIMIX_simcall_handle(&self->simcall, 0);
1122     }    
1123     return (e_smx_state_t) self->simcall.result.i;
1124   }
1125   
1126 inline static void simcall_BODY_process_execution_set_priority(smx_synchro_t execution, double priority) {
1127     smx_process_t self = SIMIX_process_self();
1128
1129     /* Go to that function to follow the code flow through the simcall barrier */
1130     if (0) SIMIX_process_execution_set_priority(execution, priority);
1131     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1132
1133     self->simcall.call = SIMCALL_PROCESS_EXECUTION_SET_PRIORITY;
1134     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1135     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1136     self->simcall.args[0].dp = (void*) execution;
1137     self->simcall.args[1].d = (double) priority;
1138     if (self != simix_global->maestro_process) {
1139       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1140                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1141       SIMIX_process_yield(self);
1142     } else {
1143       SIMIX_simcall_handle(&self->simcall, 0);
1144     }    
1145     
1146   }
1147   
1148 inline static void simcall_BODY_process_execution_set_bound(smx_synchro_t execution, double bound) {
1149     smx_process_t self = SIMIX_process_self();
1150
1151     /* Go to that function to follow the code flow through the simcall barrier */
1152     if (0) SIMIX_process_execution_set_bound(execution, bound);
1153     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1154
1155     self->simcall.call = SIMCALL_PROCESS_EXECUTION_SET_BOUND;
1156     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1157     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1158     self->simcall.args[0].dp = (void*) execution;
1159     self->simcall.args[1].d = (double) bound;
1160     if (self != simix_global->maestro_process) {
1161       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1162                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1163       SIMIX_process_yield(self);
1164     } else {
1165       SIMIX_simcall_handle(&self->simcall, 0);
1166     }    
1167     
1168   }
1169   
1170 inline static void simcall_BODY_process_execution_set_affinity(smx_synchro_t execution, sg_host_t ws, unsigned long mask) {
1171     smx_process_t self = SIMIX_process_self();
1172
1173     /* Go to that function to follow the code flow through the simcall barrier */
1174     if (0) SIMIX_process_execution_set_affinity(execution, ws, mask);
1175     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1176
1177     self->simcall.call = SIMCALL_PROCESS_EXECUTION_SET_AFFINITY;
1178     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1179     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1180     self->simcall.args[0].dp = (void*) execution;
1181     self->simcall.args[1].dp = (void*) ws;
1182     self->simcall.args[2].ul = (unsigned long) mask;
1183     if (self != simix_global->maestro_process) {
1184       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1185                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1186       SIMIX_process_yield(self);
1187     } else {
1188       SIMIX_simcall_handle(&self->simcall, 0);
1189     }    
1190     
1191   }
1192   
1193 inline static int simcall_BODY_process_execution_wait(smx_synchro_t execution) {
1194     smx_process_t self = SIMIX_process_self();
1195
1196     /* Go to that function to follow the code flow through the simcall barrier */
1197     if (0) simcall_HANDLER_process_execution_wait(&self->simcall, execution);
1198     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1199
1200     self->simcall.call = SIMCALL_PROCESS_EXECUTION_WAIT;
1201     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1202     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1203     self->simcall.args[0].dp = (void*) execution;
1204     if (self != simix_global->maestro_process) {
1205       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1206                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1207       SIMIX_process_yield(self);
1208     } else {
1209       SIMIX_simcall_handle(&self->simcall, 0);
1210     }    
1211     return (int) self->simcall.result.i;
1212   }
1213   
1214 inline static void simcall_BODY_process_on_exit(smx_process_t process, int_f_pvoid_pvoid_t fun, void* data) {
1215     smx_process_t self = SIMIX_process_self();
1216
1217     /* Go to that function to follow the code flow through the simcall barrier */
1218     if (0) SIMIX_process_on_exit(process, fun, data);
1219     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1220
1221     self->simcall.call = SIMCALL_PROCESS_ON_EXIT;
1222     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1223     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1224     self->simcall.args[0].dp = (void*) process;
1225     self->simcall.args[1].fp = (FPtr) fun;
1226     self->simcall.args[2].dp = (void*) data;
1227     if (self != simix_global->maestro_process) {
1228       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1229                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1230       SIMIX_process_yield(self);
1231     } else {
1232       SIMIX_simcall_handle(&self->simcall, 0);
1233     }    
1234     
1235   }
1236   
1237 inline static void simcall_BODY_process_auto_restart_set(smx_process_t process, int auto_restart) {
1238     smx_process_t self = SIMIX_process_self();
1239
1240     /* Go to that function to follow the code flow through the simcall barrier */
1241     if (0) SIMIX_process_auto_restart_set(process, auto_restart);
1242     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1243
1244     self->simcall.call = SIMCALL_PROCESS_AUTO_RESTART_SET;
1245     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1246     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1247     self->simcall.args[0].dp = (void*) process;
1248     self->simcall.args[1].i = (int) auto_restart;
1249     if (self != simix_global->maestro_process) {
1250       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1251                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1252       SIMIX_process_yield(self);
1253     } else {
1254       SIMIX_simcall_handle(&self->simcall, 0);
1255     }    
1256     
1257   }
1258   
1259 inline static smx_process_t simcall_BODY_process_restart(smx_process_t process) {
1260     smx_process_t self = SIMIX_process_self();
1261
1262     /* Go to that function to follow the code flow through the simcall barrier */
1263     if (0) simcall_HANDLER_process_restart(&self->simcall, process);
1264     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1265
1266     self->simcall.call = SIMCALL_PROCESS_RESTART;
1267     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1268     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1269     self->simcall.args[0].dp = (void*) process;
1270     if (self != simix_global->maestro_process) {
1271       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1272                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1273       SIMIX_process_yield(self);
1274     } else {
1275       SIMIX_simcall_handle(&self->simcall, 0);
1276     }    
1277     return (smx_process_t) self->simcall.result.dp;
1278   }
1279   
1280 inline static smx_rdv_t simcall_BODY_rdv_create(const char* name) {
1281     smx_process_t self = SIMIX_process_self();
1282
1283     /* Go to that function to follow the code flow through the simcall barrier */
1284     if (0) SIMIX_rdv_create(name);
1285     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1286
1287     self->simcall.call = SIMCALL_RDV_CREATE;
1288     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1289     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1290     self->simcall.args[0].cc = (const char*) name;
1291     if (self != simix_global->maestro_process) {
1292       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1293                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1294       SIMIX_process_yield(self);
1295     } else {
1296       SIMIX_simcall_handle(&self->simcall, 0);
1297     }    
1298     return (smx_rdv_t) self->simcall.result.dp;
1299   }
1300   
1301 inline static void simcall_BODY_rdv_destroy(smx_rdv_t rdv) {
1302     smx_process_t self = SIMIX_process_self();
1303
1304     /* Go to that function to follow the code flow through the simcall barrier */
1305     if (0) SIMIX_rdv_destroy(rdv);
1306     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1307
1308     self->simcall.call = SIMCALL_RDV_DESTROY;
1309     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1310     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1311     self->simcall.args[0].dp = (void*) rdv;
1312     if (self != simix_global->maestro_process) {
1313       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1314                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1315       SIMIX_process_yield(self);
1316     } else {
1317       SIMIX_simcall_handle(&self->simcall, 0);
1318     }    
1319     
1320   }
1321   
1322 inline static unsigned int simcall_BODY_rdv_comm_count_by_host(smx_rdv_t rdv, sg_host_t host) {
1323     smx_process_t self = SIMIX_process_self();
1324
1325     /* Go to that function to follow the code flow through the simcall barrier */
1326     if (0) SIMIX_rdv_comm_count_by_host(rdv, host);
1327     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1328
1329     self->simcall.call = SIMCALL_RDV_COMM_COUNT_BY_HOST;
1330     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1331     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1332     self->simcall.args[0].dp = (void*) rdv;
1333     self->simcall.args[1].dp = (void*) host;
1334     if (self != simix_global->maestro_process) {
1335       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1336                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1337       SIMIX_process_yield(self);
1338     } else {
1339       SIMIX_simcall_handle(&self->simcall, 0);
1340     }    
1341     return (unsigned int) self->simcall.result.ui;
1342   }
1343   
1344 inline static smx_synchro_t simcall_BODY_rdv_get_head(smx_rdv_t rdv) {
1345     smx_process_t self = SIMIX_process_self();
1346
1347     /* Go to that function to follow the code flow through the simcall barrier */
1348     if (0) SIMIX_rdv_get_head(rdv);
1349     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1350
1351     self->simcall.call = SIMCALL_RDV_GET_HEAD;
1352     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1353     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1354     self->simcall.args[0].dp = (void*) rdv;
1355     if (self != simix_global->maestro_process) {
1356       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1357                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1358       SIMIX_process_yield(self);
1359     } else {
1360       SIMIX_simcall_handle(&self->simcall, 0);
1361     }    
1362     return (smx_synchro_t) self->simcall.result.dp;
1363   }
1364   
1365 inline static void simcall_BODY_rdv_set_receiver(smx_rdv_t rdv, smx_process_t receiver) {
1366     smx_process_t self = SIMIX_process_self();
1367
1368     /* Go to that function to follow the code flow through the simcall barrier */
1369     if (0) SIMIX_rdv_set_receiver(rdv, receiver);
1370     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1371
1372     self->simcall.call = SIMCALL_RDV_SET_RECEIVER;
1373     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1374     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1375     self->simcall.args[0].dp = (void*) rdv;
1376     self->simcall.args[1].dp = (void*) receiver;
1377     if (self != simix_global->maestro_process) {
1378       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1379                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1380       SIMIX_process_yield(self);
1381     } else {
1382       SIMIX_simcall_handle(&self->simcall, 0);
1383     }    
1384     
1385   }
1386   
1387 inline static smx_process_t simcall_BODY_rdv_get_receiver(smx_rdv_t rdv) {
1388     smx_process_t self = SIMIX_process_self();
1389
1390     /* Go to that function to follow the code flow through the simcall barrier */
1391     if (0) SIMIX_rdv_get_receiver(rdv);
1392     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1393
1394     self->simcall.call = SIMCALL_RDV_GET_RECEIVER;
1395     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1396     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1397     self->simcall.args[0].dp = (void*) rdv;
1398     if (self != simix_global->maestro_process) {
1399       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1400                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1401       SIMIX_process_yield(self);
1402     } else {
1403       SIMIX_simcall_handle(&self->simcall, 0);
1404     }    
1405     return (smx_process_t) self->simcall.result.dp;
1406   }
1407   
1408 inline static smx_synchro_t simcall_BODY_comm_iprobe(smx_rdv_t rdv, int type, int src, int tag, simix_match_func_t match_fun, void* data) {
1409     smx_process_t self = SIMIX_process_self();
1410
1411     /* Go to that function to follow the code flow through the simcall barrier */
1412     if (0) simcall_HANDLER_comm_iprobe(&self->simcall, rdv, type, src, tag, match_fun, data);
1413     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1414
1415     self->simcall.call = SIMCALL_COMM_IPROBE;
1416     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1417     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1418     self->simcall.args[0].dp = (void*) rdv;
1419     self->simcall.args[1].i = (int) type;
1420     self->simcall.args[2].i = (int) src;
1421     self->simcall.args[3].i = (int) tag;
1422     self->simcall.args[4].fp = (FPtr) match_fun;
1423     self->simcall.args[5].dp = (void*) data;
1424     if (self != simix_global->maestro_process) {
1425       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1426                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1427       SIMIX_process_yield(self);
1428     } else {
1429       SIMIX_simcall_handle(&self->simcall, 0);
1430     }    
1431     return (smx_synchro_t) self->simcall.result.dp;
1432   }
1433   
1434 inline static void simcall_BODY_comm_send(smx_process_t sender, smx_rdv_t rdv, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout) {
1435     smx_process_t self = SIMIX_process_self();
1436
1437     /* Go to that function to follow the code flow through the simcall barrier */
1438     if (0) simcall_HANDLER_comm_send(&self->simcall, sender, rdv, task_size, rate, src_buff, src_buff_size, match_fun, copy_data_fun, data, timeout);
1439     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1440
1441     self->simcall.call = SIMCALL_COMM_SEND;
1442     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1443     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1444     self->simcall.args[0].dp = (void*) sender;
1445     self->simcall.args[1].dp = (void*) rdv;
1446     self->simcall.args[2].d = (double) task_size;
1447     self->simcall.args[3].d = (double) rate;
1448     self->simcall.args[4].dp = (void*) src_buff;
1449     self->simcall.args[5].sz = (size_t) src_buff_size;
1450     self->simcall.args[6].fp = (FPtr) match_fun;
1451     self->simcall.args[7].fp = (FPtr) copy_data_fun;
1452     self->simcall.args[8].dp = (void*) data;
1453     self->simcall.args[9].d = (double) timeout;
1454     if (self != simix_global->maestro_process) {
1455       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1456                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1457       SIMIX_process_yield(self);
1458     } else {
1459       SIMIX_simcall_handle(&self->simcall, 0);
1460     }    
1461     
1462   }
1463   
1464 inline static smx_synchro_t simcall_BODY_comm_isend(smx_process_t sender, smx_rdv_t rdv, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_clean_func_t clean_fun, simix_copy_data_func_t copy_data_fun, void* data, int detached) {
1465     smx_process_t self = SIMIX_process_self();
1466
1467     /* Go to that function to follow the code flow through the simcall barrier */
1468     if (0) simcall_HANDLER_comm_isend(&self->simcall, sender, rdv, task_size, rate, src_buff, src_buff_size, match_fun, clean_fun, copy_data_fun, data, detached);
1469     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1470
1471     self->simcall.call = SIMCALL_COMM_ISEND;
1472     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1473     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1474     self->simcall.args[0].dp = (void*) sender;
1475     self->simcall.args[1].dp = (void*) rdv;
1476     self->simcall.args[2].d = (double) task_size;
1477     self->simcall.args[3].d = (double) rate;
1478     self->simcall.args[4].dp = (void*) src_buff;
1479     self->simcall.args[5].sz = (size_t) src_buff_size;
1480     self->simcall.args[6].fp = (FPtr) match_fun;
1481     self->simcall.args[7].fp = (FPtr) clean_fun;
1482     self->simcall.args[8].fp = (FPtr) copy_data_fun;
1483     self->simcall.args[9].dp = (void*) data;
1484     self->simcall.args[10].i = (int) detached;
1485     if (self != simix_global->maestro_process) {
1486       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1487                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1488       SIMIX_process_yield(self);
1489     } else {
1490       SIMIX_simcall_handle(&self->simcall, 0);
1491     }    
1492     return (smx_synchro_t) self->simcall.result.dp;
1493   }
1494   
1495 inline static void simcall_BODY_comm_recv(smx_process_t receiver, smx_rdv_t rdv, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout, double rate) {
1496     smx_process_t self = SIMIX_process_self();
1497
1498     /* Go to that function to follow the code flow through the simcall barrier */
1499     if (0) simcall_HANDLER_comm_recv(&self->simcall, receiver, rdv, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, timeout, rate);
1500     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1501
1502     self->simcall.call = SIMCALL_COMM_RECV;
1503     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1504     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1505     self->simcall.args[0].dp = (void*) receiver;
1506     self->simcall.args[1].dp = (void*) rdv;
1507     self->simcall.args[2].dp = (void*) dst_buff;
1508     self->simcall.args[3].dp = (void*) dst_buff_size;
1509     self->simcall.args[4].fp = (FPtr) match_fun;
1510     self->simcall.args[5].fp = (FPtr) copy_data_fun;
1511     self->simcall.args[6].dp = (void*) data;
1512     self->simcall.args[7].d = (double) timeout;
1513     self->simcall.args[8].d = (double) rate;
1514     if (self != simix_global->maestro_process) {
1515       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1516                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1517       SIMIX_process_yield(self);
1518     } else {
1519       SIMIX_simcall_handle(&self->simcall, 0);
1520     }    
1521     
1522   }
1523   
1524 inline static smx_synchro_t simcall_BODY_comm_irecv(smx_process_t receiver, smx_rdv_t rdv, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double rate) {
1525     smx_process_t self = SIMIX_process_self();
1526
1527     /* Go to that function to follow the code flow through the simcall barrier */
1528     if (0) simcall_HANDLER_comm_irecv(&self->simcall, receiver, rdv, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, rate);
1529     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1530
1531     self->simcall.call = SIMCALL_COMM_IRECV;
1532     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1533     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1534     self->simcall.args[0].dp = (void*) receiver;
1535     self->simcall.args[1].dp = (void*) rdv;
1536     self->simcall.args[2].dp = (void*) dst_buff;
1537     self->simcall.args[3].dp = (void*) dst_buff_size;
1538     self->simcall.args[4].fp = (FPtr) match_fun;
1539     self->simcall.args[5].fp = (FPtr) copy_data_fun;
1540     self->simcall.args[6].dp = (void*) data;
1541     self->simcall.args[7].d = (double) rate;
1542     if (self != simix_global->maestro_process) {
1543       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1544                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1545       SIMIX_process_yield(self);
1546     } else {
1547       SIMIX_simcall_handle(&self->simcall, 0);
1548     }    
1549     return (smx_synchro_t) self->simcall.result.dp;
1550   }
1551   
1552 inline static void simcall_BODY_comm_cancel(smx_synchro_t comm) {
1553     smx_process_t self = SIMIX_process_self();
1554
1555     /* Go to that function to follow the code flow through the simcall barrier */
1556     if (0) SIMIX_comm_cancel(comm);
1557     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1558
1559     self->simcall.call = SIMCALL_COMM_CANCEL;
1560     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1561     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1562     self->simcall.args[0].dp = (void*) comm;
1563     if (self != simix_global->maestro_process) {
1564       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1565                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1566       SIMIX_process_yield(self);
1567     } else {
1568       SIMIX_simcall_handle(&self->simcall, 0);
1569     }    
1570     
1571   }
1572   
1573 inline static int simcall_BODY_comm_waitany(xbt_dynar_t comms) {
1574     smx_process_t self = SIMIX_process_self();
1575
1576     /* Go to that function to follow the code flow through the simcall barrier */
1577     if (0) simcall_HANDLER_comm_waitany(&self->simcall, comms);
1578     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1579
1580     self->simcall.call = SIMCALL_COMM_WAITANY;
1581     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1582     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1583     self->simcall.args[0].dp = (void*) comms;
1584     if (self != simix_global->maestro_process) {
1585       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1586                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1587       SIMIX_process_yield(self);
1588     } else {
1589       SIMIX_simcall_handle(&self->simcall, 0);
1590     }    
1591     return (int) self->simcall.result.i;
1592   }
1593   
1594 inline static void simcall_BODY_comm_wait(smx_synchro_t comm, double timeout) {
1595     smx_process_t self = SIMIX_process_self();
1596
1597     /* Go to that function to follow the code flow through the simcall barrier */
1598     if (0) simcall_HANDLER_comm_wait(&self->simcall, comm, timeout);
1599     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1600
1601     self->simcall.call = SIMCALL_COMM_WAIT;
1602     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1603     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1604     self->simcall.args[0].dp = (void*) comm;
1605     self->simcall.args[1].d = (double) timeout;
1606     if (self != simix_global->maestro_process) {
1607       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1608                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1609       SIMIX_process_yield(self);
1610     } else {
1611       SIMIX_simcall_handle(&self->simcall, 0);
1612     }    
1613     
1614   }
1615   
1616 inline static int simcall_BODY_comm_test(smx_synchro_t comm) {
1617     smx_process_t self = SIMIX_process_self();
1618
1619     /* Go to that function to follow the code flow through the simcall barrier */
1620     if (0) simcall_HANDLER_comm_test(&self->simcall, comm);
1621     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1622
1623     self->simcall.call = SIMCALL_COMM_TEST;
1624     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1625     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1626     self->simcall.args[0].dp = (void*) comm;
1627     if (self != simix_global->maestro_process) {
1628       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1629                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1630       SIMIX_process_yield(self);
1631     } else {
1632       SIMIX_simcall_handle(&self->simcall, 0);
1633     }    
1634     return (int) self->simcall.result.i;
1635   }
1636   
1637 inline static int simcall_BODY_comm_testany(xbt_dynar_t comms) {
1638     smx_process_t self = SIMIX_process_self();
1639
1640     /* Go to that function to follow the code flow through the simcall barrier */
1641     if (0) simcall_HANDLER_comm_testany(&self->simcall, comms);
1642     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1643
1644     self->simcall.call = SIMCALL_COMM_TESTANY;
1645     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1646     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1647     self->simcall.args[0].dp = (void*) comms;
1648     if (self != simix_global->maestro_process) {
1649       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1650                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1651       SIMIX_process_yield(self);
1652     } else {
1653       SIMIX_simcall_handle(&self->simcall, 0);
1654     }    
1655     return (int) self->simcall.result.i;
1656   }
1657   
1658 inline static double simcall_BODY_comm_get_remains(smx_synchro_t comm) {
1659     smx_process_t self = SIMIX_process_self();
1660
1661     /* Go to that function to follow the code flow through the simcall barrier */
1662     if (0) SIMIX_comm_get_remains(comm);
1663     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1664
1665     self->simcall.call = SIMCALL_COMM_GET_REMAINS;
1666     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1667     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1668     self->simcall.args[0].dp = (void*) comm;
1669     if (self != simix_global->maestro_process) {
1670       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1671                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1672       SIMIX_process_yield(self);
1673     } else {
1674       SIMIX_simcall_handle(&self->simcall, 0);
1675     }    
1676     return (double) self->simcall.result.d;
1677   }
1678   
1679 inline static e_smx_state_t simcall_BODY_comm_get_state(smx_synchro_t comm) {
1680     smx_process_t self = SIMIX_process_self();
1681
1682     /* Go to that function to follow the code flow through the simcall barrier */
1683     if (0) SIMIX_comm_get_state(comm);
1684     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1685
1686     self->simcall.call = SIMCALL_COMM_GET_STATE;
1687     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1688     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1689     self->simcall.args[0].dp = (void*) comm;
1690     if (self != simix_global->maestro_process) {
1691       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1692                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1693       SIMIX_process_yield(self);
1694     } else {
1695       SIMIX_simcall_handle(&self->simcall, 0);
1696     }    
1697     return (e_smx_state_t) self->simcall.result.i;
1698   }
1699   
1700 inline static void* simcall_BODY_comm_get_src_data(smx_synchro_t comm) {
1701     smx_process_t self = SIMIX_process_self();
1702
1703     /* Go to that function to follow the code flow through the simcall barrier */
1704     if (0) SIMIX_comm_get_src_data(comm);
1705     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1706
1707     self->simcall.call = SIMCALL_COMM_GET_SRC_DATA;
1708     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1709     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1710     self->simcall.args[0].dp = (void*) comm;
1711     if (self != simix_global->maestro_process) {
1712       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1713                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1714       SIMIX_process_yield(self);
1715     } else {
1716       SIMIX_simcall_handle(&self->simcall, 0);
1717     }    
1718     return (void*) self->simcall.result.dp;
1719   }
1720   
1721 inline static void* simcall_BODY_comm_get_dst_data(smx_synchro_t comm) {
1722     smx_process_t self = SIMIX_process_self();
1723
1724     /* Go to that function to follow the code flow through the simcall barrier */
1725     if (0) SIMIX_comm_get_dst_data(comm);
1726     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1727
1728     self->simcall.call = SIMCALL_COMM_GET_DST_DATA;
1729     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1730     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1731     self->simcall.args[0].dp = (void*) comm;
1732     if (self != simix_global->maestro_process) {
1733       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1734                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1735       SIMIX_process_yield(self);
1736     } else {
1737       SIMIX_simcall_handle(&self->simcall, 0);
1738     }    
1739     return (void*) self->simcall.result.dp;
1740   }
1741   
1742 inline static smx_process_t simcall_BODY_comm_get_src_proc(smx_synchro_t comm) {
1743     smx_process_t self = SIMIX_process_self();
1744
1745     /* Go to that function to follow the code flow through the simcall barrier */
1746     if (0) SIMIX_comm_get_src_proc(comm);
1747     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1748
1749     self->simcall.call = SIMCALL_COMM_GET_SRC_PROC;
1750     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1751     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1752     self->simcall.args[0].dp = (void*) comm;
1753     if (self != simix_global->maestro_process) {
1754       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1755                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1756       SIMIX_process_yield(self);
1757     } else {
1758       SIMIX_simcall_handle(&self->simcall, 0);
1759     }    
1760     return (smx_process_t) self->simcall.result.dp;
1761   }
1762   
1763 inline static smx_process_t simcall_BODY_comm_get_dst_proc(smx_synchro_t comm) {
1764     smx_process_t self = SIMIX_process_self();
1765
1766     /* Go to that function to follow the code flow through the simcall barrier */
1767     if (0) SIMIX_comm_get_dst_proc(comm);
1768     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1769
1770     self->simcall.call = SIMCALL_COMM_GET_DST_PROC;
1771     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1772     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1773     self->simcall.args[0].dp = (void*) comm;
1774     if (self != simix_global->maestro_process) {
1775       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1776                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1777       SIMIX_process_yield(self);
1778     } else {
1779       SIMIX_simcall_handle(&self->simcall, 0);
1780     }    
1781     return (smx_process_t) self->simcall.result.dp;
1782   }
1783   
1784 inline static smx_mutex_t simcall_BODY_mutex_init() {
1785     smx_process_t self = SIMIX_process_self();
1786
1787     /* Go to that function to follow the code flow through the simcall barrier */
1788     if (0) simcall_HANDLER_mutex_init(&self->simcall);
1789     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1790
1791     self->simcall.call = SIMCALL_MUTEX_INIT;
1792     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1793     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1794
1795     if (self != simix_global->maestro_process) {
1796       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1797                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1798       SIMIX_process_yield(self);
1799     } else {
1800       SIMIX_simcall_handle(&self->simcall, 0);
1801     }    
1802     return (smx_mutex_t) self->simcall.result.dp;
1803   }
1804   
1805 inline static void simcall_BODY_mutex_destroy(smx_mutex_t mutex) {
1806     smx_process_t self = SIMIX_process_self();
1807
1808     /* Go to that function to follow the code flow through the simcall barrier */
1809     if (0) SIMIX_mutex_destroy(mutex);
1810     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1811
1812     self->simcall.call = SIMCALL_MUTEX_DESTROY;
1813     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1814     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1815     self->simcall.args[0].dp = (void*) mutex;
1816     if (self != simix_global->maestro_process) {
1817       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1818                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1819       SIMIX_process_yield(self);
1820     } else {
1821       SIMIX_simcall_handle(&self->simcall, 0);
1822     }    
1823     
1824   }
1825   
1826 inline static void simcall_BODY_mutex_lock(smx_mutex_t mutex) {
1827     smx_process_t self = SIMIX_process_self();
1828
1829     /* Go to that function to follow the code flow through the simcall barrier */
1830     if (0) simcall_HANDLER_mutex_lock(&self->simcall, mutex);
1831     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1832
1833     self->simcall.call = SIMCALL_MUTEX_LOCK;
1834     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1835     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1836     self->simcall.args[0].dp = (void*) mutex;
1837     if (self != simix_global->maestro_process) {
1838       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1839                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1840       SIMIX_process_yield(self);
1841     } else {
1842       SIMIX_simcall_handle(&self->simcall, 0);
1843     }    
1844     
1845   }
1846   
1847 inline static int simcall_BODY_mutex_trylock(smx_mutex_t mutex) {
1848     smx_process_t self = SIMIX_process_self();
1849
1850     /* Go to that function to follow the code flow through the simcall barrier */
1851     if (0) simcall_HANDLER_mutex_trylock(&self->simcall, mutex);
1852     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1853
1854     self->simcall.call = SIMCALL_MUTEX_TRYLOCK;
1855     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1856     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1857     self->simcall.args[0].dp = (void*) mutex;
1858     if (self != simix_global->maestro_process) {
1859       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1860                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1861       SIMIX_process_yield(self);
1862     } else {
1863       SIMIX_simcall_handle(&self->simcall, 0);
1864     }    
1865     return (int) self->simcall.result.i;
1866   }
1867   
1868 inline static void simcall_BODY_mutex_unlock(smx_mutex_t mutex) {
1869     smx_process_t self = SIMIX_process_self();
1870
1871     /* Go to that function to follow the code flow through the simcall barrier */
1872     if (0) simcall_HANDLER_mutex_unlock(&self->simcall, mutex);
1873     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1874
1875     self->simcall.call = SIMCALL_MUTEX_UNLOCK;
1876     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1877     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1878     self->simcall.args[0].dp = (void*) mutex;
1879     if (self != simix_global->maestro_process) {
1880       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1881                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1882       SIMIX_process_yield(self);
1883     } else {
1884       SIMIX_simcall_handle(&self->simcall, 0);
1885     }    
1886     
1887   }
1888   
1889 inline static smx_cond_t simcall_BODY_cond_init() {
1890     smx_process_t self = SIMIX_process_self();
1891
1892     /* Go to that function to follow the code flow through the simcall barrier */
1893     if (0) SIMIX_cond_init();
1894     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1895
1896     self->simcall.call = SIMCALL_COND_INIT;
1897     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1898     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1899
1900     if (self != simix_global->maestro_process) {
1901       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1902                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1903       SIMIX_process_yield(self);
1904     } else {
1905       SIMIX_simcall_handle(&self->simcall, 0);
1906     }    
1907     return (smx_cond_t) self->simcall.result.dp;
1908   }
1909   
1910 inline static void simcall_BODY_cond_destroy(smx_cond_t cond) {
1911     smx_process_t self = SIMIX_process_self();
1912
1913     /* Go to that function to follow the code flow through the simcall barrier */
1914     if (0) SIMIX_cond_destroy(cond);
1915     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1916
1917     self->simcall.call = SIMCALL_COND_DESTROY;
1918     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1919     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1920     self->simcall.args[0].dp = (void*) cond;
1921     if (self != simix_global->maestro_process) {
1922       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1923                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1924       SIMIX_process_yield(self);
1925     } else {
1926       SIMIX_simcall_handle(&self->simcall, 0);
1927     }    
1928     
1929   }
1930   
1931 inline static void simcall_BODY_cond_signal(smx_cond_t cond) {
1932     smx_process_t self = SIMIX_process_self();
1933
1934     /* Go to that function to follow the code flow through the simcall barrier */
1935     if (0) SIMIX_cond_signal(cond);
1936     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1937
1938     self->simcall.call = SIMCALL_COND_SIGNAL;
1939     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1940     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1941     self->simcall.args[0].dp = (void*) cond;
1942     if (self != simix_global->maestro_process) {
1943       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1944                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1945       SIMIX_process_yield(self);
1946     } else {
1947       SIMIX_simcall_handle(&self->simcall, 0);
1948     }    
1949     
1950   }
1951   
1952 inline static void simcall_BODY_cond_wait(smx_cond_t cond, smx_mutex_t mutex) {
1953     smx_process_t self = SIMIX_process_self();
1954
1955     /* Go to that function to follow the code flow through the simcall barrier */
1956     if (0) simcall_HANDLER_cond_wait(&self->simcall, cond, mutex);
1957     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1958
1959     self->simcall.call = SIMCALL_COND_WAIT;
1960     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1961     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1962     self->simcall.args[0].dp = (void*) cond;
1963     self->simcall.args[1].dp = (void*) mutex;
1964     if (self != simix_global->maestro_process) {
1965       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1966                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1967       SIMIX_process_yield(self);
1968     } else {
1969       SIMIX_simcall_handle(&self->simcall, 0);
1970     }    
1971     
1972   }
1973   
1974 inline static void simcall_BODY_cond_wait_timeout(smx_cond_t cond, smx_mutex_t mutex, double timeout) {
1975     smx_process_t self = SIMIX_process_self();
1976
1977     /* Go to that function to follow the code flow through the simcall barrier */
1978     if (0) simcall_HANDLER_cond_wait_timeout(&self->simcall, cond, mutex, timeout);
1979     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1980
1981     self->simcall.call = SIMCALL_COND_WAIT_TIMEOUT;
1982     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1983     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1984     self->simcall.args[0].dp = (void*) cond;
1985     self->simcall.args[1].dp = (void*) mutex;
1986     self->simcall.args[2].d = (double) timeout;
1987     if (self != simix_global->maestro_process) {
1988       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1989                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1990       SIMIX_process_yield(self);
1991     } else {
1992       SIMIX_simcall_handle(&self->simcall, 0);
1993     }    
1994     
1995   }
1996   
1997 inline static void simcall_BODY_cond_broadcast(smx_cond_t cond) {
1998     smx_process_t self = SIMIX_process_self();
1999
2000     /* Go to that function to follow the code flow through the simcall barrier */
2001     if (0) SIMIX_cond_broadcast(cond);
2002     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
2003
2004     self->simcall.call = SIMCALL_COND_BROADCAST;
2005     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
2006     memset(self->simcall.args, 0, sizeof(self->simcall.args));
2007     self->simcall.args[0].dp = (void*) cond;
2008     if (self != simix_global->maestro_process) {
2009       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
2010                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
2011       SIMIX_process_yield(self);
2012     } else {
2013       SIMIX_simcall_handle(&self->simcall, 0);
2014     }    
2015     
2016   }
2017   
2018 inline static smx_sem_t simcall_BODY_sem_init(unsigned int capacity) {
2019     smx_process_t self = SIMIX_process_self();
2020
2021     /* Go to that function to follow the code flow through the simcall barrier */
2022     if (0) SIMIX_sem_init(capacity);
2023     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
2024
2025     self->simcall.call = SIMCALL_SEM_INIT;
2026     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
2027     memset(self->simcall.args, 0, sizeof(self->simcall.args));
2028     self->simcall.args[0].ui = (unsigned int) capacity;
2029     if (self != simix_global->maestro_process) {
2030       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
2031                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
2032       SIMIX_process_yield(self);
2033     } else {
2034       SIMIX_simcall_handle(&self->simcall, 0);
2035     }    
2036     return (smx_sem_t) self->simcall.result.dp;
2037   }
2038   
2039 inline static void simcall_BODY_sem_destroy(smx_sem_t sem) {
2040     smx_process_t self = SIMIX_process_self();
2041
2042     /* Go to that function to follow the code flow through the simcall barrier */
2043     if (0) SIMIX_sem_destroy(sem);
2044     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
2045
2046     self->simcall.call = SIMCALL_SEM_DESTROY;
2047     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
2048     memset(self->simcall.args, 0, sizeof(self->simcall.args));
2049     self->simcall.args[0].dp = (void*) sem;
2050     if (self != simix_global->maestro_process) {
2051       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
2052                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
2053       SIMIX_process_yield(self);
2054     } else {
2055       SIMIX_simcall_handle(&self->simcall, 0);
2056     }    
2057     
2058   }
2059   
2060 inline static void simcall_BODY_sem_release(smx_sem_t sem) {
2061     smx_process_t self = SIMIX_process_self();
2062
2063     /* Go to that function to follow the code flow through the simcall barrier */
2064     if (0) simcall_HANDLER_sem_release(&self->simcall, sem);
2065     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
2066
2067     self->simcall.call = SIMCALL_SEM_RELEASE;
2068     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
2069     memset(self->simcall.args, 0, sizeof(self->simcall.args));
2070     self->simcall.args[0].dp = (void*) sem;
2071     if (self != simix_global->maestro_process) {
2072       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
2073                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
2074       SIMIX_process_yield(self);
2075     } else {
2076       SIMIX_simcall_handle(&self->simcall, 0);
2077     }    
2078     
2079   }
2080   
2081 inline static int simcall_BODY_sem_would_block(smx_sem_t sem) {
2082     smx_process_t self = SIMIX_process_self();
2083
2084     /* Go to that function to follow the code flow through the simcall barrier */
2085     if (0) simcall_HANDLER_sem_would_block(&self->simcall, sem);
2086     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
2087
2088     self->simcall.call = SIMCALL_SEM_WOULD_BLOCK;
2089     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
2090     memset(self->simcall.args, 0, sizeof(self->simcall.args));
2091     self->simcall.args[0].dp = (void*) sem;
2092     if (self != simix_global->maestro_process) {
2093       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
2094                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
2095       SIMIX_process_yield(self);
2096     } else {
2097       SIMIX_simcall_handle(&self->simcall, 0);
2098     }    
2099     return (int) self->simcall.result.i;
2100   }
2101   
2102 inline static void simcall_BODY_sem_acquire(smx_sem_t sem) {
2103     smx_process_t self = SIMIX_process_self();
2104
2105     /* Go to that function to follow the code flow through the simcall barrier */
2106     if (0) simcall_HANDLER_sem_acquire(&self->simcall, sem);
2107     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
2108
2109     self->simcall.call = SIMCALL_SEM_ACQUIRE;
2110     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
2111     memset(self->simcall.args, 0, sizeof(self->simcall.args));
2112     self->simcall.args[0].dp = (void*) sem;
2113     if (self != simix_global->maestro_process) {
2114       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
2115                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
2116       SIMIX_process_yield(self);
2117     } else {
2118       SIMIX_simcall_handle(&self->simcall, 0);
2119     }    
2120     
2121   }
2122   
2123 inline static void simcall_BODY_sem_acquire_timeout(smx_sem_t sem, double timeout) {
2124     smx_process_t self = SIMIX_process_self();
2125
2126     /* Go to that function to follow the code flow through the simcall barrier */
2127     if (0) simcall_HANDLER_sem_acquire_timeout(&self->simcall, sem, timeout);
2128     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
2129
2130     self->simcall.call = SIMCALL_SEM_ACQUIRE_TIMEOUT;
2131     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
2132     memset(self->simcall.args, 0, sizeof(self->simcall.args));
2133     self->simcall.args[0].dp = (void*) sem;
2134     self->simcall.args[1].d = (double) timeout;
2135     if (self != simix_global->maestro_process) {
2136       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
2137                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
2138       SIMIX_process_yield(self);
2139     } else {
2140       SIMIX_simcall_handle(&self->simcall, 0);
2141     }    
2142     
2143   }
2144   
2145 inline static int simcall_BODY_sem_get_capacity(smx_sem_t sem) {
2146     smx_process_t self = SIMIX_process_self();
2147
2148     /* Go to that function to follow the code flow through the simcall barrier */
2149     if (0) simcall_HANDLER_sem_get_capacity(&self->simcall, sem);
2150     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
2151
2152     self->simcall.call = SIMCALL_SEM_GET_CAPACITY;
2153     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
2154     memset(self->simcall.args, 0, sizeof(self->simcall.args));
2155     self->simcall.args[0].dp = (void*) sem;
2156     if (self != simix_global->maestro_process) {
2157       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
2158                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
2159       SIMIX_process_yield(self);
2160     } else {
2161       SIMIX_simcall_handle(&self->simcall, 0);
2162     }    
2163     return (int) self->simcall.result.i;
2164   }
2165   
2166 inline static sg_size_t simcall_BODY_file_read(smx_file_t fd, sg_size_t size, sg_host_t host) {
2167     smx_process_t self = SIMIX_process_self();
2168
2169     /* Go to that function to follow the code flow through the simcall barrier */
2170     if (0) simcall_HANDLER_file_read(&self->simcall, fd, size, host);
2171     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
2172
2173     self->simcall.call = SIMCALL_FILE_READ;
2174     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
2175     memset(self->simcall.args, 0, sizeof(self->simcall.args));
2176     self->simcall.args[0].dp = (void*) fd;
2177     self->simcall.args[1].sgsz = (sg_size_t) size;
2178     self->simcall.args[2].dp = (void*) host;
2179     if (self != simix_global->maestro_process) {
2180       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
2181                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
2182       SIMIX_process_yield(self);
2183     } else {
2184       SIMIX_simcall_handle(&self->simcall, 0);
2185     }    
2186     return (sg_size_t) self->simcall.result.sgsz;
2187   }
2188   
2189 inline static sg_size_t simcall_BODY_file_write(smx_file_t fd, sg_size_t size, sg_host_t host) {
2190     smx_process_t self = SIMIX_process_self();
2191
2192     /* Go to that function to follow the code flow through the simcall barrier */
2193     if (0) simcall_HANDLER_file_write(&self->simcall, fd, size, host);
2194     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
2195
2196     self->simcall.call = SIMCALL_FILE_WRITE;
2197     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
2198     memset(self->simcall.args, 0, sizeof(self->simcall.args));
2199     self->simcall.args[0].dp = (void*) fd;
2200     self->simcall.args[1].sgsz = (sg_size_t) size;
2201     self->simcall.args[2].dp = (void*) host;
2202     if (self != simix_global->maestro_process) {
2203       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
2204                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
2205       SIMIX_process_yield(self);
2206     } else {
2207       SIMIX_simcall_handle(&self->simcall, 0);
2208     }    
2209     return (sg_size_t) self->simcall.result.sgsz;
2210   }
2211   
2212 inline static smx_file_t simcall_BODY_file_open(const char* fullpath, sg_host_t host) {
2213     smx_process_t self = SIMIX_process_self();
2214
2215     /* Go to that function to follow the code flow through the simcall barrier */
2216     if (0) simcall_HANDLER_file_open(&self->simcall, fullpath, host);
2217     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
2218
2219     self->simcall.call = SIMCALL_FILE_OPEN;
2220     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
2221     memset(self->simcall.args, 0, sizeof(self->simcall.args));
2222     self->simcall.args[0].cc = (const char*) fullpath;
2223     self->simcall.args[1].dp = (void*) host;
2224     if (self != simix_global->maestro_process) {
2225       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
2226                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
2227       SIMIX_process_yield(self);
2228     } else {
2229       SIMIX_simcall_handle(&self->simcall, 0);
2230     }    
2231     return (smx_file_t) self->simcall.result.dp;
2232   }
2233   
2234 inline static int simcall_BODY_file_close(smx_file_t fd, sg_host_t host) {
2235     smx_process_t self = SIMIX_process_self();
2236
2237     /* Go to that function to follow the code flow through the simcall barrier */
2238     if (0) simcall_HANDLER_file_close(&self->simcall, fd, host);
2239     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
2240
2241     self->simcall.call = SIMCALL_FILE_CLOSE;
2242     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
2243     memset(self->simcall.args, 0, sizeof(self->simcall.args));
2244     self->simcall.args[0].dp = (void*) fd;
2245     self->simcall.args[1].dp = (void*) host;
2246     if (self != simix_global->maestro_process) {
2247       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
2248                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
2249       SIMIX_process_yield(self);
2250     } else {
2251       SIMIX_simcall_handle(&self->simcall, 0);
2252     }    
2253     return (int) self->simcall.result.i;
2254   }
2255   
2256 inline static int simcall_BODY_file_unlink(smx_file_t fd, sg_host_t host) {
2257     smx_process_t self = SIMIX_process_self();
2258
2259     /* Go to that function to follow the code flow through the simcall barrier */
2260     if (0) SIMIX_file_unlink(fd, host);
2261     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
2262
2263     self->simcall.call = SIMCALL_FILE_UNLINK;
2264     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
2265     memset(self->simcall.args, 0, sizeof(self->simcall.args));
2266     self->simcall.args[0].dp = (void*) fd;
2267     self->simcall.args[1].dp = (void*) host;
2268     if (self != simix_global->maestro_process) {
2269       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
2270                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
2271       SIMIX_process_yield(self);
2272     } else {
2273       SIMIX_simcall_handle(&self->simcall, 0);
2274     }    
2275     return (int) self->simcall.result.i;
2276   }
2277   
2278 inline static sg_size_t simcall_BODY_file_get_size(smx_file_t fd) {
2279     smx_process_t self = SIMIX_process_self();
2280
2281     /* Go to that function to follow the code flow through the simcall barrier */
2282     if (0) simcall_HANDLER_file_get_size(&self->simcall, fd);
2283     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
2284
2285     self->simcall.call = SIMCALL_FILE_GET_SIZE;
2286     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
2287     memset(self->simcall.args, 0, sizeof(self->simcall.args));
2288     self->simcall.args[0].dp = (void*) fd;
2289     if (self != simix_global->maestro_process) {
2290       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
2291                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
2292       SIMIX_process_yield(self);
2293     } else {
2294       SIMIX_simcall_handle(&self->simcall, 0);
2295     }    
2296     return (sg_size_t) self->simcall.result.sgsz;
2297   }
2298   
2299 inline static sg_size_t simcall_BODY_file_tell(smx_file_t fd) {
2300     smx_process_t self = SIMIX_process_self();
2301
2302     /* Go to that function to follow the code flow through the simcall barrier */
2303     if (0) simcall_HANDLER_file_tell(&self->simcall, fd);
2304     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
2305
2306     self->simcall.call = SIMCALL_FILE_TELL;
2307     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
2308     memset(self->simcall.args, 0, sizeof(self->simcall.args));
2309     self->simcall.args[0].dp = (void*) fd;
2310     if (self != simix_global->maestro_process) {
2311       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
2312                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
2313       SIMIX_process_yield(self);
2314     } else {
2315       SIMIX_simcall_handle(&self->simcall, 0);
2316     }    
2317     return (sg_size_t) self->simcall.result.sgsz;
2318   }
2319   
2320 inline static int simcall_BODY_file_seek(smx_file_t fd, sg_offset_t offset, int origin) {
2321     smx_process_t self = SIMIX_process_self();
2322
2323     /* Go to that function to follow the code flow through the simcall barrier */
2324     if (0) simcall_HANDLER_file_seek(&self->simcall, fd, offset, origin);
2325     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
2326
2327     self->simcall.call = SIMCALL_FILE_SEEK;
2328     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
2329     memset(self->simcall.args, 0, sizeof(self->simcall.args));
2330     self->simcall.args[0].dp = (void*) fd;
2331     self->simcall.args[1].sgoff = (sg_offset_t) offset;
2332     self->simcall.args[2].i = (int) origin;
2333     if (self != simix_global->maestro_process) {
2334       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
2335                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
2336       SIMIX_process_yield(self);
2337     } else {
2338       SIMIX_simcall_handle(&self->simcall, 0);
2339     }    
2340     return (int) self->simcall.result.i;
2341   }
2342   
2343 inline static xbt_dynar_t simcall_BODY_file_get_info(smx_file_t fd) {
2344     smx_process_t self = SIMIX_process_self();
2345
2346     /* Go to that function to follow the code flow through the simcall barrier */
2347     if (0) simcall_HANDLER_file_get_info(&self->simcall, fd);
2348     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
2349
2350     self->simcall.call = SIMCALL_FILE_GET_INFO;
2351     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
2352     memset(self->simcall.args, 0, sizeof(self->simcall.args));
2353     self->simcall.args[0].dp = (void*) fd;
2354     if (self != simix_global->maestro_process) {
2355       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
2356                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
2357       SIMIX_process_yield(self);
2358     } else {
2359       SIMIX_simcall_handle(&self->simcall, 0);
2360     }    
2361     return (xbt_dynar_t) self->simcall.result.dp;
2362   }
2363   
2364 inline static int simcall_BODY_file_move(smx_file_t fd, const char* fullpath) {
2365     smx_process_t self = SIMIX_process_self();
2366
2367     /* Go to that function to follow the code flow through the simcall barrier */
2368     if (0) simcall_HANDLER_file_move(&self->simcall, fd, fullpath);
2369     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
2370
2371     self->simcall.call = SIMCALL_FILE_MOVE;
2372     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
2373     memset(self->simcall.args, 0, sizeof(self->simcall.args));
2374     self->simcall.args[0].dp = (void*) fd;
2375     self->simcall.args[1].cc = (const char*) fullpath;
2376     if (self != simix_global->maestro_process) {
2377       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
2378                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
2379       SIMIX_process_yield(self);
2380     } else {
2381       SIMIX_simcall_handle(&self->simcall, 0);
2382     }    
2383     return (int) self->simcall.result.i;
2384   }
2385   
2386 inline static sg_size_t simcall_BODY_storage_get_free_size(smx_storage_t storage) {
2387     smx_process_t self = SIMIX_process_self();
2388
2389     /* Go to that function to follow the code flow through the simcall barrier */
2390     if (0) simcall_HANDLER_storage_get_free_size(&self->simcall, storage);
2391     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
2392
2393     self->simcall.call = SIMCALL_STORAGE_GET_FREE_SIZE;
2394     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
2395     memset(self->simcall.args, 0, sizeof(self->simcall.args));
2396     self->simcall.args[0].dp = (void*) storage;
2397     if (self != simix_global->maestro_process) {
2398       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
2399                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
2400       SIMIX_process_yield(self);
2401     } else {
2402       SIMIX_simcall_handle(&self->simcall, 0);
2403     }    
2404     return (sg_size_t) self->simcall.result.sgsz;
2405   }
2406   
2407 inline static sg_size_t simcall_BODY_storage_get_used_size(smx_storage_t name) {
2408     smx_process_t self = SIMIX_process_self();
2409
2410     /* Go to that function to follow the code flow through the simcall barrier */
2411     if (0) simcall_HANDLER_storage_get_used_size(&self->simcall, name);
2412     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
2413
2414     self->simcall.call = SIMCALL_STORAGE_GET_USED_SIZE;
2415     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
2416     memset(self->simcall.args, 0, sizeof(self->simcall.args));
2417     self->simcall.args[0].dp = (void*) name;
2418     if (self != simix_global->maestro_process) {
2419       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
2420                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
2421       SIMIX_process_yield(self);
2422     } else {
2423       SIMIX_simcall_handle(&self->simcall, 0);
2424     }    
2425     return (sg_size_t) self->simcall.result.sgsz;
2426   }
2427   
2428 inline static xbt_dict_t simcall_BODY_storage_get_properties(smx_storage_t storage) {
2429     smx_process_t self = SIMIX_process_self();
2430
2431     /* Go to that function to follow the code flow through the simcall barrier */
2432     if (0) SIMIX_storage_get_properties(storage);
2433     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
2434
2435     self->simcall.call = SIMCALL_STORAGE_GET_PROPERTIES;
2436     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
2437     memset(self->simcall.args, 0, sizeof(self->simcall.args));
2438     self->simcall.args[0].dp = (void*) storage;
2439     if (self != simix_global->maestro_process) {
2440       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
2441                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
2442       SIMIX_process_yield(self);
2443     } else {
2444       SIMIX_simcall_handle(&self->simcall, 0);
2445     }    
2446     return (xbt_dict_t) self->simcall.result.dp;
2447   }
2448   
2449 inline static xbt_dict_t simcall_BODY_storage_get_content(smx_storage_t storage) {
2450     smx_process_t self = SIMIX_process_self();
2451
2452     /* Go to that function to follow the code flow through the simcall barrier */
2453     if (0) SIMIX_storage_get_content(storage);
2454     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
2455
2456     self->simcall.call = SIMCALL_STORAGE_GET_CONTENT;
2457     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
2458     memset(self->simcall.args, 0, sizeof(self->simcall.args));
2459     self->simcall.args[0].dp = (void*) storage;
2460     if (self != simix_global->maestro_process) {
2461       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
2462                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
2463       SIMIX_process_yield(self);
2464     } else {
2465       SIMIX_simcall_handle(&self->simcall, 0);
2466     }    
2467     return (xbt_dict_t) self->simcall.result.dp;
2468   }
2469   
2470 inline static xbt_dict_t simcall_BODY_asr_get_properties(const char* name) {
2471     smx_process_t self = SIMIX_process_self();
2472
2473     /* Go to that function to follow the code flow through the simcall barrier */
2474     if (0) simcall_HANDLER_asr_get_properties(&self->simcall, name);
2475     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
2476
2477     self->simcall.call = SIMCALL_ASR_GET_PROPERTIES;
2478     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
2479     memset(self->simcall.args, 0, sizeof(self->simcall.args));
2480     self->simcall.args[0].cc = (const char*) name;
2481     if (self != simix_global->maestro_process) {
2482       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
2483                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
2484       SIMIX_process_yield(self);
2485     } else {
2486       SIMIX_simcall_handle(&self->simcall, 0);
2487     }    
2488     return (xbt_dict_t) self->simcall.result.dp;
2489   }
2490   
2491 inline static int simcall_BODY_mc_random(int min, int max) {
2492     smx_process_t self = SIMIX_process_self();
2493
2494     /* Go to that function to follow the code flow through the simcall barrier */
2495     if (0) simcall_HANDLER_mc_random(&self->simcall, min, max);
2496     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
2497
2498     self->simcall.call = SIMCALL_MC_RANDOM;
2499     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
2500     memset(self->simcall.args, 0, sizeof(self->simcall.args));
2501     self->simcall.args[0].i = (int) min;
2502     self->simcall.args[1].i = (int) max;
2503     if (self != simix_global->maestro_process) {
2504       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
2505                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
2506       SIMIX_process_yield(self);
2507     } else {
2508       SIMIX_simcall_handle(&self->simcall, 0);
2509     }    
2510     return (int) self->simcall.result.i;
2511   }
2512   
2513 inline static void simcall_BODY_set_category(smx_synchro_t synchro, const char* category) {
2514     smx_process_t self = SIMIX_process_self();
2515
2516     /* Go to that function to follow the code flow through the simcall barrier */
2517     if (0) SIMIX_set_category(synchro, category);
2518     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
2519
2520     self->simcall.call = SIMCALL_SET_CATEGORY;
2521     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
2522     memset(self->simcall.args, 0, sizeof(self->simcall.args));
2523     self->simcall.args[0].dp = (void*) synchro;
2524     self->simcall.args[1].cc = (const char*) category;
2525     if (self != simix_global->maestro_process) {
2526       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
2527                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
2528       SIMIX_process_yield(self);
2529     } else {
2530       SIMIX_simcall_handle(&self->simcall, 0);
2531     }    
2532     
2533   }
2534   
2535 inline static void simcall_BODY_run_kernel(void* code) {
2536     smx_process_t self = SIMIX_process_self();
2537
2538     /* Go to that function to follow the code flow through the simcall barrier */
2539     if (0) SIMIX_run_kernel(code);
2540     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
2541
2542     self->simcall.call = SIMCALL_RUN_KERNEL;
2543     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
2544     memset(self->simcall.args, 0, sizeof(self->simcall.args));
2545     self->simcall.args[0].dp = (void*) code;
2546     if (self != simix_global->maestro_process) {
2547       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
2548                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
2549       SIMIX_process_yield(self);
2550     } else {
2551       SIMIX_simcall_handle(&self->simcall, 0);
2552     }    
2553     
2554   }
2555 #ifdef HAVE_LATENCY_BOUND_TRACKING
2556   
2557 inline static int simcall_BODY_comm_is_latency_bounded(smx_synchro_t comm) {
2558     smx_process_t self = SIMIX_process_self();
2559
2560     /* Go to that function to follow the code flow through the simcall barrier */
2561     if (0) SIMIX_comm_is_latency_bounded(comm);
2562     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
2563
2564     self->simcall.call = SIMCALL_COMM_IS_LATENCY_BOUNDED;
2565     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
2566     memset(self->simcall.args, 0, sizeof(self->simcall.args));
2567     self->simcall.args[0].dp = (void*) comm;
2568     if (self != simix_global->maestro_process) {
2569       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
2570                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
2571       SIMIX_process_yield(self);
2572     } else {
2573       SIMIX_simcall_handle(&self->simcall, 0);
2574     }    
2575     return (int) self->simcall.result.i;
2576   }
2577 #endif
2578
2579 #ifdef HAVE_MC
2580   
2581 inline static mc_snapshot_t simcall_BODY_mc_snapshot() {
2582     smx_process_t self = SIMIX_process_self();
2583
2584     /* Go to that function to follow the code flow through the simcall barrier */
2585     if (0) simcall_HANDLER_mc_snapshot(&self->simcall);
2586     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
2587
2588     self->simcall.call = SIMCALL_MC_SNAPSHOT;
2589     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
2590     memset(self->simcall.args, 0, sizeof(self->simcall.args));
2591
2592     if (self != simix_global->maestro_process) {
2593       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
2594                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
2595       SIMIX_process_yield(self);
2596     } else {
2597       SIMIX_simcall_handle(&self->simcall, 0);
2598     }    
2599     return (mc_snapshot_t) self->simcall.result.dp;
2600   }
2601   
2602 inline static int simcall_BODY_mc_compare_snapshots(mc_snapshot_t s1, mc_snapshot_t s2) {
2603     smx_process_t self = SIMIX_process_self();
2604
2605     /* Go to that function to follow the code flow through the simcall barrier */
2606     if (0) simcall_HANDLER_mc_compare_snapshots(&self->simcall, s1, s2);
2607     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
2608
2609     self->simcall.call = SIMCALL_MC_COMPARE_SNAPSHOTS;
2610     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
2611     memset(self->simcall.args, 0, sizeof(self->simcall.args));
2612     self->simcall.args[0].dp = (void*) s1;
2613     self->simcall.args[1].dp = (void*) s2;
2614     if (self != simix_global->maestro_process) {
2615       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
2616                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
2617       SIMIX_process_yield(self);
2618     } else {
2619       SIMIX_simcall_handle(&self->simcall, 0);
2620     }    
2621     return (int) self->simcall.result.i;
2622   }
2623 #endif