1 /**********************************************************************/
2 /* File generated by src/simix/simcalls.py from src/simix/simcalls.in */
4 /* DO NOT EVER CHANGE THIS FILE */
6 /* change simcalls specification in src/simix/simcalls.in */
7 /**********************************************************************/
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.
13 * That's not about http://en.wikipedia.org/wiki/Poop, despite the odor :)
16 #include "smx_private.h"
17 #include "src/mc/mc_forward.h"
19 #include <simgrid/simix.hpp>
21 inline static void simcall_BODY_host_off(sg_host_t host) {
22 smx_process_t self = SIMIX_process_self();
24 /* Go to that function to follow the code flow through the simcall barrier */
25 if (0) simcall_HANDLER_host_off(&self->simcall, host);
26 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
28 self->simcall.call = SIMCALL_HOST_OFF;
29 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
30 memset(self->simcall.args, 0, sizeof(self->simcall.args));
31 self->simcall.args[0].dp = (void*) host;
32 if (self != simix_global->maestro_process) {
33 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
34 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
35 SIMIX_process_yield(self);
37 SIMIX_simcall_handle(&self->simcall, 0);
42 inline static void simcall_BODY_vm_suspend(sg_host_t ind_vm) {
43 smx_process_t self = SIMIX_process_self();
45 /* Go to that function to follow the code flow through the simcall barrier */
46 if (0) simcall_HANDLER_vm_suspend(&self->simcall, ind_vm);
47 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
49 self->simcall.call = SIMCALL_VM_SUSPEND;
50 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
51 memset(self->simcall.args, 0, sizeof(self->simcall.args));
52 self->simcall.args[0].dp = (void*) ind_vm;
53 if (self != simix_global->maestro_process) {
54 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
55 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
56 SIMIX_process_yield(self);
58 SIMIX_simcall_handle(&self->simcall, 0);
63 inline static void simcall_BODY_vm_resume(sg_host_t ind_vm) {
64 smx_process_t self = SIMIX_process_self();
66 /* Go to that function to follow the code flow through the simcall barrier */
67 if (0) simcall_HANDLER_vm_resume(&self->simcall, ind_vm);
68 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
70 self->simcall.call = SIMCALL_VM_RESUME;
71 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
72 memset(self->simcall.args, 0, sizeof(self->simcall.args));
73 self->simcall.args[0].dp = (void*) ind_vm;
74 if (self != simix_global->maestro_process) {
75 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
76 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
77 SIMIX_process_yield(self);
79 SIMIX_simcall_handle(&self->simcall, 0);
84 inline static void simcall_BODY_vm_shutdown(sg_host_t ind_vm) {
85 smx_process_t self = SIMIX_process_self();
87 /* Go to that function to follow the code flow through the simcall barrier */
88 if (0) simcall_HANDLER_vm_shutdown(&self->simcall, ind_vm);
89 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
91 self->simcall.call = SIMCALL_VM_SHUTDOWN;
92 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
93 memset(self->simcall.args, 0, sizeof(self->simcall.args));
94 self->simcall.args[0].dp = (void*) ind_vm;
95 if (self != simix_global->maestro_process) {
96 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
97 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
98 SIMIX_process_yield(self);
100 SIMIX_simcall_handle(&self->simcall, 0);
105 inline static void simcall_BODY_vm_save(sg_host_t ind_vm) {
106 smx_process_t self = SIMIX_process_self();
108 /* Go to that function to follow the code flow through the simcall barrier */
109 if (0) simcall_HANDLER_vm_save(&self->simcall, ind_vm);
110 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
112 self->simcall.call = SIMCALL_VM_SAVE;
113 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
114 memset(self->simcall.args, 0, sizeof(self->simcall.args));
115 self->simcall.args[0].dp = (void*) ind_vm;
116 if (self != simix_global->maestro_process) {
117 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
118 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
119 SIMIX_process_yield(self);
121 SIMIX_simcall_handle(&self->simcall, 0);
126 inline static void simcall_BODY_vm_restore(sg_host_t ind_vm) {
127 smx_process_t self = SIMIX_process_self();
129 /* Go to that function to follow the code flow through the simcall barrier */
130 if (0) simcall_HANDLER_vm_restore(&self->simcall, ind_vm);
131 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
133 self->simcall.call = SIMCALL_VM_RESTORE;
134 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
135 memset(self->simcall.args, 0, sizeof(self->simcall.args));
136 self->simcall.args[0].dp = (void*) ind_vm;
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);
142 SIMIX_simcall_handle(&self->simcall, 0);
147 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) {
148 smx_process_t self = SIMIX_process_self();
150 /* Go to that function to follow the code flow through the simcall barrier */
151 if (0) simcall_HANDLER_process_create(&self->simcall, name, code, data, hostname, kill_time, argc, argv, properties, auto_restart);
152 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
154 self->simcall.call = SIMCALL_PROCESS_CREATE;
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].cc = (const char*) name;
158 self->simcall.args[1].fp = (FPtr) code;
159 self->simcall.args[2].dp = (void*) data;
160 self->simcall.args[3].cc = (const char*) hostname;
161 self->simcall.args[4].d = (double) kill_time;
162 self->simcall.args[5].i = (int) argc;
163 self->simcall.args[6].dp = (void*) argv;
164 self->simcall.args[7].dp = (void*) properties;
165 self->simcall.args[8].i = (int) auto_restart;
166 if (self != simix_global->maestro_process) {
167 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
168 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
169 SIMIX_process_yield(self);
171 SIMIX_simcall_handle(&self->simcall, 0);
173 return (void*) self->simcall.result.dp;
176 inline static void simcall_BODY_process_kill(smx_process_t process) {
177 smx_process_t self = SIMIX_process_self();
179 /* Go to that function to follow the code flow through the simcall barrier */
180 if (0) simcall_HANDLER_process_kill(&self->simcall, process);
181 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
183 self->simcall.call = SIMCALL_PROCESS_KILL;
184 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
185 memset(self->simcall.args, 0, sizeof(self->simcall.args));
186 self->simcall.args[0].dp = (void*) process;
187 if (self != simix_global->maestro_process) {
188 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
189 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
190 SIMIX_process_yield(self);
192 SIMIX_simcall_handle(&self->simcall, 0);
197 inline static void simcall_BODY_process_killall(int reset_pid) {
198 smx_process_t self = SIMIX_process_self();
200 /* Go to that function to follow the code flow through the simcall barrier */
201 if (0) simcall_HANDLER_process_killall(&self->simcall, reset_pid);
202 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
204 self->simcall.call = SIMCALL_PROCESS_KILLALL;
205 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
206 memset(self->simcall.args, 0, sizeof(self->simcall.args));
207 self->simcall.args[0].i = (int) reset_pid;
208 if (self != simix_global->maestro_process) {
209 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
210 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
211 SIMIX_process_yield(self);
213 SIMIX_simcall_handle(&self->simcall, 0);
218 inline static void simcall_BODY_process_cleanup(smx_process_t process) {
219 smx_process_t self = SIMIX_process_self();
221 /* Go to that function to follow the code flow through the simcall barrier */
222 if (0) SIMIX_process_cleanup(process);
223 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
225 self->simcall.call = SIMCALL_PROCESS_CLEANUP;
226 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
227 memset(self->simcall.args, 0, sizeof(self->simcall.args));
228 self->simcall.args[0].dp = (void*) process;
229 if (self != simix_global->maestro_process) {
230 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
231 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
232 SIMIX_process_yield(self);
234 SIMIX_simcall_handle(&self->simcall, 0);
239 inline static void simcall_BODY_process_suspend(smx_process_t process) {
240 smx_process_t self = SIMIX_process_self();
242 /* Go to that function to follow the code flow through the simcall barrier */
243 if (0) simcall_HANDLER_process_suspend(&self->simcall, process);
244 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
246 self->simcall.call = SIMCALL_PROCESS_SUSPEND;
247 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
248 memset(self->simcall.args, 0, sizeof(self->simcall.args));
249 self->simcall.args[0].dp = (void*) process;
250 if (self != simix_global->maestro_process) {
251 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
252 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
253 SIMIX_process_yield(self);
255 SIMIX_simcall_handle(&self->simcall, 0);
260 inline static void simcall_BODY_process_resume(smx_process_t process) {
261 smx_process_t self = SIMIX_process_self();
263 /* Go to that function to follow the code flow through the simcall barrier */
264 if (0) simcall_HANDLER_process_resume(&self->simcall, process);
265 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
267 self->simcall.call = SIMCALL_PROCESS_RESUME;
268 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
269 memset(self->simcall.args, 0, sizeof(self->simcall.args));
270 self->simcall.args[0].dp = (void*) process;
271 if (self != simix_global->maestro_process) {
272 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
273 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
274 SIMIX_process_yield(self);
276 SIMIX_simcall_handle(&self->simcall, 0);
281 inline static void simcall_BODY_process_set_host(smx_process_t process, sg_host_t dest) {
282 smx_process_t self = SIMIX_process_self();
284 /* Go to that function to follow the code flow through the simcall barrier */
285 if (0) simcall_HANDLER_process_set_host(&self->simcall, process, dest);
286 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
288 self->simcall.call = SIMCALL_PROCESS_SET_HOST;
289 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
290 memset(self->simcall.args, 0, sizeof(self->simcall.args));
291 self->simcall.args[0].dp = (void*) process;
292 self->simcall.args[1].dp = (void*) dest;
293 if (self != simix_global->maestro_process) {
294 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
295 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
296 SIMIX_process_yield(self);
298 SIMIX_simcall_handle(&self->simcall, 0);
303 inline static int simcall_BODY_process_is_suspended(smx_process_t process) {
304 smx_process_t self = SIMIX_process_self();
306 /* Go to that function to follow the code flow through the simcall barrier */
307 if (0) SIMIX_process_is_suspended(process);
308 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
310 self->simcall.call = SIMCALL_PROCESS_IS_SUSPENDED;
311 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
312 memset(self->simcall.args, 0, sizeof(self->simcall.args));
313 self->simcall.args[0].dp = (void*) process;
314 if (self != simix_global->maestro_process) {
315 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
316 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
317 SIMIX_process_yield(self);
319 SIMIX_simcall_handle(&self->simcall, 0);
321 return (int) self->simcall.result.i;
324 inline static int simcall_BODY_process_join(smx_process_t process, double timeout) {
325 smx_process_t self = SIMIX_process_self();
327 /* Go to that function to follow the code flow through the simcall barrier */
328 if (0) simcall_HANDLER_process_join(&self->simcall, process, timeout);
329 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
331 self->simcall.call = SIMCALL_PROCESS_JOIN;
332 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
333 memset(self->simcall.args, 0, sizeof(self->simcall.args));
334 self->simcall.args[0].dp = (void*) process;
335 self->simcall.args[1].d = (double) timeout;
336 if (self != simix_global->maestro_process) {
337 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
338 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
339 SIMIX_process_yield(self);
341 SIMIX_simcall_handle(&self->simcall, 0);
343 return (int) self->simcall.result.i;
346 inline static int simcall_BODY_process_sleep(double duration) {
347 smx_process_t self = SIMIX_process_self();
349 /* Go to that function to follow the code flow through the simcall barrier */
350 if (0) simcall_HANDLER_process_sleep(&self->simcall, duration);
351 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
353 self->simcall.call = SIMCALL_PROCESS_SLEEP;
354 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
355 memset(self->simcall.args, 0, sizeof(self->simcall.args));
356 self->simcall.args[0].d = (double) duration;
357 if (self != simix_global->maestro_process) {
358 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
359 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
360 SIMIX_process_yield(self);
362 SIMIX_simcall_handle(&self->simcall, 0);
364 return (int) self->simcall.result.i;
367 inline static smx_synchro_t simcall_BODY_process_execute(const char* name, double flops_amount, double priority, double bound, unsigned long affinity_mask) {
368 smx_process_t self = SIMIX_process_self();
370 /* Go to that function to follow the code flow through the simcall barrier */
371 if (0) simcall_HANDLER_process_execute(&self->simcall, name, flops_amount, priority, bound, affinity_mask);
372 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
374 self->simcall.call = SIMCALL_PROCESS_EXECUTE;
375 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
376 memset(self->simcall.args, 0, sizeof(self->simcall.args));
377 self->simcall.args[0].cc = (const char*) name;
378 self->simcall.args[1].d = (double) flops_amount;
379 self->simcall.args[2].d = (double) priority;
380 self->simcall.args[3].d = (double) bound;
381 self->simcall.args[4].ul = (unsigned long) affinity_mask;
382 if (self != simix_global->maestro_process) {
383 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
384 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
385 SIMIX_process_yield(self);
387 SIMIX_simcall_handle(&self->simcall, 0);
389 return (smx_synchro_t) self->simcall.result.dp;
392 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) {
393 smx_process_t self = SIMIX_process_self();
395 /* Go to that function to follow the code flow through the simcall barrier */
396 if (0) SIMIX_process_parallel_execute(name, host_nb, host_list, flops_amount, bytes_amount, amount, rate);
397 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
399 self->simcall.call = SIMCALL_PROCESS_PARALLEL_EXECUTE;
400 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
401 memset(self->simcall.args, 0, sizeof(self->simcall.args));
402 self->simcall.args[0].cc = (const char*) name;
403 self->simcall.args[1].i = (int) host_nb;
404 self->simcall.args[2].dp = (void*) host_list;
405 self->simcall.args[3].dp = (void*) flops_amount;
406 self->simcall.args[4].dp = (void*) bytes_amount;
407 self->simcall.args[5].d = (double) amount;
408 self->simcall.args[6].d = (double) rate;
409 if (self != simix_global->maestro_process) {
410 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
411 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
412 SIMIX_process_yield(self);
414 SIMIX_simcall_handle(&self->simcall, 0);
416 return (smx_synchro_t) self->simcall.result.dp;
419 inline static void simcall_BODY_process_execution_destroy(smx_synchro_t execution) {
420 smx_process_t self = SIMIX_process_self();
422 /* Go to that function to follow the code flow through the simcall barrier */
423 if (0) SIMIX_process_execution_destroy(execution);
424 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
426 self->simcall.call = SIMCALL_PROCESS_EXECUTION_DESTROY;
427 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
428 memset(self->simcall.args, 0, sizeof(self->simcall.args));
429 self->simcall.args[0].dp = (void*) execution;
430 if (self != simix_global->maestro_process) {
431 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
432 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
433 SIMIX_process_yield(self);
435 SIMIX_simcall_handle(&self->simcall, 0);
440 inline static void simcall_BODY_process_execution_cancel(smx_synchro_t execution) {
441 smx_process_t self = SIMIX_process_self();
443 /* Go to that function to follow the code flow through the simcall barrier */
444 if (0) SIMIX_process_execution_cancel(execution);
445 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
447 self->simcall.call = SIMCALL_PROCESS_EXECUTION_CANCEL;
448 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
449 memset(self->simcall.args, 0, sizeof(self->simcall.args));
450 self->simcall.args[0].dp = (void*) execution;
451 if (self != simix_global->maestro_process) {
452 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
453 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
454 SIMIX_process_yield(self);
456 SIMIX_simcall_handle(&self->simcall, 0);
461 inline static double simcall_BODY_process_execution_get_remains(smx_synchro_t execution) {
462 smx_process_t self = SIMIX_process_self();
464 /* Go to that function to follow the code flow through the simcall barrier */
465 if (0) SIMIX_process_execution_get_remains(execution);
466 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
468 self->simcall.call = SIMCALL_PROCESS_EXECUTION_GET_REMAINS;
469 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
470 memset(self->simcall.args, 0, sizeof(self->simcall.args));
471 self->simcall.args[0].dp = (void*) execution;
472 if (self != simix_global->maestro_process) {
473 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
474 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
475 SIMIX_process_yield(self);
477 SIMIX_simcall_handle(&self->simcall, 0);
479 return (double) self->simcall.result.d;
482 inline static e_smx_state_t simcall_BODY_process_execution_get_state(smx_synchro_t execution) {
483 smx_process_t self = SIMIX_process_self();
485 /* Go to that function to follow the code flow through the simcall barrier */
486 if (0) SIMIX_process_execution_get_state(execution);
487 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
489 self->simcall.call = SIMCALL_PROCESS_EXECUTION_GET_STATE;
490 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
491 memset(self->simcall.args, 0, sizeof(self->simcall.args));
492 self->simcall.args[0].dp = (void*) execution;
493 if (self != simix_global->maestro_process) {
494 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
495 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
496 SIMIX_process_yield(self);
498 SIMIX_simcall_handle(&self->simcall, 0);
500 return (e_smx_state_t) self->simcall.result.i;
503 inline static void simcall_BODY_process_execution_set_priority(smx_synchro_t execution, double priority) {
504 smx_process_t self = SIMIX_process_self();
506 /* Go to that function to follow the code flow through the simcall barrier */
507 if (0) SIMIX_process_execution_set_priority(execution, priority);
508 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
510 self->simcall.call = SIMCALL_PROCESS_EXECUTION_SET_PRIORITY;
511 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
512 memset(self->simcall.args, 0, sizeof(self->simcall.args));
513 self->simcall.args[0].dp = (void*) execution;
514 self->simcall.args[1].d = (double) priority;
515 if (self != simix_global->maestro_process) {
516 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
517 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
518 SIMIX_process_yield(self);
520 SIMIX_simcall_handle(&self->simcall, 0);
525 inline static void simcall_BODY_process_execution_set_bound(smx_synchro_t execution, double bound) {
526 smx_process_t self = SIMIX_process_self();
528 /* Go to that function to follow the code flow through the simcall barrier */
529 if (0) SIMIX_process_execution_set_bound(execution, bound);
530 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
532 self->simcall.call = SIMCALL_PROCESS_EXECUTION_SET_BOUND;
533 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
534 memset(self->simcall.args, 0, sizeof(self->simcall.args));
535 self->simcall.args[0].dp = (void*) execution;
536 self->simcall.args[1].d = (double) bound;
537 if (self != simix_global->maestro_process) {
538 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
539 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
540 SIMIX_process_yield(self);
542 SIMIX_simcall_handle(&self->simcall, 0);
547 inline static void simcall_BODY_process_execution_set_affinity(smx_synchro_t execution, sg_host_t ws, unsigned long mask) {
548 smx_process_t self = SIMIX_process_self();
550 /* Go to that function to follow the code flow through the simcall barrier */
551 if (0) SIMIX_process_execution_set_affinity(execution, ws, mask);
552 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
554 self->simcall.call = SIMCALL_PROCESS_EXECUTION_SET_AFFINITY;
555 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
556 memset(self->simcall.args, 0, sizeof(self->simcall.args));
557 self->simcall.args[0].dp = (void*) execution;
558 self->simcall.args[1].dp = (void*) ws;
559 self->simcall.args[2].ul = (unsigned long) mask;
560 if (self != simix_global->maestro_process) {
561 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
562 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
563 SIMIX_process_yield(self);
565 SIMIX_simcall_handle(&self->simcall, 0);
570 inline static int simcall_BODY_process_execution_wait(smx_synchro_t execution) {
571 smx_process_t self = SIMIX_process_self();
573 /* Go to that function to follow the code flow through the simcall barrier */
574 if (0) simcall_HANDLER_process_execution_wait(&self->simcall, execution);
575 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
577 self->simcall.call = SIMCALL_PROCESS_EXECUTION_WAIT;
578 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
579 memset(self->simcall.args, 0, sizeof(self->simcall.args));
580 self->simcall.args[0].dp = (void*) execution;
581 if (self != simix_global->maestro_process) {
582 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
583 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
584 SIMIX_process_yield(self);
586 SIMIX_simcall_handle(&self->simcall, 0);
588 return (int) self->simcall.result.i;
591 inline static void simcall_BODY_process_on_exit(smx_process_t process, int_f_pvoid_pvoid_t fun, void* data) {
592 smx_process_t self = SIMIX_process_self();
594 /* Go to that function to follow the code flow through the simcall barrier */
595 if (0) SIMIX_process_on_exit(process, fun, data);
596 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
598 self->simcall.call = SIMCALL_PROCESS_ON_EXIT;
599 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
600 memset(self->simcall.args, 0, sizeof(self->simcall.args));
601 self->simcall.args[0].dp = (void*) process;
602 self->simcall.args[1].fp = (FPtr) fun;
603 self->simcall.args[2].dp = (void*) data;
604 if (self != simix_global->maestro_process) {
605 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
606 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
607 SIMIX_process_yield(self);
609 SIMIX_simcall_handle(&self->simcall, 0);
614 inline static void simcall_BODY_process_auto_restart_set(smx_process_t process, int auto_restart) {
615 smx_process_t self = SIMIX_process_self();
617 /* Go to that function to follow the code flow through the simcall barrier */
618 if (0) SIMIX_process_auto_restart_set(process, auto_restart);
619 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
621 self->simcall.call = SIMCALL_PROCESS_AUTO_RESTART_SET;
622 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
623 memset(self->simcall.args, 0, sizeof(self->simcall.args));
624 self->simcall.args[0].dp = (void*) process;
625 self->simcall.args[1].i = (int) auto_restart;
626 if (self != simix_global->maestro_process) {
627 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
628 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
629 SIMIX_process_yield(self);
631 SIMIX_simcall_handle(&self->simcall, 0);
636 inline static smx_process_t simcall_BODY_process_restart(smx_process_t process) {
637 smx_process_t self = SIMIX_process_self();
639 /* Go to that function to follow the code flow through the simcall barrier */
640 if (0) simcall_HANDLER_process_restart(&self->simcall, process);
641 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
643 self->simcall.call = SIMCALL_PROCESS_RESTART;
644 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
645 memset(self->simcall.args, 0, sizeof(self->simcall.args));
646 self->simcall.args[0].dp = (void*) process;
647 if (self != simix_global->maestro_process) {
648 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
649 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
650 SIMIX_process_yield(self);
652 SIMIX_simcall_handle(&self->simcall, 0);
654 return (smx_process_t) self->simcall.result.dp;
657 inline static smx_rdv_t simcall_BODY_rdv_create(const char* name) {
658 smx_process_t self = SIMIX_process_self();
660 /* Go to that function to follow the code flow through the simcall barrier */
661 if (0) SIMIX_rdv_create(name);
662 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
664 self->simcall.call = SIMCALL_RDV_CREATE;
665 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
666 memset(self->simcall.args, 0, sizeof(self->simcall.args));
667 self->simcall.args[0].cc = (const char*) name;
668 if (self != simix_global->maestro_process) {
669 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
670 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
671 SIMIX_process_yield(self);
673 SIMIX_simcall_handle(&self->simcall, 0);
675 return (smx_rdv_t) self->simcall.result.dp;
678 inline static void simcall_BODY_rdv_destroy(smx_rdv_t rdv) {
679 smx_process_t self = SIMIX_process_self();
681 /* Go to that function to follow the code flow through the simcall barrier */
682 if (0) SIMIX_rdv_destroy(rdv);
683 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
685 self->simcall.call = SIMCALL_RDV_DESTROY;
686 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
687 memset(self->simcall.args, 0, sizeof(self->simcall.args));
688 self->simcall.args[0].dp = (void*) rdv;
689 if (self != simix_global->maestro_process) {
690 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
691 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
692 SIMIX_process_yield(self);
694 SIMIX_simcall_handle(&self->simcall, 0);
699 inline static unsigned int simcall_BODY_rdv_comm_count_by_host(smx_rdv_t rdv, sg_host_t host) {
700 smx_process_t self = SIMIX_process_self();
702 /* Go to that function to follow the code flow through the simcall barrier */
703 if (0) SIMIX_rdv_comm_count_by_host(rdv, host);
704 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
706 self->simcall.call = SIMCALL_RDV_COMM_COUNT_BY_HOST;
707 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
708 memset(self->simcall.args, 0, sizeof(self->simcall.args));
709 self->simcall.args[0].dp = (void*) rdv;
710 self->simcall.args[1].dp = (void*) host;
711 if (self != simix_global->maestro_process) {
712 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
713 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
714 SIMIX_process_yield(self);
716 SIMIX_simcall_handle(&self->simcall, 0);
718 return (unsigned int) self->simcall.result.ui;
721 inline static smx_synchro_t simcall_BODY_rdv_get_head(smx_rdv_t rdv) {
722 smx_process_t self = SIMIX_process_self();
724 /* Go to that function to follow the code flow through the simcall barrier */
725 if (0) SIMIX_rdv_get_head(rdv);
726 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
728 self->simcall.call = SIMCALL_RDV_GET_HEAD;
729 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
730 memset(self->simcall.args, 0, sizeof(self->simcall.args));
731 self->simcall.args[0].dp = (void*) rdv;
732 if (self != simix_global->maestro_process) {
733 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
734 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
735 SIMIX_process_yield(self);
737 SIMIX_simcall_handle(&self->simcall, 0);
739 return (smx_synchro_t) self->simcall.result.dp;
742 inline static void simcall_BODY_rdv_set_receiver(smx_rdv_t rdv, smx_process_t receiver) {
743 smx_process_t self = SIMIX_process_self();
745 /* Go to that function to follow the code flow through the simcall barrier */
746 if (0) SIMIX_rdv_set_receiver(rdv, receiver);
747 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
749 self->simcall.call = SIMCALL_RDV_SET_RECEIVER;
750 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
751 memset(self->simcall.args, 0, sizeof(self->simcall.args));
752 self->simcall.args[0].dp = (void*) rdv;
753 self->simcall.args[1].dp = (void*) receiver;
754 if (self != simix_global->maestro_process) {
755 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
756 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
757 SIMIX_process_yield(self);
759 SIMIX_simcall_handle(&self->simcall, 0);
764 inline static smx_process_t simcall_BODY_rdv_get_receiver(smx_rdv_t rdv) {
765 smx_process_t self = SIMIX_process_self();
767 /* Go to that function to follow the code flow through the simcall barrier */
768 if (0) SIMIX_rdv_get_receiver(rdv);
769 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
771 self->simcall.call = SIMCALL_RDV_GET_RECEIVER;
772 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
773 memset(self->simcall.args, 0, sizeof(self->simcall.args));
774 self->simcall.args[0].dp = (void*) rdv;
775 if (self != simix_global->maestro_process) {
776 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
777 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
778 SIMIX_process_yield(self);
780 SIMIX_simcall_handle(&self->simcall, 0);
782 return (smx_process_t) self->simcall.result.dp;
785 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) {
786 smx_process_t self = SIMIX_process_self();
788 /* Go to that function to follow the code flow through the simcall barrier */
789 if (0) simcall_HANDLER_comm_iprobe(&self->simcall, rdv, type, src, tag, match_fun, data);
790 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
792 self->simcall.call = SIMCALL_COMM_IPROBE;
793 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
794 memset(self->simcall.args, 0, sizeof(self->simcall.args));
795 self->simcall.args[0].dp = (void*) rdv;
796 self->simcall.args[1].i = (int) type;
797 self->simcall.args[2].i = (int) src;
798 self->simcall.args[3].i = (int) tag;
799 self->simcall.args[4].fp = (FPtr) match_fun;
800 self->simcall.args[5].dp = (void*) data;
801 if (self != simix_global->maestro_process) {
802 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
803 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
804 SIMIX_process_yield(self);
806 SIMIX_simcall_handle(&self->simcall, 0);
808 return (smx_synchro_t) self->simcall.result.dp;
811 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) {
812 smx_process_t self = SIMIX_process_self();
814 /* Go to that function to follow the code flow through the simcall barrier */
815 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);
816 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
818 self->simcall.call = SIMCALL_COMM_SEND;
819 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
820 memset(self->simcall.args, 0, sizeof(self->simcall.args));
821 self->simcall.args[0].dp = (void*) sender;
822 self->simcall.args[1].dp = (void*) rdv;
823 self->simcall.args[2].d = (double) task_size;
824 self->simcall.args[3].d = (double) rate;
825 self->simcall.args[4].dp = (void*) src_buff;
826 self->simcall.args[5].sz = (size_t) src_buff_size;
827 self->simcall.args[6].fp = (FPtr) match_fun;
828 self->simcall.args[7].fp = (FPtr) copy_data_fun;
829 self->simcall.args[8].dp = (void*) data;
830 self->simcall.args[9].d = (double) timeout;
831 if (self != simix_global->maestro_process) {
832 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
833 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
834 SIMIX_process_yield(self);
836 SIMIX_simcall_handle(&self->simcall, 0);
841 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) {
842 smx_process_t self = SIMIX_process_self();
844 /* Go to that function to follow the code flow through the simcall barrier */
845 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);
846 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
848 self->simcall.call = SIMCALL_COMM_ISEND;
849 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
850 memset(self->simcall.args, 0, sizeof(self->simcall.args));
851 self->simcall.args[0].dp = (void*) sender;
852 self->simcall.args[1].dp = (void*) rdv;
853 self->simcall.args[2].d = (double) task_size;
854 self->simcall.args[3].d = (double) rate;
855 self->simcall.args[4].dp = (void*) src_buff;
856 self->simcall.args[5].sz = (size_t) src_buff_size;
857 self->simcall.args[6].fp = (FPtr) match_fun;
858 self->simcall.args[7].fp = (FPtr) clean_fun;
859 self->simcall.args[8].fp = (FPtr) copy_data_fun;
860 self->simcall.args[9].dp = (void*) data;
861 self->simcall.args[10].i = (int) detached;
862 if (self != simix_global->maestro_process) {
863 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
864 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
865 SIMIX_process_yield(self);
867 SIMIX_simcall_handle(&self->simcall, 0);
869 return (smx_synchro_t) self->simcall.result.dp;
872 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) {
873 smx_process_t self = SIMIX_process_self();
875 /* Go to that function to follow the code flow through the simcall barrier */
876 if (0) simcall_HANDLER_comm_recv(&self->simcall, receiver, rdv, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, timeout, rate);
877 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
879 self->simcall.call = SIMCALL_COMM_RECV;
880 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
881 memset(self->simcall.args, 0, sizeof(self->simcall.args));
882 self->simcall.args[0].dp = (void*) receiver;
883 self->simcall.args[1].dp = (void*) rdv;
884 self->simcall.args[2].dp = (void*) dst_buff;
885 self->simcall.args[3].dp = (void*) dst_buff_size;
886 self->simcall.args[4].fp = (FPtr) match_fun;
887 self->simcall.args[5].fp = (FPtr) copy_data_fun;
888 self->simcall.args[6].dp = (void*) data;
889 self->simcall.args[7].d = (double) timeout;
890 self->simcall.args[8].d = (double) rate;
891 if (self != simix_global->maestro_process) {
892 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
893 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
894 SIMIX_process_yield(self);
896 SIMIX_simcall_handle(&self->simcall, 0);
901 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) {
902 smx_process_t self = SIMIX_process_self();
904 /* Go to that function to follow the code flow through the simcall barrier */
905 if (0) simcall_HANDLER_comm_irecv(&self->simcall, receiver, rdv, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, rate);
906 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
908 self->simcall.call = SIMCALL_COMM_IRECV;
909 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
910 memset(self->simcall.args, 0, sizeof(self->simcall.args));
911 self->simcall.args[0].dp = (void*) receiver;
912 self->simcall.args[1].dp = (void*) rdv;
913 self->simcall.args[2].dp = (void*) dst_buff;
914 self->simcall.args[3].dp = (void*) dst_buff_size;
915 self->simcall.args[4].fp = (FPtr) match_fun;
916 self->simcall.args[5].fp = (FPtr) copy_data_fun;
917 self->simcall.args[6].dp = (void*) data;
918 self->simcall.args[7].d = (double) rate;
919 if (self != simix_global->maestro_process) {
920 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
921 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
922 SIMIX_process_yield(self);
924 SIMIX_simcall_handle(&self->simcall, 0);
926 return (smx_synchro_t) self->simcall.result.dp;
929 inline static void simcall_BODY_comm_cancel(smx_synchro_t comm) {
930 smx_process_t self = SIMIX_process_self();
932 /* Go to that function to follow the code flow through the simcall barrier */
933 if (0) SIMIX_comm_cancel(comm);
934 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
936 self->simcall.call = SIMCALL_COMM_CANCEL;
937 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
938 memset(self->simcall.args, 0, sizeof(self->simcall.args));
939 self->simcall.args[0].dp = (void*) comm;
940 if (self != simix_global->maestro_process) {
941 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
942 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
943 SIMIX_process_yield(self);
945 SIMIX_simcall_handle(&self->simcall, 0);
950 inline static int simcall_BODY_comm_waitany(xbt_dynar_t comms) {
951 smx_process_t self = SIMIX_process_self();
953 /* Go to that function to follow the code flow through the simcall barrier */
954 if (0) simcall_HANDLER_comm_waitany(&self->simcall, comms);
955 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
957 self->simcall.call = SIMCALL_COMM_WAITANY;
958 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
959 memset(self->simcall.args, 0, sizeof(self->simcall.args));
960 self->simcall.args[0].dp = (void*) comms;
961 if (self != simix_global->maestro_process) {
962 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
963 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
964 SIMIX_process_yield(self);
966 SIMIX_simcall_handle(&self->simcall, 0);
968 return (int) self->simcall.result.i;
971 inline static void simcall_BODY_comm_wait(smx_synchro_t comm, double timeout) {
972 smx_process_t self = SIMIX_process_self();
974 /* Go to that function to follow the code flow through the simcall barrier */
975 if (0) simcall_HANDLER_comm_wait(&self->simcall, comm, timeout);
976 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
978 self->simcall.call = SIMCALL_COMM_WAIT;
979 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
980 memset(self->simcall.args, 0, sizeof(self->simcall.args));
981 self->simcall.args[0].dp = (void*) comm;
982 self->simcall.args[1].d = (double) timeout;
983 if (self != simix_global->maestro_process) {
984 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
985 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
986 SIMIX_process_yield(self);
988 SIMIX_simcall_handle(&self->simcall, 0);
993 inline static int simcall_BODY_comm_test(smx_synchro_t comm) {
994 smx_process_t self = SIMIX_process_self();
996 /* Go to that function to follow the code flow through the simcall barrier */
997 if (0) simcall_HANDLER_comm_test(&self->simcall, comm);
998 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1000 self->simcall.call = SIMCALL_COMM_TEST;
1001 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1002 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1003 self->simcall.args[0].dp = (void*) comm;
1004 if (self != simix_global->maestro_process) {
1005 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1006 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1007 SIMIX_process_yield(self);
1009 SIMIX_simcall_handle(&self->simcall, 0);
1011 return (int) self->simcall.result.i;
1014 inline static int simcall_BODY_comm_testany(xbt_dynar_t comms) {
1015 smx_process_t self = SIMIX_process_self();
1017 /* Go to that function to follow the code flow through the simcall barrier */
1018 if (0) simcall_HANDLER_comm_testany(&self->simcall, comms);
1019 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1021 self->simcall.call = SIMCALL_COMM_TESTANY;
1022 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1023 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1024 self->simcall.args[0].dp = (void*) comms;
1025 if (self != simix_global->maestro_process) {
1026 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1027 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1028 SIMIX_process_yield(self);
1030 SIMIX_simcall_handle(&self->simcall, 0);
1032 return (int) self->simcall.result.i;
1035 inline static double simcall_BODY_comm_get_remains(smx_synchro_t comm) {
1036 smx_process_t self = SIMIX_process_self();
1038 /* Go to that function to follow the code flow through the simcall barrier */
1039 if (0) SIMIX_comm_get_remains(comm);
1040 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1042 self->simcall.call = SIMCALL_COMM_GET_REMAINS;
1043 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1044 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1045 self->simcall.args[0].dp = (void*) comm;
1046 if (self != simix_global->maestro_process) {
1047 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1048 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1049 SIMIX_process_yield(self);
1051 SIMIX_simcall_handle(&self->simcall, 0);
1053 return (double) self->simcall.result.d;
1056 inline static e_smx_state_t simcall_BODY_comm_get_state(smx_synchro_t comm) {
1057 smx_process_t self = SIMIX_process_self();
1059 /* Go to that function to follow the code flow through the simcall barrier */
1060 if (0) SIMIX_comm_get_state(comm);
1061 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1063 self->simcall.call = SIMCALL_COMM_GET_STATE;
1064 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1065 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1066 self->simcall.args[0].dp = (void*) comm;
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);
1072 SIMIX_simcall_handle(&self->simcall, 0);
1074 return (e_smx_state_t) self->simcall.result.i;
1077 inline static void* simcall_BODY_comm_get_src_data(smx_synchro_t comm) {
1078 smx_process_t self = SIMIX_process_self();
1080 /* Go to that function to follow the code flow through the simcall barrier */
1081 if (0) SIMIX_comm_get_src_data(comm);
1082 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1084 self->simcall.call = SIMCALL_COMM_GET_SRC_DATA;
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].dp = (void*) comm;
1088 if (self != simix_global->maestro_process) {
1089 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1090 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1091 SIMIX_process_yield(self);
1093 SIMIX_simcall_handle(&self->simcall, 0);
1095 return (void*) self->simcall.result.dp;
1098 inline static void* simcall_BODY_comm_get_dst_data(smx_synchro_t comm) {
1099 smx_process_t self = SIMIX_process_self();
1101 /* Go to that function to follow the code flow through the simcall barrier */
1102 if (0) SIMIX_comm_get_dst_data(comm);
1103 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1105 self->simcall.call = SIMCALL_COMM_GET_DST_DATA;
1106 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1107 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1108 self->simcall.args[0].dp = (void*) comm;
1109 if (self != simix_global->maestro_process) {
1110 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1111 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1112 SIMIX_process_yield(self);
1114 SIMIX_simcall_handle(&self->simcall, 0);
1116 return (void*) self->simcall.result.dp;
1119 inline static smx_process_t simcall_BODY_comm_get_src_proc(smx_synchro_t comm) {
1120 smx_process_t self = SIMIX_process_self();
1122 /* Go to that function to follow the code flow through the simcall barrier */
1123 if (0) SIMIX_comm_get_src_proc(comm);
1124 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1126 self->simcall.call = SIMCALL_COMM_GET_SRC_PROC;
1127 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1128 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1129 self->simcall.args[0].dp = (void*) comm;
1130 if (self != simix_global->maestro_process) {
1131 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1132 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1133 SIMIX_process_yield(self);
1135 SIMIX_simcall_handle(&self->simcall, 0);
1137 return (smx_process_t) self->simcall.result.dp;
1140 inline static smx_process_t simcall_BODY_comm_get_dst_proc(smx_synchro_t comm) {
1141 smx_process_t self = SIMIX_process_self();
1143 /* Go to that function to follow the code flow through the simcall barrier */
1144 if (0) SIMIX_comm_get_dst_proc(comm);
1145 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1147 self->simcall.call = SIMCALL_COMM_GET_DST_PROC;
1148 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1149 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1150 self->simcall.args[0].dp = (void*) comm;
1151 if (self != simix_global->maestro_process) {
1152 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1153 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1154 SIMIX_process_yield(self);
1156 SIMIX_simcall_handle(&self->simcall, 0);
1158 return (smx_process_t) self->simcall.result.dp;
1161 inline static smx_mutex_t simcall_BODY_mutex_init() {
1162 smx_process_t self = SIMIX_process_self();
1164 /* Go to that function to follow the code flow through the simcall barrier */
1165 if (0) simcall_HANDLER_mutex_init(&self->simcall);
1166 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1168 self->simcall.call = SIMCALL_MUTEX_INIT;
1169 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1170 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1172 if (self != simix_global->maestro_process) {
1173 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1174 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1175 SIMIX_process_yield(self);
1177 SIMIX_simcall_handle(&self->simcall, 0);
1179 return (smx_mutex_t) self->simcall.result.dp;
1182 inline static void simcall_BODY_mutex_destroy(smx_mutex_t mutex) {
1183 smx_process_t self = SIMIX_process_self();
1185 /* Go to that function to follow the code flow through the simcall barrier */
1186 if (0) SIMIX_mutex_destroy(mutex);
1187 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1189 self->simcall.call = SIMCALL_MUTEX_DESTROY;
1190 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1191 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1192 self->simcall.args[0].dp = (void*) mutex;
1193 if (self != simix_global->maestro_process) {
1194 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1195 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1196 SIMIX_process_yield(self);
1198 SIMIX_simcall_handle(&self->simcall, 0);
1203 inline static void simcall_BODY_mutex_lock(smx_mutex_t mutex) {
1204 smx_process_t self = SIMIX_process_self();
1206 /* Go to that function to follow the code flow through the simcall barrier */
1207 if (0) simcall_HANDLER_mutex_lock(&self->simcall, mutex);
1208 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1210 self->simcall.call = SIMCALL_MUTEX_LOCK;
1211 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1212 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1213 self->simcall.args[0].dp = (void*) mutex;
1214 if (self != simix_global->maestro_process) {
1215 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1216 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1217 SIMIX_process_yield(self);
1219 SIMIX_simcall_handle(&self->simcall, 0);
1224 inline static int simcall_BODY_mutex_trylock(smx_mutex_t mutex) {
1225 smx_process_t self = SIMIX_process_self();
1227 /* Go to that function to follow the code flow through the simcall barrier */
1228 if (0) simcall_HANDLER_mutex_trylock(&self->simcall, mutex);
1229 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1231 self->simcall.call = SIMCALL_MUTEX_TRYLOCK;
1232 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1233 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1234 self->simcall.args[0].dp = (void*) mutex;
1235 if (self != simix_global->maestro_process) {
1236 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1237 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1238 SIMIX_process_yield(self);
1240 SIMIX_simcall_handle(&self->simcall, 0);
1242 return (int) self->simcall.result.i;
1245 inline static void simcall_BODY_mutex_unlock(smx_mutex_t mutex) {
1246 smx_process_t self = SIMIX_process_self();
1248 /* Go to that function to follow the code flow through the simcall barrier */
1249 if (0) simcall_HANDLER_mutex_unlock(&self->simcall, mutex);
1250 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1252 self->simcall.call = SIMCALL_MUTEX_UNLOCK;
1253 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1254 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1255 self->simcall.args[0].dp = (void*) mutex;
1256 if (self != simix_global->maestro_process) {
1257 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1258 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1259 SIMIX_process_yield(self);
1261 SIMIX_simcall_handle(&self->simcall, 0);
1266 inline static smx_cond_t simcall_BODY_cond_init() {
1267 smx_process_t self = SIMIX_process_self();
1269 /* Go to that function to follow the code flow through the simcall barrier */
1270 if (0) SIMIX_cond_init();
1271 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1273 self->simcall.call = SIMCALL_COND_INIT;
1274 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1275 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1277 if (self != simix_global->maestro_process) {
1278 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1279 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1280 SIMIX_process_yield(self);
1282 SIMIX_simcall_handle(&self->simcall, 0);
1284 return (smx_cond_t) self->simcall.result.dp;
1287 inline static void simcall_BODY_cond_destroy(smx_cond_t cond) {
1288 smx_process_t self = SIMIX_process_self();
1290 /* Go to that function to follow the code flow through the simcall barrier */
1291 if (0) SIMIX_cond_destroy(cond);
1292 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1294 self->simcall.call = SIMCALL_COND_DESTROY;
1295 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1296 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1297 self->simcall.args[0].dp = (void*) cond;
1298 if (self != simix_global->maestro_process) {
1299 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1300 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1301 SIMIX_process_yield(self);
1303 SIMIX_simcall_handle(&self->simcall, 0);
1308 inline static void simcall_BODY_cond_signal(smx_cond_t cond) {
1309 smx_process_t self = SIMIX_process_self();
1311 /* Go to that function to follow the code flow through the simcall barrier */
1312 if (0) SIMIX_cond_signal(cond);
1313 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1315 self->simcall.call = SIMCALL_COND_SIGNAL;
1316 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1317 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1318 self->simcall.args[0].dp = (void*) cond;
1319 if (self != simix_global->maestro_process) {
1320 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1321 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1322 SIMIX_process_yield(self);
1324 SIMIX_simcall_handle(&self->simcall, 0);
1329 inline static void simcall_BODY_cond_wait(smx_cond_t cond, smx_mutex_t mutex) {
1330 smx_process_t self = SIMIX_process_self();
1332 /* Go to that function to follow the code flow through the simcall barrier */
1333 if (0) simcall_HANDLER_cond_wait(&self->simcall, cond, mutex);
1334 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1336 self->simcall.call = SIMCALL_COND_WAIT;
1337 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1338 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1339 self->simcall.args[0].dp = (void*) cond;
1340 self->simcall.args[1].dp = (void*) mutex;
1341 if (self != simix_global->maestro_process) {
1342 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1343 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1344 SIMIX_process_yield(self);
1346 SIMIX_simcall_handle(&self->simcall, 0);
1351 inline static void simcall_BODY_cond_wait_timeout(smx_cond_t cond, smx_mutex_t mutex, double timeout) {
1352 smx_process_t self = SIMIX_process_self();
1354 /* Go to that function to follow the code flow through the simcall barrier */
1355 if (0) simcall_HANDLER_cond_wait_timeout(&self->simcall, cond, mutex, timeout);
1356 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1358 self->simcall.call = SIMCALL_COND_WAIT_TIMEOUT;
1359 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1360 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1361 self->simcall.args[0].dp = (void*) cond;
1362 self->simcall.args[1].dp = (void*) mutex;
1363 self->simcall.args[2].d = (double) timeout;
1364 if (self != simix_global->maestro_process) {
1365 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1366 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1367 SIMIX_process_yield(self);
1369 SIMIX_simcall_handle(&self->simcall, 0);
1374 inline static void simcall_BODY_cond_broadcast(smx_cond_t cond) {
1375 smx_process_t self = SIMIX_process_self();
1377 /* Go to that function to follow the code flow through the simcall barrier */
1378 if (0) SIMIX_cond_broadcast(cond);
1379 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1381 self->simcall.call = SIMCALL_COND_BROADCAST;
1382 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1383 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1384 self->simcall.args[0].dp = (void*) cond;
1385 if (self != simix_global->maestro_process) {
1386 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1387 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1388 SIMIX_process_yield(self);
1390 SIMIX_simcall_handle(&self->simcall, 0);
1395 inline static smx_sem_t simcall_BODY_sem_init(unsigned int capacity) {
1396 smx_process_t self = SIMIX_process_self();
1398 /* Go to that function to follow the code flow through the simcall barrier */
1399 if (0) SIMIX_sem_init(capacity);
1400 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1402 self->simcall.call = SIMCALL_SEM_INIT;
1403 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1404 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1405 self->simcall.args[0].ui = (unsigned int) capacity;
1406 if (self != simix_global->maestro_process) {
1407 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1408 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1409 SIMIX_process_yield(self);
1411 SIMIX_simcall_handle(&self->simcall, 0);
1413 return (smx_sem_t) self->simcall.result.dp;
1416 inline static void simcall_BODY_sem_destroy(smx_sem_t sem) {
1417 smx_process_t self = SIMIX_process_self();
1419 /* Go to that function to follow the code flow through the simcall barrier */
1420 if (0) SIMIX_sem_destroy(sem);
1421 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1423 self->simcall.call = SIMCALL_SEM_DESTROY;
1424 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1425 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1426 self->simcall.args[0].dp = (void*) sem;
1427 if (self != simix_global->maestro_process) {
1428 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1429 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1430 SIMIX_process_yield(self);
1432 SIMIX_simcall_handle(&self->simcall, 0);
1437 inline static void simcall_BODY_sem_release(smx_sem_t sem) {
1438 smx_process_t self = SIMIX_process_self();
1440 /* Go to that function to follow the code flow through the simcall barrier */
1441 if (0) simcall_HANDLER_sem_release(&self->simcall, sem);
1442 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1444 self->simcall.call = SIMCALL_SEM_RELEASE;
1445 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1446 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1447 self->simcall.args[0].dp = (void*) sem;
1448 if (self != simix_global->maestro_process) {
1449 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1450 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1451 SIMIX_process_yield(self);
1453 SIMIX_simcall_handle(&self->simcall, 0);
1458 inline static int simcall_BODY_sem_would_block(smx_sem_t sem) {
1459 smx_process_t self = SIMIX_process_self();
1461 /* Go to that function to follow the code flow through the simcall barrier */
1462 if (0) simcall_HANDLER_sem_would_block(&self->simcall, sem);
1463 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1465 self->simcall.call = SIMCALL_SEM_WOULD_BLOCK;
1466 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1467 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1468 self->simcall.args[0].dp = (void*) sem;
1469 if (self != simix_global->maestro_process) {
1470 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1471 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1472 SIMIX_process_yield(self);
1474 SIMIX_simcall_handle(&self->simcall, 0);
1476 return (int) self->simcall.result.i;
1479 inline static void simcall_BODY_sem_acquire(smx_sem_t sem) {
1480 smx_process_t self = SIMIX_process_self();
1482 /* Go to that function to follow the code flow through the simcall barrier */
1483 if (0) simcall_HANDLER_sem_acquire(&self->simcall, sem);
1484 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1486 self->simcall.call = SIMCALL_SEM_ACQUIRE;
1487 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1488 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1489 self->simcall.args[0].dp = (void*) sem;
1490 if (self != simix_global->maestro_process) {
1491 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1492 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1493 SIMIX_process_yield(self);
1495 SIMIX_simcall_handle(&self->simcall, 0);
1500 inline static void simcall_BODY_sem_acquire_timeout(smx_sem_t sem, double timeout) {
1501 smx_process_t self = SIMIX_process_self();
1503 /* Go to that function to follow the code flow through the simcall barrier */
1504 if (0) simcall_HANDLER_sem_acquire_timeout(&self->simcall, sem, timeout);
1505 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1507 self->simcall.call = SIMCALL_SEM_ACQUIRE_TIMEOUT;
1508 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1509 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1510 self->simcall.args[0].dp = (void*) sem;
1511 self->simcall.args[1].d = (double) timeout;
1512 if (self != simix_global->maestro_process) {
1513 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1514 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1515 SIMIX_process_yield(self);
1517 SIMIX_simcall_handle(&self->simcall, 0);
1522 inline static int simcall_BODY_sem_get_capacity(smx_sem_t sem) {
1523 smx_process_t self = SIMIX_process_self();
1525 /* Go to that function to follow the code flow through the simcall barrier */
1526 if (0) simcall_HANDLER_sem_get_capacity(&self->simcall, sem);
1527 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1529 self->simcall.call = SIMCALL_SEM_GET_CAPACITY;
1530 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1531 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1532 self->simcall.args[0].dp = (void*) sem;
1533 if (self != simix_global->maestro_process) {
1534 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1535 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1536 SIMIX_process_yield(self);
1538 SIMIX_simcall_handle(&self->simcall, 0);
1540 return (int) self->simcall.result.i;
1543 inline static sg_size_t simcall_BODY_file_read(smx_file_t fd, sg_size_t size, sg_host_t host) {
1544 smx_process_t self = SIMIX_process_self();
1546 /* Go to that function to follow the code flow through the simcall barrier */
1547 if (0) simcall_HANDLER_file_read(&self->simcall, fd, size, host);
1548 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1550 self->simcall.call = SIMCALL_FILE_READ;
1551 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1552 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1553 self->simcall.args[0].dp = (void*) fd;
1554 self->simcall.args[1].sgsz = (sg_size_t) size;
1555 self->simcall.args[2].dp = (void*) host;
1556 if (self != simix_global->maestro_process) {
1557 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1558 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1559 SIMIX_process_yield(self);
1561 SIMIX_simcall_handle(&self->simcall, 0);
1563 return (sg_size_t) self->simcall.result.sgsz;
1566 inline static sg_size_t simcall_BODY_file_write(smx_file_t fd, sg_size_t size, sg_host_t host) {
1567 smx_process_t self = SIMIX_process_self();
1569 /* Go to that function to follow the code flow through the simcall barrier */
1570 if (0) simcall_HANDLER_file_write(&self->simcall, fd, size, host);
1571 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1573 self->simcall.call = SIMCALL_FILE_WRITE;
1574 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1575 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1576 self->simcall.args[0].dp = (void*) fd;
1577 self->simcall.args[1].sgsz = (sg_size_t) size;
1578 self->simcall.args[2].dp = (void*) host;
1579 if (self != simix_global->maestro_process) {
1580 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1581 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1582 SIMIX_process_yield(self);
1584 SIMIX_simcall_handle(&self->simcall, 0);
1586 return (sg_size_t) self->simcall.result.sgsz;
1589 inline static smx_file_t simcall_BODY_file_open(const char* fullpath, sg_host_t host) {
1590 smx_process_t self = SIMIX_process_self();
1592 /* Go to that function to follow the code flow through the simcall barrier */
1593 if (0) simcall_HANDLER_file_open(&self->simcall, fullpath, host);
1594 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1596 self->simcall.call = SIMCALL_FILE_OPEN;
1597 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1598 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1599 self->simcall.args[0].cc = (const char*) fullpath;
1600 self->simcall.args[1].dp = (void*) host;
1601 if (self != simix_global->maestro_process) {
1602 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1603 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1604 SIMIX_process_yield(self);
1606 SIMIX_simcall_handle(&self->simcall, 0);
1608 return (smx_file_t) self->simcall.result.dp;
1611 inline static int simcall_BODY_file_close(smx_file_t fd, sg_host_t host) {
1612 smx_process_t self = SIMIX_process_self();
1614 /* Go to that function to follow the code flow through the simcall barrier */
1615 if (0) simcall_HANDLER_file_close(&self->simcall, fd, host);
1616 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1618 self->simcall.call = SIMCALL_FILE_CLOSE;
1619 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1620 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1621 self->simcall.args[0].dp = (void*) fd;
1622 self->simcall.args[1].dp = (void*) host;
1623 if (self != simix_global->maestro_process) {
1624 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1625 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1626 SIMIX_process_yield(self);
1628 SIMIX_simcall_handle(&self->simcall, 0);
1630 return (int) self->simcall.result.i;
1633 inline static int simcall_BODY_file_unlink(smx_file_t fd, sg_host_t host) {
1634 smx_process_t self = SIMIX_process_self();
1636 /* Go to that function to follow the code flow through the simcall barrier */
1637 if (0) SIMIX_file_unlink(fd, host);
1638 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1640 self->simcall.call = SIMCALL_FILE_UNLINK;
1641 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1642 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1643 self->simcall.args[0].dp = (void*) fd;
1644 self->simcall.args[1].dp = (void*) host;
1645 if (self != simix_global->maestro_process) {
1646 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1647 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1648 SIMIX_process_yield(self);
1650 SIMIX_simcall_handle(&self->simcall, 0);
1652 return (int) self->simcall.result.i;
1655 inline static sg_size_t simcall_BODY_file_get_size(smx_file_t fd) {
1656 smx_process_t self = SIMIX_process_self();
1658 /* Go to that function to follow the code flow through the simcall barrier */
1659 if (0) simcall_HANDLER_file_get_size(&self->simcall, fd);
1660 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1662 self->simcall.call = SIMCALL_FILE_GET_SIZE;
1663 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1664 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1665 self->simcall.args[0].dp = (void*) fd;
1666 if (self != simix_global->maestro_process) {
1667 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1668 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1669 SIMIX_process_yield(self);
1671 SIMIX_simcall_handle(&self->simcall, 0);
1673 return (sg_size_t) self->simcall.result.sgsz;
1676 inline static sg_size_t simcall_BODY_file_tell(smx_file_t fd) {
1677 smx_process_t self = SIMIX_process_self();
1679 /* Go to that function to follow the code flow through the simcall barrier */
1680 if (0) simcall_HANDLER_file_tell(&self->simcall, fd);
1681 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1683 self->simcall.call = SIMCALL_FILE_TELL;
1684 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1685 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1686 self->simcall.args[0].dp = (void*) fd;
1687 if (self != simix_global->maestro_process) {
1688 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1689 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1690 SIMIX_process_yield(self);
1692 SIMIX_simcall_handle(&self->simcall, 0);
1694 return (sg_size_t) self->simcall.result.sgsz;
1697 inline static int simcall_BODY_file_seek(smx_file_t fd, sg_offset_t offset, int origin) {
1698 smx_process_t self = SIMIX_process_self();
1700 /* Go to that function to follow the code flow through the simcall barrier */
1701 if (0) simcall_HANDLER_file_seek(&self->simcall, fd, offset, origin);
1702 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1704 self->simcall.call = SIMCALL_FILE_SEEK;
1705 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1706 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1707 self->simcall.args[0].dp = (void*) fd;
1708 self->simcall.args[1].sgoff = (sg_offset_t) offset;
1709 self->simcall.args[2].i = (int) origin;
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);
1715 SIMIX_simcall_handle(&self->simcall, 0);
1717 return (int) self->simcall.result.i;
1720 inline static xbt_dynar_t simcall_BODY_file_get_info(smx_file_t fd) {
1721 smx_process_t self = SIMIX_process_self();
1723 /* Go to that function to follow the code flow through the simcall barrier */
1724 if (0) simcall_HANDLER_file_get_info(&self->simcall, fd);
1725 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1727 self->simcall.call = SIMCALL_FILE_GET_INFO;
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*) fd;
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);
1736 SIMIX_simcall_handle(&self->simcall, 0);
1738 return (xbt_dynar_t) self->simcall.result.dp;
1741 inline static int simcall_BODY_file_move(smx_file_t fd, const char* fullpath) {
1742 smx_process_t self = SIMIX_process_self();
1744 /* Go to that function to follow the code flow through the simcall barrier */
1745 if (0) simcall_HANDLER_file_move(&self->simcall, fd, fullpath);
1746 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1748 self->simcall.call = SIMCALL_FILE_MOVE;
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*) fd;
1752 self->simcall.args[1].cc = (const char*) fullpath;
1753 if (self != simix_global->maestro_process) {
1754 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1755 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1756 SIMIX_process_yield(self);
1758 SIMIX_simcall_handle(&self->simcall, 0);
1760 return (int) self->simcall.result.i;
1763 inline static sg_size_t simcall_BODY_storage_get_free_size(smx_storage_t storage) {
1764 smx_process_t self = SIMIX_process_self();
1766 /* Go to that function to follow the code flow through the simcall barrier */
1767 if (0) simcall_HANDLER_storage_get_free_size(&self->simcall, storage);
1768 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1770 self->simcall.call = SIMCALL_STORAGE_GET_FREE_SIZE;
1771 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1772 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1773 self->simcall.args[0].dp = (void*) storage;
1774 if (self != simix_global->maestro_process) {
1775 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1776 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1777 SIMIX_process_yield(self);
1779 SIMIX_simcall_handle(&self->simcall, 0);
1781 return (sg_size_t) self->simcall.result.sgsz;
1784 inline static sg_size_t simcall_BODY_storage_get_used_size(smx_storage_t name) {
1785 smx_process_t self = SIMIX_process_self();
1787 /* Go to that function to follow the code flow through the simcall barrier */
1788 if (0) simcall_HANDLER_storage_get_used_size(&self->simcall, name);
1789 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1791 self->simcall.call = SIMCALL_STORAGE_GET_USED_SIZE;
1792 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1793 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1794 self->simcall.args[0].dp = (void*) name;
1795 if (self != simix_global->maestro_process) {
1796 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1797 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1798 SIMIX_process_yield(self);
1800 SIMIX_simcall_handle(&self->simcall, 0);
1802 return (sg_size_t) self->simcall.result.sgsz;
1805 inline static xbt_dict_t simcall_BODY_storage_get_properties(smx_storage_t storage) {
1806 smx_process_t self = SIMIX_process_self();
1808 /* Go to that function to follow the code flow through the simcall barrier */
1809 if (0) SIMIX_storage_get_properties(storage);
1810 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1812 self->simcall.call = SIMCALL_STORAGE_GET_PROPERTIES;
1813 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1814 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1815 self->simcall.args[0].dp = (void*) storage;
1816 if (self != simix_global->maestro_process) {
1817 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1818 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1819 SIMIX_process_yield(self);
1821 SIMIX_simcall_handle(&self->simcall, 0);
1823 return (xbt_dict_t) self->simcall.result.dp;
1826 inline static xbt_dict_t simcall_BODY_storage_get_content(smx_storage_t storage) {
1827 smx_process_t self = SIMIX_process_self();
1829 /* Go to that function to follow the code flow through the simcall barrier */
1830 if (0) SIMIX_storage_get_content(storage);
1831 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1833 self->simcall.call = SIMCALL_STORAGE_GET_CONTENT;
1834 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1835 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1836 self->simcall.args[0].dp = (void*) storage;
1837 if (self != simix_global->maestro_process) {
1838 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1839 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1840 SIMIX_process_yield(self);
1842 SIMIX_simcall_handle(&self->simcall, 0);
1844 return (xbt_dict_t) self->simcall.result.dp;
1847 inline static xbt_dict_t simcall_BODY_asr_get_properties(const char* name) {
1848 smx_process_t self = SIMIX_process_self();
1850 /* Go to that function to follow the code flow through the simcall barrier */
1851 if (0) simcall_HANDLER_asr_get_properties(&self->simcall, name);
1852 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1854 self->simcall.call = SIMCALL_ASR_GET_PROPERTIES;
1855 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1856 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1857 self->simcall.args[0].cc = (const char*) name;
1858 if (self != simix_global->maestro_process) {
1859 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1860 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1861 SIMIX_process_yield(self);
1863 SIMIX_simcall_handle(&self->simcall, 0);
1865 return (xbt_dict_t) self->simcall.result.dp;
1868 inline static int simcall_BODY_mc_random(int min, int max) {
1869 smx_process_t self = SIMIX_process_self();
1871 /* Go to that function to follow the code flow through the simcall barrier */
1872 if (0) simcall_HANDLER_mc_random(&self->simcall, min, max);
1873 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1875 self->simcall.call = SIMCALL_MC_RANDOM;
1876 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1877 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1878 self->simcall.args[0].i = (int) min;
1879 self->simcall.args[1].i = (int) max;
1880 if (self != simix_global->maestro_process) {
1881 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1882 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1883 SIMIX_process_yield(self);
1885 SIMIX_simcall_handle(&self->simcall, 0);
1887 return (int) self->simcall.result.i;
1890 inline static void simcall_BODY_set_category(smx_synchro_t synchro, const char* category) {
1891 smx_process_t self = SIMIX_process_self();
1893 /* Go to that function to follow the code flow through the simcall barrier */
1894 if (0) SIMIX_set_category(synchro, category);
1895 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1897 self->simcall.call = SIMCALL_SET_CATEGORY;
1898 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1899 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1900 self->simcall.args[0].dp = (void*) synchro;
1901 self->simcall.args[1].cc = (const char*) category;
1902 if (self != simix_global->maestro_process) {
1903 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1904 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1905 SIMIX_process_yield(self);
1907 SIMIX_simcall_handle(&self->simcall, 0);
1912 inline static void simcall_BODY_run_kernel(void* code) {
1913 smx_process_t self = SIMIX_process_self();
1915 /* Go to that function to follow the code flow through the simcall barrier */
1916 if (0) SIMIX_run_kernel(code);
1917 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1919 self->simcall.call = SIMCALL_RUN_KERNEL;
1920 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1921 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1922 self->simcall.args[0].dp = (void*) code;
1923 if (self != simix_global->maestro_process) {
1924 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1925 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1926 SIMIX_process_yield(self);
1928 SIMIX_simcall_handle(&self->simcall, 0);
1932 #ifdef HAVE_LATENCY_BOUND_TRACKING
1934 inline static int simcall_BODY_comm_is_latency_bounded(smx_synchro_t comm) {
1935 smx_process_t self = SIMIX_process_self();
1937 /* Go to that function to follow the code flow through the simcall barrier */
1938 if (0) SIMIX_comm_is_latency_bounded(comm);
1939 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1941 self->simcall.call = SIMCALL_COMM_IS_LATENCY_BOUNDED;
1942 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1943 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1944 self->simcall.args[0].dp = (void*) comm;
1945 if (self != simix_global->maestro_process) {
1946 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1947 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1948 SIMIX_process_yield(self);
1950 SIMIX_simcall_handle(&self->simcall, 0);
1952 return (int) self->simcall.result.i;
1958 inline static mc_snapshot_t simcall_BODY_mc_snapshot() {
1959 smx_process_t self = SIMIX_process_self();
1961 /* Go to that function to follow the code flow through the simcall barrier */
1962 if (0) simcall_HANDLER_mc_snapshot(&self->simcall);
1963 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1965 self->simcall.call = SIMCALL_MC_SNAPSHOT;
1966 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1967 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1969 if (self != simix_global->maestro_process) {
1970 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1971 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1972 SIMIX_process_yield(self);
1974 SIMIX_simcall_handle(&self->simcall, 0);
1976 return (mc_snapshot_t) self->simcall.result.dp;
1979 inline static int simcall_BODY_mc_compare_snapshots(mc_snapshot_t s1, mc_snapshot_t s2) {
1980 smx_process_t self = SIMIX_process_self();
1982 /* Go to that function to follow the code flow through the simcall barrier */
1983 if (0) simcall_HANDLER_mc_compare_snapshots(&self->simcall, s1, s2);
1984 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1986 self->simcall.call = SIMCALL_MC_COMPARE_SNAPSHOTS;
1987 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1988 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1989 self->simcall.args[0].dp = (void*) s1;
1990 self->simcall.args[1].dp = (void*) s2;
1991 if (self != simix_global->maestro_process) {
1992 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1993 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1994 SIMIX_process_yield(self);
1996 SIMIX_simcall_handle(&self->simcall, 0);
1998 return (int) self->simcall.result.i;