Logo AND Algorithmique Numérique Distribuée

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