Logo AND Algorithmique Numérique Distribuée

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