Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
SIMIX_comm_get_remains() -> simgrid::simix::Comm::remains()
[simgrid.git] / src / simix / popping_bodies.cpp
1 /**********************************************************************/
2 /* File generated by src/simix/simcalls.py from src/simix/simcalls.in */
3 /*                                                                    */
4 /*                    DO NOT EVER CHANGE THIS FILE                    */
5 /*                                                                    */
6 /* change simcalls specification in src/simix/simcalls.in             */
7 /**********************************************************************/
8
9 /*
10  * Note that the name comes from http://en.wikipedia.org/wiki/Popping
11  * Indeed, the control flow is doing a strange dance in there.
12  *
13  * That's not about http://en.wikipedia.org/wiki/Poop, despite the odor :)
14  */
15
16 #include "smx_private.h"
17 #include "src/mc/mc_forward.hpp"
18 #include "xbt/ex.h"
19 #include <simgrid/simix.hpp>
20   
21 inline static void simcall_BODY_vm_suspend(sg_host_t ind_vm) {
22     smx_process_t self = SIMIX_process_self();
23
24     /* Go to that function to follow the code flow through the simcall barrier */
25     if (0) simcall_HANDLER_vm_suspend(&self->simcall, ind_vm);
26     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
27
28     self->simcall.call = SIMCALL_VM_SUSPEND;
29     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
30     memset(self->simcall.args, 0, sizeof(self->simcall.args));
31     self->simcall.args[0].dp = (void*) ind_vm;
32     if (self != simix_global->maestro_process) {
33       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
34                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
35       SIMIX_process_yield(self);
36     } else {
37       SIMIX_simcall_handle(&self->simcall, 0);
38     }    
39     
40   }
41   
42 inline static void simcall_BODY_vm_resume(sg_host_t ind_vm) {
43     smx_process_t self = SIMIX_process_self();
44
45     /* Go to that function to follow the code flow through the simcall barrier */
46     if (0) simcall_HANDLER_vm_resume(&self->simcall, ind_vm);
47     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
48
49     self->simcall.call = SIMCALL_VM_RESUME;
50     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
51     memset(self->simcall.args, 0, sizeof(self->simcall.args));
52     self->simcall.args[0].dp = (void*) ind_vm;
53     if (self != simix_global->maestro_process) {
54       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
55                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
56       SIMIX_process_yield(self);
57     } else {
58       SIMIX_simcall_handle(&self->simcall, 0);
59     }    
60     
61   }
62   
63 inline static void simcall_BODY_vm_shutdown(sg_host_t ind_vm) {
64     smx_process_t self = SIMIX_process_self();
65
66     /* Go to that function to follow the code flow through the simcall barrier */
67     if (0) simcall_HANDLER_vm_shutdown(&self->simcall, ind_vm);
68     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
69
70     self->simcall.call = SIMCALL_VM_SHUTDOWN;
71     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
72     memset(self->simcall.args, 0, sizeof(self->simcall.args));
73     self->simcall.args[0].dp = (void*) ind_vm;
74     if (self != simix_global->maestro_process) {
75       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
76                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
77       SIMIX_process_yield(self);
78     } else {
79       SIMIX_simcall_handle(&self->simcall, 0);
80     }    
81     
82   }
83   
84 inline static void simcall_BODY_vm_save(sg_host_t ind_vm) {
85     smx_process_t self = SIMIX_process_self();
86
87     /* Go to that function to follow the code flow through the simcall barrier */
88     if (0) simcall_HANDLER_vm_save(&self->simcall, ind_vm);
89     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
90
91     self->simcall.call = SIMCALL_VM_SAVE;
92     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
93     memset(self->simcall.args, 0, sizeof(self->simcall.args));
94     self->simcall.args[0].dp = (void*) ind_vm;
95     if (self != simix_global->maestro_process) {
96       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
97                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
98       SIMIX_process_yield(self);
99     } else {
100       SIMIX_simcall_handle(&self->simcall, 0);
101     }    
102     
103   }
104   
105 inline static void simcall_BODY_vm_restore(sg_host_t ind_vm) {
106     smx_process_t self = SIMIX_process_self();
107
108     /* Go to that function to follow the code flow through the simcall barrier */
109     if (0) simcall_HANDLER_vm_restore(&self->simcall, ind_vm);
110     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
111
112     self->simcall.call = SIMCALL_VM_RESTORE;
113     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
114     memset(self->simcall.args, 0, sizeof(self->simcall.args));
115     self->simcall.args[0].dp = (void*) ind_vm;
116     if (self != simix_global->maestro_process) {
117       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
118                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
119       SIMIX_process_yield(self);
120     } else {
121       SIMIX_simcall_handle(&self->simcall, 0);
122     }    
123     
124   }
125   
126 inline static void* simcall_BODY_process_create(const char* name, xbt_main_func_t code, void* data, const char* hostname, double kill_time, int argc, char** argv, xbt_dict_t properties, int auto_restart) {
127     smx_process_t self = SIMIX_process_self();
128
129     /* Go to that function to follow the code flow through the simcall barrier */
130     if (0) simcall_HANDLER_process_create(&self->simcall, name, code, data, hostname, kill_time, argc, argv, properties, auto_restart);
131     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
132
133     self->simcall.call = SIMCALL_PROCESS_CREATE;
134     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
135     memset(self->simcall.args, 0, sizeof(self->simcall.args));
136     self->simcall.args[0].cc = (const char*) name;
137     self->simcall.args[1].fp = (FPtr) code;
138     self->simcall.args[2].dp = (void*) data;
139     self->simcall.args[3].cc = (const char*) hostname;
140     self->simcall.args[4].d = (double) kill_time;
141     self->simcall.args[5].i = (int) argc;
142     self->simcall.args[6].dp = (void*) argv;
143     self->simcall.args[7].dp = (void*) properties;
144     self->simcall.args[8].i = (int) auto_restart;
145     if (self != simix_global->maestro_process) {
146       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
147                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
148       SIMIX_process_yield(self);
149     } else {
150       SIMIX_simcall_handle(&self->simcall, 0);
151     }    
152     return (void*) self->simcall.result.dp;
153   }
154   
155 inline static void simcall_BODY_process_kill(smx_process_t process) {
156     smx_process_t self = SIMIX_process_self();
157
158     /* Go to that function to follow the code flow through the simcall barrier */
159     if (0) simcall_HANDLER_process_kill(&self->simcall, process);
160     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
161
162     self->simcall.call = SIMCALL_PROCESS_KILL;
163     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
164     memset(self->simcall.args, 0, sizeof(self->simcall.args));
165     self->simcall.args[0].dp = (void*) process;
166     if (self != simix_global->maestro_process) {
167       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
168                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
169       SIMIX_process_yield(self);
170     } else {
171       SIMIX_simcall_handle(&self->simcall, 0);
172     }    
173     
174   }
175   
176 inline static void simcall_BODY_process_killall(int reset_pid) {
177     smx_process_t self = SIMIX_process_self();
178
179     /* Go to that function to follow the code flow through the simcall barrier */
180     if (0) simcall_HANDLER_process_killall(&self->simcall, reset_pid);
181     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
182
183     self->simcall.call = SIMCALL_PROCESS_KILLALL;
184     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
185     memset(self->simcall.args, 0, sizeof(self->simcall.args));
186     self->simcall.args[0].i = (int) reset_pid;
187     if (self != simix_global->maestro_process) {
188       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
189                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
190       SIMIX_process_yield(self);
191     } else {
192       SIMIX_simcall_handle(&self->simcall, 0);
193     }    
194     
195   }
196   
197 inline static void simcall_BODY_process_cleanup(smx_process_t process) {
198     smx_process_t self = SIMIX_process_self();
199
200     /* Go to that function to follow the code flow through the simcall barrier */
201     if (0) SIMIX_process_cleanup(process);
202     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
203
204     self->simcall.call = SIMCALL_PROCESS_CLEANUP;
205     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
206     memset(self->simcall.args, 0, sizeof(self->simcall.args));
207     self->simcall.args[0].dp = (void*) process;
208     if (self != simix_global->maestro_process) {
209       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
210                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
211       SIMIX_process_yield(self);
212     } else {
213       SIMIX_simcall_handle(&self->simcall, 0);
214     }    
215     
216   }
217   
218 inline static void simcall_BODY_process_suspend(smx_process_t process) {
219     smx_process_t self = SIMIX_process_self();
220
221     /* Go to that function to follow the code flow through the simcall barrier */
222     if (0) simcall_HANDLER_process_suspend(&self->simcall, process);
223     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
224
225     self->simcall.call = SIMCALL_PROCESS_SUSPEND;
226     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
227     memset(self->simcall.args, 0, sizeof(self->simcall.args));
228     self->simcall.args[0].dp = (void*) process;
229     if (self != simix_global->maestro_process) {
230       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
231                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
232       SIMIX_process_yield(self);
233     } else {
234       SIMIX_simcall_handle(&self->simcall, 0);
235     }    
236     
237   }
238   
239 inline static void simcall_BODY_process_resume(smx_process_t process) {
240     smx_process_t self = SIMIX_process_self();
241
242     /* Go to that function to follow the code flow through the simcall barrier */
243     if (0) simcall_HANDLER_process_resume(&self->simcall, process);
244     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
245
246     self->simcall.call = SIMCALL_PROCESS_RESUME;
247     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
248     memset(self->simcall.args, 0, sizeof(self->simcall.args));
249     self->simcall.args[0].dp = (void*) process;
250     if (self != simix_global->maestro_process) {
251       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
252                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
253       SIMIX_process_yield(self);
254     } else {
255       SIMIX_simcall_handle(&self->simcall, 0);
256     }    
257     
258   }
259   
260 inline static void simcall_BODY_process_set_host(smx_process_t process, sg_host_t dest) {
261     smx_process_t self = SIMIX_process_self();
262
263     /* Go to that function to follow the code flow through the simcall barrier */
264     if (0) simcall_HANDLER_process_set_host(&self->simcall, process, dest);
265     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
266
267     self->simcall.call = SIMCALL_PROCESS_SET_HOST;
268     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
269     memset(self->simcall.args, 0, sizeof(self->simcall.args));
270     self->simcall.args[0].dp = (void*) process;
271     self->simcall.args[1].dp = (void*) dest;
272     if (self != simix_global->maestro_process) {
273       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
274                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
275       SIMIX_process_yield(self);
276     } else {
277       SIMIX_simcall_handle(&self->simcall, 0);
278     }    
279     
280   }
281   
282 inline static int simcall_BODY_process_is_suspended(smx_process_t process) {
283     smx_process_t self = SIMIX_process_self();
284
285     /* Go to that function to follow the code flow through the simcall barrier */
286     if (0) SIMIX_process_is_suspended(process);
287     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
288
289     self->simcall.call = SIMCALL_PROCESS_IS_SUSPENDED;
290     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
291     memset(self->simcall.args, 0, sizeof(self->simcall.args));
292     self->simcall.args[0].dp = (void*) process;
293     if (self != simix_global->maestro_process) {
294       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
295                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
296       SIMIX_process_yield(self);
297     } else {
298       SIMIX_simcall_handle(&self->simcall, 0);
299     }    
300     return (int) self->simcall.result.i;
301   }
302   
303 inline static int simcall_BODY_process_join(smx_process_t process, double timeout) {
304     smx_process_t self = SIMIX_process_self();
305
306     /* Go to that function to follow the code flow through the simcall barrier */
307     if (0) simcall_HANDLER_process_join(&self->simcall, process, timeout);
308     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
309
310     self->simcall.call = SIMCALL_PROCESS_JOIN;
311     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
312     memset(self->simcall.args, 0, sizeof(self->simcall.args));
313     self->simcall.args[0].dp = (void*) process;
314     self->simcall.args[1].d = (double) timeout;
315     if (self != simix_global->maestro_process) {
316       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
317                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
318       SIMIX_process_yield(self);
319     } else {
320       SIMIX_simcall_handle(&self->simcall, 0);
321     }    
322     return (int) self->simcall.result.i;
323   }
324   
325 inline static int simcall_BODY_process_sleep(double duration) {
326     smx_process_t self = SIMIX_process_self();
327
328     /* Go to that function to follow the code flow through the simcall barrier */
329     if (0) simcall_HANDLER_process_sleep(&self->simcall, duration);
330     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
331
332     self->simcall.call = SIMCALL_PROCESS_SLEEP;
333     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
334     memset(self->simcall.args, 0, sizeof(self->simcall.args));
335     self->simcall.args[0].d = (double) duration;
336     if (self != simix_global->maestro_process) {
337       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
338                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
339       SIMIX_process_yield(self);
340     } else {
341       SIMIX_simcall_handle(&self->simcall, 0);
342     }    
343     return (int) self->simcall.result.i;
344   }
345   
346 inline static smx_synchro_t simcall_BODY_execution_start(const char* name, double flops_amount, double priority, double bound, unsigned long affinity_mask) {
347     smx_process_t self = SIMIX_process_self();
348
349     /* Go to that function to follow the code flow through the simcall barrier */
350     if (0) simcall_HANDLER_execution_start(&self->simcall, name, flops_amount, priority, bound, affinity_mask);
351     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
352
353     self->simcall.call = SIMCALL_EXECUTION_START;
354     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
355     memset(self->simcall.args, 0, sizeof(self->simcall.args));
356     self->simcall.args[0].cc = (const char*) name;
357     self->simcall.args[1].d = (double) flops_amount;
358     self->simcall.args[2].d = (double) priority;
359     self->simcall.args[3].d = (double) bound;
360     self->simcall.args[4].ul = (unsigned long) affinity_mask;
361     if (self != simix_global->maestro_process) {
362       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
363                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
364       SIMIX_process_yield(self);
365     } else {
366       SIMIX_simcall_handle(&self->simcall, 0);
367     }    
368     return (smx_synchro_t) self->simcall.result.dp;
369   }
370   
371 inline static smx_synchro_t simcall_BODY_execution_parallel_start(const char* name, int host_nb, sg_host_t* host_list, double* flops_amount, double* bytes_amount, double amount, double rate) {
372     smx_process_t self = SIMIX_process_self();
373
374     /* Go to that function to follow the code flow through the simcall barrier */
375     if (0) SIMIX_execution_parallel_start(name, host_nb, host_list, flops_amount, bytes_amount, amount, rate);
376     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
377
378     self->simcall.call = SIMCALL_EXECUTION_PARALLEL_START;
379     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
380     memset(self->simcall.args, 0, sizeof(self->simcall.args));
381     self->simcall.args[0].cc = (const char*) name;
382     self->simcall.args[1].i = (int) host_nb;
383     self->simcall.args[2].dp = (void*) host_list;
384     self->simcall.args[3].dp = (void*) flops_amount;
385     self->simcall.args[4].dp = (void*) bytes_amount;
386     self->simcall.args[5].d = (double) amount;
387     self->simcall.args[6].d = (double) rate;
388     if (self != simix_global->maestro_process) {
389       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
390                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
391       SIMIX_process_yield(self);
392     } else {
393       SIMIX_simcall_handle(&self->simcall, 0);
394     }    
395     return (smx_synchro_t) self->simcall.result.dp;
396   }
397   
398 inline static void simcall_BODY_execution_destroy(smx_synchro_t execution) {
399     smx_process_t self = SIMIX_process_self();
400
401     /* Go to that function to follow the code flow through the simcall barrier */
402     if (0) SIMIX_execution_destroy(execution);
403     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
404
405     self->simcall.call = SIMCALL_EXECUTION_DESTROY;
406     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
407     memset(self->simcall.args, 0, sizeof(self->simcall.args));
408     self->simcall.args[0].dp = (void*) execution;
409     if (self != simix_global->maestro_process) {
410       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
411                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
412       SIMIX_process_yield(self);
413     } else {
414       SIMIX_simcall_handle(&self->simcall, 0);
415     }    
416     
417   }
418   
419 inline static void simcall_BODY_execution_cancel(smx_synchro_t execution) {
420     smx_process_t self = SIMIX_process_self();
421
422     /* Go to that function to follow the code flow through the simcall barrier */
423     if (0) SIMIX_execution_cancel(execution);
424     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
425
426     self->simcall.call = SIMCALL_EXECUTION_CANCEL;
427     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
428     memset(self->simcall.args, 0, sizeof(self->simcall.args));
429     self->simcall.args[0].dp = (void*) execution;
430     if (self != simix_global->maestro_process) {
431       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
432                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
433       SIMIX_process_yield(self);
434     } else {
435       SIMIX_simcall_handle(&self->simcall, 0);
436     }    
437     
438   }
439   
440 inline static double simcall_BODY_execution_get_remains(smx_synchro_t execution) {
441     smx_process_t self = SIMIX_process_self();
442
443     /* Go to that function to follow the code flow through the simcall barrier */
444     if (0) SIMIX_execution_get_remains(execution);
445     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
446
447     self->simcall.call = SIMCALL_EXECUTION_GET_REMAINS;
448     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
449     memset(self->simcall.args, 0, sizeof(self->simcall.args));
450     self->simcall.args[0].dp = (void*) execution;
451     if (self != simix_global->maestro_process) {
452       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
453                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
454       SIMIX_process_yield(self);
455     } else {
456       SIMIX_simcall_handle(&self->simcall, 0);
457     }    
458     return (double) self->simcall.result.d;
459   }
460   
461 inline static e_smx_state_t simcall_BODY_execution_get_state(smx_synchro_t execution) {
462     smx_process_t self = SIMIX_process_self();
463
464     /* Go to that function to follow the code flow through the simcall barrier */
465     if (0) SIMIX_execution_get_state(execution);
466     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
467
468     self->simcall.call = SIMCALL_EXECUTION_GET_STATE;
469     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
470     memset(self->simcall.args, 0, sizeof(self->simcall.args));
471     self->simcall.args[0].dp = (void*) execution;
472     if (self != simix_global->maestro_process) {
473       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
474                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
475       SIMIX_process_yield(self);
476     } else {
477       SIMIX_simcall_handle(&self->simcall, 0);
478     }    
479     return (e_smx_state_t) self->simcall.result.i;
480   }
481   
482 inline static void simcall_BODY_execution_set_priority(smx_synchro_t execution, double priority) {
483     smx_process_t self = SIMIX_process_self();
484
485     /* Go to that function to follow the code flow through the simcall barrier */
486     if (0) SIMIX_execution_set_priority(execution, priority);
487     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
488
489     self->simcall.call = SIMCALL_EXECUTION_SET_PRIORITY;
490     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
491     memset(self->simcall.args, 0, sizeof(self->simcall.args));
492     self->simcall.args[0].dp = (void*) execution;
493     self->simcall.args[1].d = (double) priority;
494     if (self != simix_global->maestro_process) {
495       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
496                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
497       SIMIX_process_yield(self);
498     } else {
499       SIMIX_simcall_handle(&self->simcall, 0);
500     }    
501     
502   }
503   
504 inline static void simcall_BODY_execution_set_bound(smx_synchro_t execution, double bound) {
505     smx_process_t self = SIMIX_process_self();
506
507     /* Go to that function to follow the code flow through the simcall barrier */
508     if (0) SIMIX_execution_set_bound(execution, bound);
509     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
510
511     self->simcall.call = SIMCALL_EXECUTION_SET_BOUND;
512     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
513     memset(self->simcall.args, 0, sizeof(self->simcall.args));
514     self->simcall.args[0].dp = (void*) execution;
515     self->simcall.args[1].d = (double) bound;
516     if (self != simix_global->maestro_process) {
517       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
518                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
519       SIMIX_process_yield(self);
520     } else {
521       SIMIX_simcall_handle(&self->simcall, 0);
522     }    
523     
524   }
525   
526 inline static void simcall_BODY_execution_set_affinity(smx_synchro_t execution, sg_host_t ws, unsigned long mask) {
527     smx_process_t self = SIMIX_process_self();
528
529     /* Go to that function to follow the code flow through the simcall barrier */
530     if (0) SIMIX_execution_set_affinity(execution, ws, mask);
531     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
532
533     self->simcall.call = SIMCALL_EXECUTION_SET_AFFINITY;
534     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
535     memset(self->simcall.args, 0, sizeof(self->simcall.args));
536     self->simcall.args[0].dp = (void*) execution;
537     self->simcall.args[1].dp = (void*) ws;
538     self->simcall.args[2].ul = (unsigned long) mask;
539     if (self != simix_global->maestro_process) {
540       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
541                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
542       SIMIX_process_yield(self);
543     } else {
544       SIMIX_simcall_handle(&self->simcall, 0);
545     }    
546     
547   }
548   
549 inline static int simcall_BODY_execution_wait(smx_synchro_t execution) {
550     smx_process_t self = SIMIX_process_self();
551
552     /* Go to that function to follow the code flow through the simcall barrier */
553     if (0) simcall_HANDLER_execution_wait(&self->simcall, execution);
554     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
555
556     self->simcall.call = SIMCALL_EXECUTION_WAIT;
557     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
558     memset(self->simcall.args, 0, sizeof(self->simcall.args));
559     self->simcall.args[0].dp = (void*) execution;
560     if (self != simix_global->maestro_process) {
561       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
562                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
563       SIMIX_process_yield(self);
564     } else {
565       SIMIX_simcall_handle(&self->simcall, 0);
566     }    
567     return (int) self->simcall.result.i;
568   }
569   
570 inline static void simcall_BODY_process_on_exit(smx_process_t process, int_f_pvoid_pvoid_t fun, void* data) {
571     smx_process_t self = SIMIX_process_self();
572
573     /* Go to that function to follow the code flow through the simcall barrier */
574     if (0) SIMIX_process_on_exit(process, fun, data);
575     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
576
577     self->simcall.call = SIMCALL_PROCESS_ON_EXIT;
578     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
579     memset(self->simcall.args, 0, sizeof(self->simcall.args));
580     self->simcall.args[0].dp = (void*) process;
581     self->simcall.args[1].fp = (FPtr) fun;
582     self->simcall.args[2].dp = (void*) data;
583     if (self != simix_global->maestro_process) {
584       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
585                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
586       SIMIX_process_yield(self);
587     } else {
588       SIMIX_simcall_handle(&self->simcall, 0);
589     }    
590     
591   }
592   
593 inline static void simcall_BODY_process_auto_restart_set(smx_process_t process, int auto_restart) {
594     smx_process_t self = SIMIX_process_self();
595
596     /* Go to that function to follow the code flow through the simcall barrier */
597     if (0) SIMIX_process_auto_restart_set(process, auto_restart);
598     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
599
600     self->simcall.call = SIMCALL_PROCESS_AUTO_RESTART_SET;
601     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
602     memset(self->simcall.args, 0, sizeof(self->simcall.args));
603     self->simcall.args[0].dp = (void*) process;
604     self->simcall.args[1].i = (int) auto_restart;
605     if (self != simix_global->maestro_process) {
606       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
607                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
608       SIMIX_process_yield(self);
609     } else {
610       SIMIX_simcall_handle(&self->simcall, 0);
611     }    
612     
613   }
614   
615 inline static smx_process_t simcall_BODY_process_restart(smx_process_t process) {
616     smx_process_t self = SIMIX_process_self();
617
618     /* Go to that function to follow the code flow through the simcall barrier */
619     if (0) simcall_HANDLER_process_restart(&self->simcall, process);
620     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
621
622     self->simcall.call = SIMCALL_PROCESS_RESTART;
623     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
624     memset(self->simcall.args, 0, sizeof(self->simcall.args));
625     self->simcall.args[0].dp = (void*) process;
626     if (self != simix_global->maestro_process) {
627       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
628                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
629       SIMIX_process_yield(self);
630     } else {
631       SIMIX_simcall_handle(&self->simcall, 0);
632     }    
633     return (smx_process_t) self->simcall.result.dp;
634   }
635   
636 inline static smx_mailbox_t simcall_BODY_mbox_create(const char* name) {
637     smx_process_t self = SIMIX_process_self();
638
639     /* Go to that function to follow the code flow through the simcall barrier */
640     if (0) SIMIX_mbox_create(name);
641     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
642
643     self->simcall.call = SIMCALL_MBOX_CREATE;
644     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
645     memset(self->simcall.args, 0, sizeof(self->simcall.args));
646     self->simcall.args[0].cc = (const char*) name;
647     if (self != simix_global->maestro_process) {
648       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
649                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
650       SIMIX_process_yield(self);
651     } else {
652       SIMIX_simcall_handle(&self->simcall, 0);
653     }    
654     return (smx_mailbox_t) self->simcall.result.dp;
655   }
656   
657 inline static smx_synchro_t simcall_BODY_mbox_get_head(smx_mailbox_t mbox) {
658     smx_process_t self = SIMIX_process_self();
659
660     /* Go to that function to follow the code flow through the simcall barrier */
661     if (0) SIMIX_mbox_get_head(mbox);
662     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
663
664     self->simcall.call = SIMCALL_MBOX_GET_HEAD;
665     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
666     memset(self->simcall.args, 0, sizeof(self->simcall.args));
667     self->simcall.args[0].dp = (void*) mbox;
668     if (self != simix_global->maestro_process) {
669       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
670                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
671       SIMIX_process_yield(self);
672     } else {
673       SIMIX_simcall_handle(&self->simcall, 0);
674     }    
675     return (smx_synchro_t) self->simcall.result.dp;
676   }
677   
678 inline static void simcall_BODY_mbox_set_receiver(smx_mailbox_t mbox, smx_process_t receiver) {
679     smx_process_t self = SIMIX_process_self();
680
681     /* Go to that function to follow the code flow through the simcall barrier */
682     if (0) SIMIX_mbox_set_receiver(mbox, receiver);
683     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
684
685     self->simcall.call = SIMCALL_MBOX_SET_RECEIVER;
686     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
687     memset(self->simcall.args, 0, sizeof(self->simcall.args));
688     self->simcall.args[0].dp = (void*) mbox;
689     self->simcall.args[1].dp = (void*) receiver;
690     if (self != simix_global->maestro_process) {
691       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
692                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
693       SIMIX_process_yield(self);
694     } else {
695       SIMIX_simcall_handle(&self->simcall, 0);
696     }    
697     
698   }
699   
700 inline static smx_process_t simcall_BODY_mbox_get_receiver(smx_mailbox_t mbox) {
701     smx_process_t self = SIMIX_process_self();
702
703     /* Go to that function to follow the code flow through the simcall barrier */
704     if (0) SIMIX_mbox_get_receiver(mbox);
705     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
706
707     self->simcall.call = SIMCALL_MBOX_GET_RECEIVER;
708     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
709     memset(self->simcall.args, 0, sizeof(self->simcall.args));
710     self->simcall.args[0].dp = (void*) mbox;
711     if (self != simix_global->maestro_process) {
712       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
713                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
714       SIMIX_process_yield(self);
715     } else {
716       SIMIX_simcall_handle(&self->simcall, 0);
717     }    
718     return (smx_process_t) self->simcall.result.dp;
719   }
720   
721 inline static smx_synchro_t simcall_BODY_comm_iprobe(smx_mailbox_t mbox, int type, int src, int tag, simix_match_func_t match_fun, void* data) {
722     smx_process_t self = SIMIX_process_self();
723
724     /* Go to that function to follow the code flow through the simcall barrier */
725     if (0) simcall_HANDLER_comm_iprobe(&self->simcall, mbox, type, src, tag, match_fun, data);
726     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
727
728     self->simcall.call = SIMCALL_COMM_IPROBE;
729     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
730     memset(self->simcall.args, 0, sizeof(self->simcall.args));
731     self->simcall.args[0].dp = (void*) mbox;
732     self->simcall.args[1].i = (int) type;
733     self->simcall.args[2].i = (int) src;
734     self->simcall.args[3].i = (int) tag;
735     self->simcall.args[4].fp = (FPtr) match_fun;
736     self->simcall.args[5].dp = (void*) data;
737     if (self != simix_global->maestro_process) {
738       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
739                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
740       SIMIX_process_yield(self);
741     } else {
742       SIMIX_simcall_handle(&self->simcall, 0);
743     }    
744     return (smx_synchro_t) self->simcall.result.dp;
745   }
746   
747 inline static void simcall_BODY_comm_send(smx_process_t sender, smx_mailbox_t mbox, 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) {
748     smx_process_t self = SIMIX_process_self();
749
750     /* Go to that function to follow the code flow through the simcall barrier */
751     if (0) simcall_HANDLER_comm_send(&self->simcall, sender, mbox, task_size, rate, src_buff, src_buff_size, match_fun, copy_data_fun, data, timeout);
752     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
753
754     self->simcall.call = SIMCALL_COMM_SEND;
755     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
756     memset(self->simcall.args, 0, sizeof(self->simcall.args));
757     self->simcall.args[0].dp = (void*) sender;
758     self->simcall.args[1].dp = (void*) mbox;
759     self->simcall.args[2].d = (double) task_size;
760     self->simcall.args[3].d = (double) rate;
761     self->simcall.args[4].dp = (void*) src_buff;
762     self->simcall.args[5].sz = (size_t) src_buff_size;
763     self->simcall.args[6].fp = (FPtr) match_fun;
764     self->simcall.args[7].fp = (FPtr) copy_data_fun;
765     self->simcall.args[8].dp = (void*) data;
766     self->simcall.args[9].d = (double) timeout;
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 smx_synchro_t simcall_BODY_comm_isend(smx_process_t sender, smx_mailbox_t mbox, 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) {
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) simcall_HANDLER_comm_isend(&self->simcall, sender, mbox, task_size, rate, src_buff, src_buff_size, match_fun, clean_fun, copy_data_fun, data, detached);
782     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
783
784     self->simcall.call = SIMCALL_COMM_ISEND;
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*) sender;
788     self->simcall.args[1].dp = (void*) mbox;
789     self->simcall.args[2].d = (double) task_size;
790     self->simcall.args[3].d = (double) rate;
791     self->simcall.args[4].dp = (void*) src_buff;
792     self->simcall.args[5].sz = (size_t) src_buff_size;
793     self->simcall.args[6].fp = (FPtr) match_fun;
794     self->simcall.args[7].fp = (FPtr) clean_fun;
795     self->simcall.args[8].fp = (FPtr) copy_data_fun;
796     self->simcall.args[9].dp = (void*) data;
797     self->simcall.args[10].i = (int) detached;
798     if (self != simix_global->maestro_process) {
799       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
800                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
801       SIMIX_process_yield(self);
802     } else {
803       SIMIX_simcall_handle(&self->simcall, 0);
804     }    
805     return (smx_synchro_t) self->simcall.result.dp;
806   }
807   
808 inline static void simcall_BODY_comm_recv(smx_process_t receiver, smx_mailbox_t mbox, 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) {
809     smx_process_t self = SIMIX_process_self();
810
811     /* Go to that function to follow the code flow through the simcall barrier */
812     if (0) simcall_HANDLER_comm_recv(&self->simcall, receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, timeout, rate);
813     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
814
815     self->simcall.call = SIMCALL_COMM_RECV;
816     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
817     memset(self->simcall.args, 0, sizeof(self->simcall.args));
818     self->simcall.args[0].dp = (void*) receiver;
819     self->simcall.args[1].dp = (void*) mbox;
820     self->simcall.args[2].dp = (void*) dst_buff;
821     self->simcall.args[3].dp = (void*) dst_buff_size;
822     self->simcall.args[4].fp = (FPtr) match_fun;
823     self->simcall.args[5].fp = (FPtr) copy_data_fun;
824     self->simcall.args[6].dp = (void*) data;
825     self->simcall.args[7].d = (double) timeout;
826     self->simcall.args[8].d = (double) rate;
827     if (self != simix_global->maestro_process) {
828       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
829                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
830       SIMIX_process_yield(self);
831     } else {
832       SIMIX_simcall_handle(&self->simcall, 0);
833     }    
834     
835   }
836   
837 inline static smx_synchro_t simcall_BODY_comm_irecv(smx_process_t receiver, smx_mailbox_t mbox, 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) {
838     smx_process_t self = SIMIX_process_self();
839
840     /* Go to that function to follow the code flow through the simcall barrier */
841     if (0) simcall_HANDLER_comm_irecv(&self->simcall, receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, rate);
842     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
843
844     self->simcall.call = SIMCALL_COMM_IRECV;
845     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
846     memset(self->simcall.args, 0, sizeof(self->simcall.args));
847     self->simcall.args[0].dp = (void*) receiver;
848     self->simcall.args[1].dp = (void*) mbox;
849     self->simcall.args[2].dp = (void*) dst_buff;
850     self->simcall.args[3].dp = (void*) dst_buff_size;
851     self->simcall.args[4].fp = (FPtr) match_fun;
852     self->simcall.args[5].fp = (FPtr) copy_data_fun;
853     self->simcall.args[6].dp = (void*) data;
854     self->simcall.args[7].d = (double) rate;
855     if (self != simix_global->maestro_process) {
856       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
857                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
858       SIMIX_process_yield(self);
859     } else {
860       SIMIX_simcall_handle(&self->simcall, 0);
861     }    
862     return (smx_synchro_t) self->simcall.result.dp;
863   }
864   
865 inline static int simcall_BODY_comm_waitany(xbt_dynar_t comms) {
866     smx_process_t self = SIMIX_process_self();
867
868     /* Go to that function to follow the code flow through the simcall barrier */
869     if (0) simcall_HANDLER_comm_waitany(&self->simcall, comms);
870     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
871
872     self->simcall.call = SIMCALL_COMM_WAITANY;
873     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
874     memset(self->simcall.args, 0, sizeof(self->simcall.args));
875     self->simcall.args[0].dp = (void*) comms;
876     if (self != simix_global->maestro_process) {
877       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
878                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
879       SIMIX_process_yield(self);
880     } else {
881       SIMIX_simcall_handle(&self->simcall, 0);
882     }    
883     return (int) self->simcall.result.i;
884   }
885   
886 inline static void simcall_BODY_comm_wait(smx_synchro_t comm, double timeout) {
887     smx_process_t self = SIMIX_process_self();
888
889     /* Go to that function to follow the code flow through the simcall barrier */
890     if (0) simcall_HANDLER_comm_wait(&self->simcall, comm, timeout);
891     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
892
893     self->simcall.call = SIMCALL_COMM_WAIT;
894     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
895     memset(self->simcall.args, 0, sizeof(self->simcall.args));
896     self->simcall.args[0].dp = (void*) comm;
897     self->simcall.args[1].d = (double) timeout;
898     if (self != simix_global->maestro_process) {
899       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
900                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
901       SIMIX_process_yield(self);
902     } else {
903       SIMIX_simcall_handle(&self->simcall, 0);
904     }    
905     
906   }
907   
908 inline static int simcall_BODY_comm_test(smx_synchro_t comm) {
909     smx_process_t self = SIMIX_process_self();
910
911     /* Go to that function to follow the code flow through the simcall barrier */
912     if (0) simcall_HANDLER_comm_test(&self->simcall, comm);
913     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
914
915     self->simcall.call = SIMCALL_COMM_TEST;
916     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
917     memset(self->simcall.args, 0, sizeof(self->simcall.args));
918     self->simcall.args[0].dp = (void*) comm;
919     if (self != simix_global->maestro_process) {
920       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
921                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
922       SIMIX_process_yield(self);
923     } else {
924       SIMIX_simcall_handle(&self->simcall, 0);
925     }    
926     return (int) self->simcall.result.i;
927   }
928   
929 inline static int simcall_BODY_comm_testany(xbt_dynar_t comms) {
930     smx_process_t self = SIMIX_process_self();
931
932     /* Go to that function to follow the code flow through the simcall barrier */
933     if (0) simcall_HANDLER_comm_testany(&self->simcall, comms);
934     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
935
936     self->simcall.call = SIMCALL_COMM_TESTANY;
937     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
938     memset(self->simcall.args, 0, sizeof(self->simcall.args));
939     self->simcall.args[0].dp = (void*) comms;
940     if (self != simix_global->maestro_process) {
941       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
942                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
943       SIMIX_process_yield(self);
944     } else {
945       SIMIX_simcall_handle(&self->simcall, 0);
946     }    
947     return (int) self->simcall.result.i;
948   }
949   
950 inline static void* simcall_BODY_comm_get_src_data(smx_synchro_t comm) {
951     smx_process_t self = SIMIX_process_self();
952
953     /* Go to that function to follow the code flow through the simcall barrier */
954     if (0) SIMIX_comm_get_src_data(comm);
955     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
956
957     self->simcall.call = SIMCALL_COMM_GET_SRC_DATA;
958     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
959     memset(self->simcall.args, 0, sizeof(self->simcall.args));
960     self->simcall.args[0].dp = (void*) comm;
961     if (self != simix_global->maestro_process) {
962       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
963                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
964       SIMIX_process_yield(self);
965     } else {
966       SIMIX_simcall_handle(&self->simcall, 0);
967     }    
968     return (void*) self->simcall.result.dp;
969   }
970   
971 inline static void* simcall_BODY_comm_get_dst_data(smx_synchro_t comm) {
972     smx_process_t self = SIMIX_process_self();
973
974     /* Go to that function to follow the code flow through the simcall barrier */
975     if (0) SIMIX_comm_get_dst_data(comm);
976     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
977
978     self->simcall.call = SIMCALL_COMM_GET_DST_DATA;
979     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
980     memset(self->simcall.args, 0, sizeof(self->simcall.args));
981     self->simcall.args[0].dp = (void*) comm;
982     if (self != simix_global->maestro_process) {
983       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
984                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
985       SIMIX_process_yield(self);
986     } else {
987       SIMIX_simcall_handle(&self->simcall, 0);
988     }    
989     return (void*) self->simcall.result.dp;
990   }
991   
992 inline static smx_process_t simcall_BODY_comm_get_src_proc(smx_synchro_t comm) {
993     smx_process_t self = SIMIX_process_self();
994
995     /* Go to that function to follow the code flow through the simcall barrier */
996     if (0) SIMIX_comm_get_src_proc(comm);
997     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
998
999     self->simcall.call = SIMCALL_COMM_GET_SRC_PROC;
1000     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1001     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1002     self->simcall.args[0].dp = (void*) comm;
1003     if (self != simix_global->maestro_process) {
1004       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1005                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1006       SIMIX_process_yield(self);
1007     } else {
1008       SIMIX_simcall_handle(&self->simcall, 0);
1009     }    
1010     return (smx_process_t) self->simcall.result.dp;
1011   }
1012   
1013 inline static smx_process_t simcall_BODY_comm_get_dst_proc(smx_synchro_t comm) {
1014     smx_process_t self = SIMIX_process_self();
1015
1016     /* Go to that function to follow the code flow through the simcall barrier */
1017     if (0) SIMIX_comm_get_dst_proc(comm);
1018     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1019
1020     self->simcall.call = SIMCALL_COMM_GET_DST_PROC;
1021     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1022     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1023     self->simcall.args[0].dp = (void*) comm;
1024     if (self != simix_global->maestro_process) {
1025       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1026                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1027       SIMIX_process_yield(self);
1028     } else {
1029       SIMIX_simcall_handle(&self->simcall, 0);
1030     }    
1031     return (smx_process_t) self->simcall.result.dp;
1032   }
1033   
1034 inline static smx_mutex_t simcall_BODY_mutex_init() {
1035     smx_process_t self = SIMIX_process_self();
1036
1037     /* Go to that function to follow the code flow through the simcall barrier */
1038     if (0) simcall_HANDLER_mutex_init(&self->simcall);
1039     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1040
1041     self->simcall.call = SIMCALL_MUTEX_INIT;
1042     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1043     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1044
1045     if (self != simix_global->maestro_process) {
1046       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1047                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1048       SIMIX_process_yield(self);
1049     } else {
1050       SIMIX_simcall_handle(&self->simcall, 0);
1051     }    
1052     return (smx_mutex_t) self->simcall.result.dp;
1053   }
1054   
1055 inline static void simcall_BODY_mutex_lock(smx_mutex_t mutex) {
1056     smx_process_t self = SIMIX_process_self();
1057
1058     /* Go to that function to follow the code flow through the simcall barrier */
1059     if (0) simcall_HANDLER_mutex_lock(&self->simcall, mutex);
1060     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1061
1062     self->simcall.call = SIMCALL_MUTEX_LOCK;
1063     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1064     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1065     self->simcall.args[0].dp = (void*) mutex;
1066     if (self != simix_global->maestro_process) {
1067       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1068                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1069       SIMIX_process_yield(self);
1070     } else {
1071       SIMIX_simcall_handle(&self->simcall, 0);
1072     }    
1073     
1074   }
1075   
1076 inline static int simcall_BODY_mutex_trylock(smx_mutex_t mutex) {
1077     smx_process_t self = SIMIX_process_self();
1078
1079     /* Go to that function to follow the code flow through the simcall barrier */
1080     if (0) simcall_HANDLER_mutex_trylock(&self->simcall, mutex);
1081     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1082
1083     self->simcall.call = SIMCALL_MUTEX_TRYLOCK;
1084     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1085     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1086     self->simcall.args[0].dp = (void*) mutex;
1087     if (self != simix_global->maestro_process) {
1088       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1089                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1090       SIMIX_process_yield(self);
1091     } else {
1092       SIMIX_simcall_handle(&self->simcall, 0);
1093     }    
1094     return (int) self->simcall.result.i;
1095   }
1096   
1097 inline static void simcall_BODY_mutex_unlock(smx_mutex_t mutex) {
1098     smx_process_t self = SIMIX_process_self();
1099
1100     /* Go to that function to follow the code flow through the simcall barrier */
1101     if (0) simcall_HANDLER_mutex_unlock(&self->simcall, mutex);
1102     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1103
1104     self->simcall.call = SIMCALL_MUTEX_UNLOCK;
1105     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1106     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1107     self->simcall.args[0].dp = (void*) mutex;
1108     if (self != simix_global->maestro_process) {
1109       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1110                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1111       SIMIX_process_yield(self);
1112     } else {
1113       SIMIX_simcall_handle(&self->simcall, 0);
1114     }    
1115     
1116   }
1117   
1118 inline static smx_cond_t simcall_BODY_cond_init() {
1119     smx_process_t self = SIMIX_process_self();
1120
1121     /* Go to that function to follow the code flow through the simcall barrier */
1122     if (0) SIMIX_cond_init();
1123     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1124
1125     self->simcall.call = SIMCALL_COND_INIT;
1126     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1127     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1128
1129     if (self != simix_global->maestro_process) {
1130       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1131                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1132       SIMIX_process_yield(self);
1133     } else {
1134       SIMIX_simcall_handle(&self->simcall, 0);
1135     }    
1136     return (smx_cond_t) self->simcall.result.dp;
1137   }
1138   
1139 inline static void simcall_BODY_cond_signal(smx_cond_t cond) {
1140     smx_process_t self = SIMIX_process_self();
1141
1142     /* Go to that function to follow the code flow through the simcall barrier */
1143     if (0) SIMIX_cond_signal(cond);
1144     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1145
1146     self->simcall.call = SIMCALL_COND_SIGNAL;
1147     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1148     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1149     self->simcall.args[0].dp = (void*) cond;
1150     if (self != simix_global->maestro_process) {
1151       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1152                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1153       SIMIX_process_yield(self);
1154     } else {
1155       SIMIX_simcall_handle(&self->simcall, 0);
1156     }    
1157     
1158   }
1159   
1160 inline static void simcall_BODY_cond_wait(smx_cond_t cond, smx_mutex_t mutex) {
1161     smx_process_t self = SIMIX_process_self();
1162
1163     /* Go to that function to follow the code flow through the simcall barrier */
1164     if (0) simcall_HANDLER_cond_wait(&self->simcall, cond, mutex);
1165     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1166
1167     self->simcall.call = SIMCALL_COND_WAIT;
1168     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1169     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1170     self->simcall.args[0].dp = (void*) cond;
1171     self->simcall.args[1].dp = (void*) mutex;
1172     if (self != simix_global->maestro_process) {
1173       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1174                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1175       SIMIX_process_yield(self);
1176     } else {
1177       SIMIX_simcall_handle(&self->simcall, 0);
1178     }    
1179     
1180   }
1181   
1182 inline static void simcall_BODY_cond_wait_timeout(smx_cond_t cond, smx_mutex_t mutex, double timeout) {
1183     smx_process_t self = SIMIX_process_self();
1184
1185     /* Go to that function to follow the code flow through the simcall barrier */
1186     if (0) simcall_HANDLER_cond_wait_timeout(&self->simcall, cond, mutex, timeout);
1187     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1188
1189     self->simcall.call = SIMCALL_COND_WAIT_TIMEOUT;
1190     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1191     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1192     self->simcall.args[0].dp = (void*) cond;
1193     self->simcall.args[1].dp = (void*) mutex;
1194     self->simcall.args[2].d = (double) timeout;
1195     if (self != simix_global->maestro_process) {
1196       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1197                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1198       SIMIX_process_yield(self);
1199     } else {
1200       SIMIX_simcall_handle(&self->simcall, 0);
1201     }    
1202     
1203   }
1204   
1205 inline static void simcall_BODY_cond_broadcast(smx_cond_t cond) {
1206     smx_process_t self = SIMIX_process_self();
1207
1208     /* Go to that function to follow the code flow through the simcall barrier */
1209     if (0) SIMIX_cond_broadcast(cond);
1210     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1211
1212     self->simcall.call = SIMCALL_COND_BROADCAST;
1213     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1214     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1215     self->simcall.args[0].dp = (void*) cond;
1216     if (self != simix_global->maestro_process) {
1217       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1218                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1219       SIMIX_process_yield(self);
1220     } else {
1221       SIMIX_simcall_handle(&self->simcall, 0);
1222     }    
1223     
1224   }
1225   
1226 inline static smx_sem_t simcall_BODY_sem_init(unsigned int capacity) {
1227     smx_process_t self = SIMIX_process_self();
1228
1229     /* Go to that function to follow the code flow through the simcall barrier */
1230     if (0) SIMIX_sem_init(capacity);
1231     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1232
1233     self->simcall.call = SIMCALL_SEM_INIT;
1234     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1235     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1236     self->simcall.args[0].ui = (unsigned int) capacity;
1237     if (self != simix_global->maestro_process) {
1238       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1239                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1240       SIMIX_process_yield(self);
1241     } else {
1242       SIMIX_simcall_handle(&self->simcall, 0);
1243     }    
1244     return (smx_sem_t) self->simcall.result.dp;
1245   }
1246   
1247 inline static void simcall_BODY_sem_release(smx_sem_t sem) {
1248     smx_process_t self = SIMIX_process_self();
1249
1250     /* Go to that function to follow the code flow through the simcall barrier */
1251     if (0) simcall_HANDLER_sem_release(&self->simcall, sem);
1252     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1253
1254     self->simcall.call = SIMCALL_SEM_RELEASE;
1255     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1256     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1257     self->simcall.args[0].dp = (void*) sem;
1258     if (self != simix_global->maestro_process) {
1259       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1260                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1261       SIMIX_process_yield(self);
1262     } else {
1263       SIMIX_simcall_handle(&self->simcall, 0);
1264     }    
1265     
1266   }
1267   
1268 inline static int simcall_BODY_sem_would_block(smx_sem_t sem) {
1269     smx_process_t self = SIMIX_process_self();
1270
1271     /* Go to that function to follow the code flow through the simcall barrier */
1272     if (0) simcall_HANDLER_sem_would_block(&self->simcall, sem);
1273     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1274
1275     self->simcall.call = SIMCALL_SEM_WOULD_BLOCK;
1276     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1277     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1278     self->simcall.args[0].dp = (void*) sem;
1279     if (self != simix_global->maestro_process) {
1280       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1281                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1282       SIMIX_process_yield(self);
1283     } else {
1284       SIMIX_simcall_handle(&self->simcall, 0);
1285     }    
1286     return (int) self->simcall.result.i;
1287   }
1288   
1289 inline static void simcall_BODY_sem_acquire(smx_sem_t sem) {
1290     smx_process_t self = SIMIX_process_self();
1291
1292     /* Go to that function to follow the code flow through the simcall barrier */
1293     if (0) simcall_HANDLER_sem_acquire(&self->simcall, sem);
1294     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1295
1296     self->simcall.call = SIMCALL_SEM_ACQUIRE;
1297     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1298     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1299     self->simcall.args[0].dp = (void*) sem;
1300     if (self != simix_global->maestro_process) {
1301       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1302                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1303       SIMIX_process_yield(self);
1304     } else {
1305       SIMIX_simcall_handle(&self->simcall, 0);
1306     }    
1307     
1308   }
1309   
1310 inline static void simcall_BODY_sem_acquire_timeout(smx_sem_t sem, double timeout) {
1311     smx_process_t self = SIMIX_process_self();
1312
1313     /* Go to that function to follow the code flow through the simcall barrier */
1314     if (0) simcall_HANDLER_sem_acquire_timeout(&self->simcall, sem, timeout);
1315     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1316
1317     self->simcall.call = SIMCALL_SEM_ACQUIRE_TIMEOUT;
1318     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1319     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1320     self->simcall.args[0].dp = (void*) sem;
1321     self->simcall.args[1].d = (double) timeout;
1322     if (self != simix_global->maestro_process) {
1323       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1324                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1325       SIMIX_process_yield(self);
1326     } else {
1327       SIMIX_simcall_handle(&self->simcall, 0);
1328     }    
1329     
1330   }
1331   
1332 inline static int simcall_BODY_sem_get_capacity(smx_sem_t sem) {
1333     smx_process_t self = SIMIX_process_self();
1334
1335     /* Go to that function to follow the code flow through the simcall barrier */
1336     if (0) simcall_HANDLER_sem_get_capacity(&self->simcall, sem);
1337     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1338
1339     self->simcall.call = SIMCALL_SEM_GET_CAPACITY;
1340     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1341     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1342     self->simcall.args[0].dp = (void*) sem;
1343     if (self != simix_global->maestro_process) {
1344       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1345                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1346       SIMIX_process_yield(self);
1347     } else {
1348       SIMIX_simcall_handle(&self->simcall, 0);
1349     }    
1350     return (int) self->simcall.result.i;
1351   }
1352   
1353 inline static sg_size_t simcall_BODY_file_read(smx_file_t fd, sg_size_t size, sg_host_t host) {
1354     smx_process_t self = SIMIX_process_self();
1355
1356     /* Go to that function to follow the code flow through the simcall barrier */
1357     if (0) simcall_HANDLER_file_read(&self->simcall, fd, size, host);
1358     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1359
1360     self->simcall.call = SIMCALL_FILE_READ;
1361     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1362     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1363     self->simcall.args[0].dp = (void*) fd;
1364     self->simcall.args[1].sgsz = (sg_size_t) size;
1365     self->simcall.args[2].dp = (void*) host;
1366     if (self != simix_global->maestro_process) {
1367       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1368                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1369       SIMIX_process_yield(self);
1370     } else {
1371       SIMIX_simcall_handle(&self->simcall, 0);
1372     }    
1373     return (sg_size_t) self->simcall.result.sgsz;
1374   }
1375   
1376 inline static sg_size_t simcall_BODY_file_write(smx_file_t fd, sg_size_t size, sg_host_t host) {
1377     smx_process_t self = SIMIX_process_self();
1378
1379     /* Go to that function to follow the code flow through the simcall barrier */
1380     if (0) simcall_HANDLER_file_write(&self->simcall, fd, size, host);
1381     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1382
1383     self->simcall.call = SIMCALL_FILE_WRITE;
1384     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1385     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1386     self->simcall.args[0].dp = (void*) fd;
1387     self->simcall.args[1].sgsz = (sg_size_t) size;
1388     self->simcall.args[2].dp = (void*) host;
1389     if (self != simix_global->maestro_process) {
1390       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1391                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1392       SIMIX_process_yield(self);
1393     } else {
1394       SIMIX_simcall_handle(&self->simcall, 0);
1395     }    
1396     return (sg_size_t) self->simcall.result.sgsz;
1397   }
1398   
1399 inline static smx_file_t simcall_BODY_file_open(const char* fullpath, sg_host_t host) {
1400     smx_process_t self = SIMIX_process_self();
1401
1402     /* Go to that function to follow the code flow through the simcall barrier */
1403     if (0) simcall_HANDLER_file_open(&self->simcall, fullpath, host);
1404     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1405
1406     self->simcall.call = SIMCALL_FILE_OPEN;
1407     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1408     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1409     self->simcall.args[0].cc = (const char*) fullpath;
1410     self->simcall.args[1].dp = (void*) host;
1411     if (self != simix_global->maestro_process) {
1412       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1413                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1414       SIMIX_process_yield(self);
1415     } else {
1416       SIMIX_simcall_handle(&self->simcall, 0);
1417     }    
1418     return (smx_file_t) self->simcall.result.dp;
1419   }
1420   
1421 inline static int simcall_BODY_file_close(smx_file_t fd, sg_host_t host) {
1422     smx_process_t self = SIMIX_process_self();
1423
1424     /* Go to that function to follow the code flow through the simcall barrier */
1425     if (0) simcall_HANDLER_file_close(&self->simcall, fd, host);
1426     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1427
1428     self->simcall.call = SIMCALL_FILE_CLOSE;
1429     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1430     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1431     self->simcall.args[0].dp = (void*) fd;
1432     self->simcall.args[1].dp = (void*) host;
1433     if (self != simix_global->maestro_process) {
1434       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1435                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1436       SIMIX_process_yield(self);
1437     } else {
1438       SIMIX_simcall_handle(&self->simcall, 0);
1439     }    
1440     return (int) self->simcall.result.i;
1441   }
1442   
1443 inline static int simcall_BODY_file_unlink(smx_file_t fd, sg_host_t host) {
1444     smx_process_t self = SIMIX_process_self();
1445
1446     /* Go to that function to follow the code flow through the simcall barrier */
1447     if (0) SIMIX_file_unlink(fd, host);
1448     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1449
1450     self->simcall.call = SIMCALL_FILE_UNLINK;
1451     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1452     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1453     self->simcall.args[0].dp = (void*) fd;
1454     self->simcall.args[1].dp = (void*) host;
1455     if (self != simix_global->maestro_process) {
1456       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1457                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1458       SIMIX_process_yield(self);
1459     } else {
1460       SIMIX_simcall_handle(&self->simcall, 0);
1461     }    
1462     return (int) self->simcall.result.i;
1463   }
1464   
1465 inline static sg_size_t simcall_BODY_file_get_size(smx_file_t fd) {
1466     smx_process_t self = SIMIX_process_self();
1467
1468     /* Go to that function to follow the code flow through the simcall barrier */
1469     if (0) simcall_HANDLER_file_get_size(&self->simcall, fd);
1470     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1471
1472     self->simcall.call = SIMCALL_FILE_GET_SIZE;
1473     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1474     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1475     self->simcall.args[0].dp = (void*) fd;
1476     if (self != simix_global->maestro_process) {
1477       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1478                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1479       SIMIX_process_yield(self);
1480     } else {
1481       SIMIX_simcall_handle(&self->simcall, 0);
1482     }    
1483     return (sg_size_t) self->simcall.result.sgsz;
1484   }
1485   
1486 inline static sg_size_t simcall_BODY_file_tell(smx_file_t fd) {
1487     smx_process_t self = SIMIX_process_self();
1488
1489     /* Go to that function to follow the code flow through the simcall barrier */
1490     if (0) simcall_HANDLER_file_tell(&self->simcall, fd);
1491     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1492
1493     self->simcall.call = SIMCALL_FILE_TELL;
1494     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1495     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1496     self->simcall.args[0].dp = (void*) fd;
1497     if (self != simix_global->maestro_process) {
1498       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1499                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1500       SIMIX_process_yield(self);
1501     } else {
1502       SIMIX_simcall_handle(&self->simcall, 0);
1503     }    
1504     return (sg_size_t) self->simcall.result.sgsz;
1505   }
1506   
1507 inline static int simcall_BODY_file_seek(smx_file_t fd, sg_offset_t offset, int origin) {
1508     smx_process_t self = SIMIX_process_self();
1509
1510     /* Go to that function to follow the code flow through the simcall barrier */
1511     if (0) simcall_HANDLER_file_seek(&self->simcall, fd, offset, origin);
1512     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1513
1514     self->simcall.call = SIMCALL_FILE_SEEK;
1515     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1516     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1517     self->simcall.args[0].dp = (void*) fd;
1518     self->simcall.args[1].sgoff = (sg_offset_t) offset;
1519     self->simcall.args[2].i = (int) origin;
1520     if (self != simix_global->maestro_process) {
1521       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1522                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1523       SIMIX_process_yield(self);
1524     } else {
1525       SIMIX_simcall_handle(&self->simcall, 0);
1526     }    
1527     return (int) self->simcall.result.i;
1528   }
1529   
1530 inline static xbt_dynar_t simcall_BODY_file_get_info(smx_file_t fd) {
1531     smx_process_t self = SIMIX_process_self();
1532
1533     /* Go to that function to follow the code flow through the simcall barrier */
1534     if (0) simcall_HANDLER_file_get_info(&self->simcall, fd);
1535     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1536
1537     self->simcall.call = SIMCALL_FILE_GET_INFO;
1538     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1539     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1540     self->simcall.args[0].dp = (void*) fd;
1541     if (self != simix_global->maestro_process) {
1542       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1543                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1544       SIMIX_process_yield(self);
1545     } else {
1546       SIMIX_simcall_handle(&self->simcall, 0);
1547     }    
1548     return (xbt_dynar_t) self->simcall.result.dp;
1549   }
1550   
1551 inline static int simcall_BODY_file_move(smx_file_t fd, const char* fullpath) {
1552     smx_process_t self = SIMIX_process_self();
1553
1554     /* Go to that function to follow the code flow through the simcall barrier */
1555     if (0) simcall_HANDLER_file_move(&self->simcall, fd, fullpath);
1556     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1557
1558     self->simcall.call = SIMCALL_FILE_MOVE;
1559     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1560     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1561     self->simcall.args[0].dp = (void*) fd;
1562     self->simcall.args[1].cc = (const char*) fullpath;
1563     if (self != simix_global->maestro_process) {
1564       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1565                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1566       SIMIX_process_yield(self);
1567     } else {
1568       SIMIX_simcall_handle(&self->simcall, 0);
1569     }    
1570     return (int) self->simcall.result.i;
1571   }
1572   
1573 inline static sg_size_t simcall_BODY_storage_get_free_size(smx_storage_t storage) {
1574     smx_process_t self = SIMIX_process_self();
1575
1576     /* Go to that function to follow the code flow through the simcall barrier */
1577     if (0) simcall_HANDLER_storage_get_free_size(&self->simcall, storage);
1578     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1579
1580     self->simcall.call = SIMCALL_STORAGE_GET_FREE_SIZE;
1581     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1582     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1583     self->simcall.args[0].dp = (void*) storage;
1584     if (self != simix_global->maestro_process) {
1585       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1586                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1587       SIMIX_process_yield(self);
1588     } else {
1589       SIMIX_simcall_handle(&self->simcall, 0);
1590     }    
1591     return (sg_size_t) self->simcall.result.sgsz;
1592   }
1593   
1594 inline static sg_size_t simcall_BODY_storage_get_used_size(smx_storage_t name) {
1595     smx_process_t self = SIMIX_process_self();
1596
1597     /* Go to that function to follow the code flow through the simcall barrier */
1598     if (0) simcall_HANDLER_storage_get_used_size(&self->simcall, name);
1599     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1600
1601     self->simcall.call = SIMCALL_STORAGE_GET_USED_SIZE;
1602     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1603     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1604     self->simcall.args[0].dp = (void*) name;
1605     if (self != simix_global->maestro_process) {
1606       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1607                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1608       SIMIX_process_yield(self);
1609     } else {
1610       SIMIX_simcall_handle(&self->simcall, 0);
1611     }    
1612     return (sg_size_t) self->simcall.result.sgsz;
1613   }
1614   
1615 inline static xbt_dict_t simcall_BODY_storage_get_properties(smx_storage_t storage) {
1616     smx_process_t self = SIMIX_process_self();
1617
1618     /* Go to that function to follow the code flow through the simcall barrier */
1619     if (0) SIMIX_storage_get_properties(storage);
1620     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1621
1622     self->simcall.call = SIMCALL_STORAGE_GET_PROPERTIES;
1623     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1624     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1625     self->simcall.args[0].dp = (void*) storage;
1626     if (self != simix_global->maestro_process) {
1627       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1628                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1629       SIMIX_process_yield(self);
1630     } else {
1631       SIMIX_simcall_handle(&self->simcall, 0);
1632     }    
1633     return (xbt_dict_t) self->simcall.result.dp;
1634   }
1635   
1636 inline static xbt_dict_t simcall_BODY_storage_get_content(smx_storage_t storage) {
1637     smx_process_t self = SIMIX_process_self();
1638
1639     /* Go to that function to follow the code flow through the simcall barrier */
1640     if (0) SIMIX_storage_get_content(storage);
1641     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1642
1643     self->simcall.call = SIMCALL_STORAGE_GET_CONTENT;
1644     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1645     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1646     self->simcall.args[0].dp = (void*) storage;
1647     if (self != simix_global->maestro_process) {
1648       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1649                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1650       SIMIX_process_yield(self);
1651     } else {
1652       SIMIX_simcall_handle(&self->simcall, 0);
1653     }    
1654     return (xbt_dict_t) self->simcall.result.dp;
1655   }
1656   
1657 inline static xbt_dict_t simcall_BODY_asr_get_properties(const char* name) {
1658     smx_process_t self = SIMIX_process_self();
1659
1660     /* Go to that function to follow the code flow through the simcall barrier */
1661     if (0) simcall_HANDLER_asr_get_properties(&self->simcall, name);
1662     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1663
1664     self->simcall.call = SIMCALL_ASR_GET_PROPERTIES;
1665     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1666     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1667     self->simcall.args[0].cc = (const char*) name;
1668     if (self != simix_global->maestro_process) {
1669       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1670                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1671       SIMIX_process_yield(self);
1672     } else {
1673       SIMIX_simcall_handle(&self->simcall, 0);
1674     }    
1675     return (xbt_dict_t) self->simcall.result.dp;
1676   }
1677   
1678 inline static int simcall_BODY_mc_random(int min, int max) {
1679     smx_process_t self = SIMIX_process_self();
1680
1681     /* Go to that function to follow the code flow through the simcall barrier */
1682     if (0) simcall_HANDLER_mc_random(&self->simcall, min, max);
1683     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1684
1685     self->simcall.call = SIMCALL_MC_RANDOM;
1686     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1687     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1688     self->simcall.args[0].i = (int) min;
1689     self->simcall.args[1].i = (int) max;
1690     if (self != simix_global->maestro_process) {
1691       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1692                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1693       SIMIX_process_yield(self);
1694     } else {
1695       SIMIX_simcall_handle(&self->simcall, 0);
1696     }    
1697     return (int) self->simcall.result.i;
1698   }
1699   
1700 inline static void simcall_BODY_set_category(smx_synchro_t synchro, const char* category) {
1701     smx_process_t self = SIMIX_process_self();
1702
1703     /* Go to that function to follow the code flow through the simcall barrier */
1704     if (0) SIMIX_set_category(synchro, category);
1705     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1706
1707     self->simcall.call = SIMCALL_SET_CATEGORY;
1708     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1709     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1710     self->simcall.args[0].dp = (void*) synchro;
1711     self->simcall.args[1].cc = (const char*) category;
1712     if (self != simix_global->maestro_process) {
1713       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1714                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1715       SIMIX_process_yield(self);
1716     } else {
1717       SIMIX_simcall_handle(&self->simcall, 0);
1718     }    
1719     
1720   }
1721   
1722 inline static void simcall_BODY_run_kernel(void* code) {
1723     smx_process_t self = SIMIX_process_self();
1724
1725     /* Go to that function to follow the code flow through the simcall barrier */
1726     if (0) SIMIX_run_kernel(code);
1727     /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1728
1729     self->simcall.call = SIMCALL_RUN_KERNEL;
1730     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1731     memset(self->simcall.args, 0, sizeof(self->simcall.args));
1732     self->simcall.args[0].dp = (void*) code;
1733     if (self != simix_global->maestro_process) {
1734       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1735                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1736       SIMIX_process_yield(self);
1737     } else {
1738       SIMIX_simcall_handle(&self->simcall, 0);
1739     }    
1740     
1741   }