Logo AND Algorithmique Numérique Distribuée

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