Logo AND Algorithmique Numérique Distribuée

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