Logo AND Algorithmique Numérique Distribuée

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