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.hpp"
19 #include <simgrid/simix.hpp>
21 inline static void simcall_BODY_vm_suspend(sg_host_t ind_vm) {
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_vm_suspend(&self->simcall, ind_vm);
26 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
28 self->simcall.call = SIMCALL_VM_SUSPEND;
29 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
30 memset(self->simcall.args, 0, sizeof(self->simcall.args));
31 self->simcall.args[0].dp = (void*) ind_vm;
32 if (self != simix_global->maestro_process) {
33 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
34 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
35 SIMIX_process_yield(self);
37 SIMIX_simcall_handle(&self->simcall, 0);
42 inline static void simcall_BODY_vm_resume(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_resume(&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_RESUME;
50 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
51 memset(self->simcall.args, 0, sizeof(self->simcall.args));
52 self->simcall.args[0].dp = (void*) ind_vm;
53 if (self != simix_global->maestro_process) {
54 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
55 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
56 SIMIX_process_yield(self);
58 SIMIX_simcall_handle(&self->simcall, 0);
63 inline static void simcall_BODY_vm_shutdown(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_shutdown(&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_SHUTDOWN;
71 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
72 memset(self->simcall.args, 0, sizeof(self->simcall.args));
73 self->simcall.args[0].dp = (void*) ind_vm;
74 if (self != simix_global->maestro_process) {
75 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
76 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
77 SIMIX_process_yield(self);
79 SIMIX_simcall_handle(&self->simcall, 0);
84 inline static void simcall_BODY_vm_save(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_save(&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_SAVE;
92 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
93 memset(self->simcall.args, 0, sizeof(self->simcall.args));
94 self->simcall.args[0].dp = (void*) ind_vm;
95 if (self != simix_global->maestro_process) {
96 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
97 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
98 SIMIX_process_yield(self);
100 SIMIX_simcall_handle(&self->simcall, 0);
105 inline static void simcall_BODY_vm_restore(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_restore(&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_RESTORE;
113 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
114 memset(self->simcall.args, 0, sizeof(self->simcall.args));
115 self->simcall.args[0].dp = (void*) ind_vm;
116 if (self != simix_global->maestro_process) {
117 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
118 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
119 SIMIX_process_yield(self);
121 SIMIX_simcall_handle(&self->simcall, 0);
126 inline static void* simcall_BODY_process_create(const char* name, xbt_main_func_t code, void* data, const char* hostname, double kill_time, int argc, char** argv, xbt_dict_t properties, int auto_restart) {
127 smx_process_t self = SIMIX_process_self();
129 /* Go to that function to follow the code flow through the simcall barrier */
130 if (0) simcall_HANDLER_process_create(&self->simcall, name, code, data, hostname, kill_time, argc, argv, properties, auto_restart);
131 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
133 self->simcall.call = SIMCALL_PROCESS_CREATE;
134 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
135 memset(self->simcall.args, 0, sizeof(self->simcall.args));
136 self->simcall.args[0].cc = (const char*) name;
137 self->simcall.args[1].fp = (FPtr) code;
138 self->simcall.args[2].dp = (void*) data;
139 self->simcall.args[3].cc = (const char*) hostname;
140 self->simcall.args[4].d = (double) kill_time;
141 self->simcall.args[5].i = (int) argc;
142 self->simcall.args[6].dp = (void*) argv;
143 self->simcall.args[7].dp = (void*) properties;
144 self->simcall.args[8].i = (int) auto_restart;
145 if (self != simix_global->maestro_process) {
146 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
147 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
148 SIMIX_process_yield(self);
150 SIMIX_simcall_handle(&self->simcall, 0);
152 return (void*) self->simcall.result.dp;
155 inline static void simcall_BODY_process_kill(smx_process_t process) {
156 smx_process_t self = SIMIX_process_self();
158 /* Go to that function to follow the code flow through the simcall barrier */
159 if (0) simcall_HANDLER_process_kill(&self->simcall, process);
160 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
162 self->simcall.call = SIMCALL_PROCESS_KILL;
163 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
164 memset(self->simcall.args, 0, sizeof(self->simcall.args));
165 self->simcall.args[0].dp = (void*) process;
166 if (self != simix_global->maestro_process) {
167 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
168 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
169 SIMIX_process_yield(self);
171 SIMIX_simcall_handle(&self->simcall, 0);
176 inline static void simcall_BODY_process_killall(int reset_pid) {
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_killall(&self->simcall, reset_pid);
181 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
183 self->simcall.call = SIMCALL_PROCESS_KILLALL;
184 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
185 memset(self->simcall.args, 0, sizeof(self->simcall.args));
186 self->simcall.args[0].i = (int) reset_pid;
187 if (self != simix_global->maestro_process) {
188 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
189 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
190 SIMIX_process_yield(self);
192 SIMIX_simcall_handle(&self->simcall, 0);
197 inline static void simcall_BODY_process_cleanup(smx_process_t process) {
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) SIMIX_process_cleanup(process);
202 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
204 self->simcall.call = SIMCALL_PROCESS_CLEANUP;
205 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
206 memset(self->simcall.args, 0, sizeof(self->simcall.args));
207 self->simcall.args[0].dp = (void*) process;
208 if (self != simix_global->maestro_process) {
209 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
210 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
211 SIMIX_process_yield(self);
213 SIMIX_simcall_handle(&self->simcall, 0);
218 inline static void simcall_BODY_process_suspend(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) simcall_HANDLER_process_suspend(&self->simcall, process);
223 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
225 self->simcall.call = SIMCALL_PROCESS_SUSPEND;
226 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
227 memset(self->simcall.args, 0, sizeof(self->simcall.args));
228 self->simcall.args[0].dp = (void*) process;
229 if (self != simix_global->maestro_process) {
230 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
231 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
232 SIMIX_process_yield(self);
234 SIMIX_simcall_handle(&self->simcall, 0);
239 inline static void simcall_BODY_process_resume(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_resume(&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_RESUME;
247 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
248 memset(self->simcall.args, 0, sizeof(self->simcall.args));
249 self->simcall.args[0].dp = (void*) process;
250 if (self != simix_global->maestro_process) {
251 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
252 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
253 SIMIX_process_yield(self);
255 SIMIX_simcall_handle(&self->simcall, 0);
260 inline static void simcall_BODY_process_set_host(smx_process_t process, sg_host_t dest) {
261 smx_process_t self = SIMIX_process_self();
263 /* Go to that function to follow the code flow through the simcall barrier */
264 if (0) simcall_HANDLER_process_set_host(&self->simcall, process, dest);
265 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
267 self->simcall.call = SIMCALL_PROCESS_SET_HOST;
268 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
269 memset(self->simcall.args, 0, sizeof(self->simcall.args));
270 self->simcall.args[0].dp = (void*) process;
271 self->simcall.args[1].dp = (void*) dest;
272 if (self != simix_global->maestro_process) {
273 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
274 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
275 SIMIX_process_yield(self);
277 SIMIX_simcall_handle(&self->simcall, 0);
282 inline static int simcall_BODY_process_is_suspended(smx_process_t process) {
283 smx_process_t self = SIMIX_process_self();
285 /* Go to that function to follow the code flow through the simcall barrier */
286 if (0) SIMIX_process_is_suspended(process);
287 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
289 self->simcall.call = SIMCALL_PROCESS_IS_SUSPENDED;
290 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
291 memset(self->simcall.args, 0, sizeof(self->simcall.args));
292 self->simcall.args[0].dp = (void*) process;
293 if (self != simix_global->maestro_process) {
294 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
295 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
296 SIMIX_process_yield(self);
298 SIMIX_simcall_handle(&self->simcall, 0);
300 return (int) self->simcall.result.i;
303 inline static int simcall_BODY_process_join(smx_process_t process, double timeout) {
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) simcall_HANDLER_process_join(&self->simcall, process, timeout);
308 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
310 self->simcall.call = SIMCALL_PROCESS_JOIN;
311 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
312 memset(self->simcall.args, 0, sizeof(self->simcall.args));
313 self->simcall.args[0].dp = (void*) process;
314 self->simcall.args[1].d = (double) timeout;
315 if (self != simix_global->maestro_process) {
316 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
317 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
318 SIMIX_process_yield(self);
320 SIMIX_simcall_handle(&self->simcall, 0);
322 return (int) self->simcall.result.i;
325 inline static int simcall_BODY_process_sleep(double duration) {
326 smx_process_t self = SIMIX_process_self();
328 /* Go to that function to follow the code flow through the simcall barrier */
329 if (0) simcall_HANDLER_process_sleep(&self->simcall, duration);
330 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
332 self->simcall.call = SIMCALL_PROCESS_SLEEP;
333 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
334 memset(self->simcall.args, 0, sizeof(self->simcall.args));
335 self->simcall.args[0].d = (double) duration;
336 if (self != simix_global->maestro_process) {
337 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
338 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
339 SIMIX_process_yield(self);
341 SIMIX_simcall_handle(&self->simcall, 0);
343 return (int) self->simcall.result.i;
346 inline static smx_synchro_t simcall_BODY_execution_start(const char* name, double flops_amount, double priority, double bound, unsigned long affinity_mask) {
347 smx_process_t self = SIMIX_process_self();
349 /* Go to that function to follow the code flow through the simcall barrier */
350 if (0) simcall_HANDLER_execution_start(&self->simcall, name, flops_amount, priority, bound, affinity_mask);
351 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
353 self->simcall.call = SIMCALL_EXECUTION_START;
354 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
355 memset(self->simcall.args, 0, sizeof(self->simcall.args));
356 self->simcall.args[0].cc = (const char*) name;
357 self->simcall.args[1].d = (double) flops_amount;
358 self->simcall.args[2].d = (double) priority;
359 self->simcall.args[3].d = (double) bound;
360 self->simcall.args[4].ul = (unsigned long) affinity_mask;
361 if (self != simix_global->maestro_process) {
362 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
363 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
364 SIMIX_process_yield(self);
366 SIMIX_simcall_handle(&self->simcall, 0);
368 return (smx_synchro_t) self->simcall.result.dp;
371 inline static smx_synchro_t simcall_BODY_execution_parallel_start(const char* name, int host_nb, sg_host_t* host_list, double* flops_amount, double* bytes_amount, double amount, double rate) {
372 smx_process_t self = SIMIX_process_self();
374 /* Go to that function to follow the code flow through the simcall barrier */
375 if (0) SIMIX_execution_parallel_start(name, host_nb, host_list, flops_amount, bytes_amount, amount, rate);
376 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
378 self->simcall.call = SIMCALL_EXECUTION_PARALLEL_START;
379 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
380 memset(self->simcall.args, 0, sizeof(self->simcall.args));
381 self->simcall.args[0].cc = (const char*) name;
382 self->simcall.args[1].i = (int) host_nb;
383 self->simcall.args[2].dp = (void*) host_list;
384 self->simcall.args[3].dp = (void*) flops_amount;
385 self->simcall.args[4].dp = (void*) bytes_amount;
386 self->simcall.args[5].d = (double) amount;
387 self->simcall.args[6].d = (double) rate;
388 if (self != simix_global->maestro_process) {
389 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
390 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
391 SIMIX_process_yield(self);
393 SIMIX_simcall_handle(&self->simcall, 0);
395 return (smx_synchro_t) self->simcall.result.dp;
398 inline static void simcall_BODY_execution_destroy(smx_synchro_t execution) {
399 smx_process_t self = SIMIX_process_self();
401 /* Go to that function to follow the code flow through the simcall barrier */
402 if (0) SIMIX_execution_destroy(execution);
403 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
405 self->simcall.call = SIMCALL_EXECUTION_DESTROY;
406 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
407 memset(self->simcall.args, 0, sizeof(self->simcall.args));
408 self->simcall.args[0].dp = (void*) execution;
409 if (self != simix_global->maestro_process) {
410 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
411 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
412 SIMIX_process_yield(self);
414 SIMIX_simcall_handle(&self->simcall, 0);
419 inline static void simcall_BODY_execution_cancel(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_execution_cancel(execution);
424 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
426 self->simcall.call = SIMCALL_EXECUTION_CANCEL;
427 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
428 memset(self->simcall.args, 0, sizeof(self->simcall.args));
429 self->simcall.args[0].dp = (void*) execution;
430 if (self != simix_global->maestro_process) {
431 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
432 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
433 SIMIX_process_yield(self);
435 SIMIX_simcall_handle(&self->simcall, 0);
440 inline static void simcall_BODY_execution_set_priority(smx_synchro_t execution, double priority) {
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_execution_set_priority(execution, priority);
445 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
447 self->simcall.call = SIMCALL_EXECUTION_SET_PRIORITY;
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 self->simcall.args[1].d = (double) priority;
452 if (self != simix_global->maestro_process) {
453 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
454 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
455 SIMIX_process_yield(self);
457 SIMIX_simcall_handle(&self->simcall, 0);
462 inline static void simcall_BODY_execution_set_bound(smx_synchro_t execution, double bound) {
463 smx_process_t self = SIMIX_process_self();
465 /* Go to that function to follow the code flow through the simcall barrier */
466 if (0) SIMIX_execution_set_bound(execution, bound);
467 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
469 self->simcall.call = SIMCALL_EXECUTION_SET_BOUND;
470 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
471 memset(self->simcall.args, 0, sizeof(self->simcall.args));
472 self->simcall.args[0].dp = (void*) execution;
473 self->simcall.args[1].d = (double) bound;
474 if (self != simix_global->maestro_process) {
475 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
476 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
477 SIMIX_process_yield(self);
479 SIMIX_simcall_handle(&self->simcall, 0);
484 inline static void simcall_BODY_execution_set_affinity(smx_synchro_t execution, sg_host_t ws, unsigned long mask) {
485 smx_process_t self = SIMIX_process_self();
487 /* Go to that function to follow the code flow through the simcall barrier */
488 if (0) SIMIX_execution_set_affinity(execution, ws, mask);
489 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
491 self->simcall.call = SIMCALL_EXECUTION_SET_AFFINITY;
492 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
493 memset(self->simcall.args, 0, sizeof(self->simcall.args));
494 self->simcall.args[0].dp = (void*) execution;
495 self->simcall.args[1].dp = (void*) ws;
496 self->simcall.args[2].ul = (unsigned long) mask;
497 if (self != simix_global->maestro_process) {
498 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
499 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
500 SIMIX_process_yield(self);
502 SIMIX_simcall_handle(&self->simcall, 0);
507 inline static int simcall_BODY_execution_wait(smx_synchro_t execution) {
508 smx_process_t self = SIMIX_process_self();
510 /* Go to that function to follow the code flow through the simcall barrier */
511 if (0) simcall_HANDLER_execution_wait(&self->simcall, execution);
512 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
514 self->simcall.call = SIMCALL_EXECUTION_WAIT;
515 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
516 memset(self->simcall.args, 0, sizeof(self->simcall.args));
517 self->simcall.args[0].dp = (void*) execution;
518 if (self != simix_global->maestro_process) {
519 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
520 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
521 SIMIX_process_yield(self);
523 SIMIX_simcall_handle(&self->simcall, 0);
525 return (int) self->simcall.result.i;
528 inline static void simcall_BODY_process_on_exit(smx_process_t process, int_f_pvoid_pvoid_t fun, void* data) {
529 smx_process_t self = SIMIX_process_self();
531 /* Go to that function to follow the code flow through the simcall barrier */
532 if (0) SIMIX_process_on_exit(process, fun, data);
533 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
535 self->simcall.call = SIMCALL_PROCESS_ON_EXIT;
536 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
537 memset(self->simcall.args, 0, sizeof(self->simcall.args));
538 self->simcall.args[0].dp = (void*) process;
539 self->simcall.args[1].fp = (FPtr) fun;
540 self->simcall.args[2].dp = (void*) data;
541 if (self != simix_global->maestro_process) {
542 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
543 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
544 SIMIX_process_yield(self);
546 SIMIX_simcall_handle(&self->simcall, 0);
551 inline static void simcall_BODY_process_auto_restart_set(smx_process_t process, int auto_restart) {
552 smx_process_t self = SIMIX_process_self();
554 /* Go to that function to follow the code flow through the simcall barrier */
555 if (0) SIMIX_process_auto_restart_set(process, auto_restart);
556 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
558 self->simcall.call = SIMCALL_PROCESS_AUTO_RESTART_SET;
559 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
560 memset(self->simcall.args, 0, sizeof(self->simcall.args));
561 self->simcall.args[0].dp = (void*) process;
562 self->simcall.args[1].i = (int) auto_restart;
563 if (self != simix_global->maestro_process) {
564 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
565 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
566 SIMIX_process_yield(self);
568 SIMIX_simcall_handle(&self->simcall, 0);
573 inline static smx_process_t simcall_BODY_process_restart(smx_process_t process) {
574 smx_process_t self = SIMIX_process_self();
576 /* Go to that function to follow the code flow through the simcall barrier */
577 if (0) simcall_HANDLER_process_restart(&self->simcall, process);
578 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
580 self->simcall.call = SIMCALL_PROCESS_RESTART;
581 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
582 memset(self->simcall.args, 0, sizeof(self->simcall.args));
583 self->simcall.args[0].dp = (void*) process;
584 if (self != simix_global->maestro_process) {
585 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
586 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
587 SIMIX_process_yield(self);
589 SIMIX_simcall_handle(&self->simcall, 0);
591 return (smx_process_t) self->simcall.result.dp;
594 inline static smx_mailbox_t simcall_BODY_mbox_create(const char* name) {
595 smx_process_t self = SIMIX_process_self();
597 /* Go to that function to follow the code flow through the simcall barrier */
598 if (0) SIMIX_mbox_create(name);
599 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
601 self->simcall.call = SIMCALL_MBOX_CREATE;
602 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
603 memset(self->simcall.args, 0, sizeof(self->simcall.args));
604 self->simcall.args[0].cc = (const char*) name;
605 if (self != simix_global->maestro_process) {
606 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
607 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
608 SIMIX_process_yield(self);
610 SIMIX_simcall_handle(&self->simcall, 0);
612 return (smx_mailbox_t) self->simcall.result.dp;
615 inline static smx_synchro_t simcall_BODY_mbox_get_head(smx_mailbox_t mbox) {
616 smx_process_t self = SIMIX_process_self();
618 /* Go to that function to follow the code flow through the simcall barrier */
619 if (0) SIMIX_mbox_get_head(mbox);
620 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
622 self->simcall.call = SIMCALL_MBOX_GET_HEAD;
623 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
624 memset(self->simcall.args, 0, sizeof(self->simcall.args));
625 self->simcall.args[0].dp = (void*) mbox;
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);
633 return (smx_synchro_t) self->simcall.result.dp;
636 inline static void simcall_BODY_mbox_set_receiver(smx_mailbox_t mbox, smx_process_t receiver) {
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) SIMIX_mbox_set_receiver(mbox, receiver);
641 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
643 self->simcall.call = SIMCALL_MBOX_SET_RECEIVER;
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*) mbox;
647 self->simcall.args[1].dp = (void*) receiver;
648 if (self != simix_global->maestro_process) {
649 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
650 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
651 SIMIX_process_yield(self);
653 SIMIX_simcall_handle(&self->simcall, 0);
658 inline static smx_process_t simcall_BODY_mbox_get_receiver(smx_mailbox_t mbox) {
659 smx_process_t self = SIMIX_process_self();
661 /* Go to that function to follow the code flow through the simcall barrier */
662 if (0) SIMIX_mbox_get_receiver(mbox);
663 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
665 self->simcall.call = SIMCALL_MBOX_GET_RECEIVER;
666 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
667 memset(self->simcall.args, 0, sizeof(self->simcall.args));
668 self->simcall.args[0].dp = (void*) mbox;
669 if (self != simix_global->maestro_process) {
670 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
671 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
672 SIMIX_process_yield(self);
674 SIMIX_simcall_handle(&self->simcall, 0);
676 return (smx_process_t) self->simcall.result.dp;
679 inline static smx_synchro_t simcall_BODY_comm_iprobe(smx_mailbox_t mbox, int type, int src, int tag, simix_match_func_t match_fun, void* data) {
680 smx_process_t self = SIMIX_process_self();
682 /* Go to that function to follow the code flow through the simcall barrier */
683 if (0) simcall_HANDLER_comm_iprobe(&self->simcall, mbox, type, src, tag, match_fun, data);
684 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
686 self->simcall.call = SIMCALL_COMM_IPROBE;
687 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
688 memset(self->simcall.args, 0, sizeof(self->simcall.args));
689 self->simcall.args[0].dp = (void*) mbox;
690 self->simcall.args[1].i = (int) type;
691 self->simcall.args[2].i = (int) src;
692 self->simcall.args[3].i = (int) tag;
693 self->simcall.args[4].fp = (FPtr) match_fun;
694 self->simcall.args[5].dp = (void*) data;
695 if (self != simix_global->maestro_process) {
696 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
697 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
698 SIMIX_process_yield(self);
700 SIMIX_simcall_handle(&self->simcall, 0);
702 return (smx_synchro_t) self->simcall.result.dp;
705 inline static void simcall_BODY_comm_send(smx_process_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout) {
706 smx_process_t self = SIMIX_process_self();
708 /* Go to that function to follow the code flow through the simcall barrier */
709 if (0) simcall_HANDLER_comm_send(&self->simcall, sender, mbox, task_size, rate, src_buff, src_buff_size, match_fun, copy_data_fun, data, timeout);
710 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
712 self->simcall.call = SIMCALL_COMM_SEND;
713 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
714 memset(self->simcall.args, 0, sizeof(self->simcall.args));
715 self->simcall.args[0].dp = (void*) sender;
716 self->simcall.args[1].dp = (void*) mbox;
717 self->simcall.args[2].d = (double) task_size;
718 self->simcall.args[3].d = (double) rate;
719 self->simcall.args[4].dp = (void*) src_buff;
720 self->simcall.args[5].sz = (size_t) src_buff_size;
721 self->simcall.args[6].fp = (FPtr) match_fun;
722 self->simcall.args[7].fp = (FPtr) copy_data_fun;
723 self->simcall.args[8].dp = (void*) data;
724 self->simcall.args[9].d = (double) timeout;
725 if (self != simix_global->maestro_process) {
726 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
727 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
728 SIMIX_process_yield(self);
730 SIMIX_simcall_handle(&self->simcall, 0);
735 inline static smx_synchro_t simcall_BODY_comm_isend(smx_process_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_clean_func_t clean_fun, simix_copy_data_func_t copy_data_fun, void* data, int detached) {
736 smx_process_t self = SIMIX_process_self();
738 /* Go to that function to follow the code flow through the simcall barrier */
739 if (0) simcall_HANDLER_comm_isend(&self->simcall, sender, mbox, task_size, rate, src_buff, src_buff_size, match_fun, clean_fun, copy_data_fun, data, detached);
740 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
742 self->simcall.call = SIMCALL_COMM_ISEND;
743 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
744 memset(self->simcall.args, 0, sizeof(self->simcall.args));
745 self->simcall.args[0].dp = (void*) sender;
746 self->simcall.args[1].dp = (void*) mbox;
747 self->simcall.args[2].d = (double) task_size;
748 self->simcall.args[3].d = (double) rate;
749 self->simcall.args[4].dp = (void*) src_buff;
750 self->simcall.args[5].sz = (size_t) src_buff_size;
751 self->simcall.args[6].fp = (FPtr) match_fun;
752 self->simcall.args[7].fp = (FPtr) clean_fun;
753 self->simcall.args[8].fp = (FPtr) copy_data_fun;
754 self->simcall.args[9].dp = (void*) data;
755 self->simcall.args[10].i = (int) detached;
756 if (self != simix_global->maestro_process) {
757 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
758 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
759 SIMIX_process_yield(self);
761 SIMIX_simcall_handle(&self->simcall, 0);
763 return (smx_synchro_t) self->simcall.result.dp;
766 inline static void simcall_BODY_comm_recv(smx_process_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout, double rate) {
767 smx_process_t self = SIMIX_process_self();
769 /* Go to that function to follow the code flow through the simcall barrier */
770 if (0) simcall_HANDLER_comm_recv(&self->simcall, receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, timeout, rate);
771 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
773 self->simcall.call = SIMCALL_COMM_RECV;
774 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
775 memset(self->simcall.args, 0, sizeof(self->simcall.args));
776 self->simcall.args[0].dp = (void*) receiver;
777 self->simcall.args[1].dp = (void*) mbox;
778 self->simcall.args[2].dp = (void*) dst_buff;
779 self->simcall.args[3].dp = (void*) dst_buff_size;
780 self->simcall.args[4].fp = (FPtr) match_fun;
781 self->simcall.args[5].fp = (FPtr) copy_data_fun;
782 self->simcall.args[6].dp = (void*) data;
783 self->simcall.args[7].d = (double) timeout;
784 self->simcall.args[8].d = (double) rate;
785 if (self != simix_global->maestro_process) {
786 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
787 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
788 SIMIX_process_yield(self);
790 SIMIX_simcall_handle(&self->simcall, 0);
795 inline static smx_synchro_t simcall_BODY_comm_irecv(smx_process_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double rate) {
796 smx_process_t self = SIMIX_process_self();
798 /* Go to that function to follow the code flow through the simcall barrier */
799 if (0) simcall_HANDLER_comm_irecv(&self->simcall, receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, rate);
800 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
802 self->simcall.call = SIMCALL_COMM_IRECV;
803 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
804 memset(self->simcall.args, 0, sizeof(self->simcall.args));
805 self->simcall.args[0].dp = (void*) receiver;
806 self->simcall.args[1].dp = (void*) mbox;
807 self->simcall.args[2].dp = (void*) dst_buff;
808 self->simcall.args[3].dp = (void*) dst_buff_size;
809 self->simcall.args[4].fp = (FPtr) match_fun;
810 self->simcall.args[5].fp = (FPtr) copy_data_fun;
811 self->simcall.args[6].dp = (void*) data;
812 self->simcall.args[7].d = (double) rate;
813 if (self != simix_global->maestro_process) {
814 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
815 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
816 SIMIX_process_yield(self);
818 SIMIX_simcall_handle(&self->simcall, 0);
820 return (smx_synchro_t) self->simcall.result.dp;
823 inline static int simcall_BODY_comm_waitany(xbt_dynar_t comms) {
824 smx_process_t self = SIMIX_process_self();
826 /* Go to that function to follow the code flow through the simcall barrier */
827 if (0) simcall_HANDLER_comm_waitany(&self->simcall, comms);
828 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
830 self->simcall.call = SIMCALL_COMM_WAITANY;
831 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
832 memset(self->simcall.args, 0, sizeof(self->simcall.args));
833 self->simcall.args[0].dp = (void*) comms;
834 if (self != simix_global->maestro_process) {
835 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
836 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
837 SIMIX_process_yield(self);
839 SIMIX_simcall_handle(&self->simcall, 0);
841 return (int) self->simcall.result.i;
844 inline static void simcall_BODY_comm_wait(smx_synchro_t comm, double timeout) {
845 smx_process_t self = SIMIX_process_self();
847 /* Go to that function to follow the code flow through the simcall barrier */
848 if (0) simcall_HANDLER_comm_wait(&self->simcall, comm, timeout);
849 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
851 self->simcall.call = SIMCALL_COMM_WAIT;
852 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
853 memset(self->simcall.args, 0, sizeof(self->simcall.args));
854 self->simcall.args[0].dp = (void*) comm;
855 self->simcall.args[1].d = (double) timeout;
856 if (self != simix_global->maestro_process) {
857 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
858 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
859 SIMIX_process_yield(self);
861 SIMIX_simcall_handle(&self->simcall, 0);
866 inline static int simcall_BODY_comm_test(smx_synchro_t comm) {
867 smx_process_t self = SIMIX_process_self();
869 /* Go to that function to follow the code flow through the simcall barrier */
870 if (0) simcall_HANDLER_comm_test(&self->simcall, comm);
871 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
873 self->simcall.call = SIMCALL_COMM_TEST;
874 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
875 memset(self->simcall.args, 0, sizeof(self->simcall.args));
876 self->simcall.args[0].dp = (void*) comm;
877 if (self != simix_global->maestro_process) {
878 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
879 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
880 SIMIX_process_yield(self);
882 SIMIX_simcall_handle(&self->simcall, 0);
884 return (int) self->simcall.result.i;
887 inline static int simcall_BODY_comm_testany(xbt_dynar_t comms) {
888 smx_process_t self = SIMIX_process_self();
890 /* Go to that function to follow the code flow through the simcall barrier */
891 if (0) simcall_HANDLER_comm_testany(&self->simcall, comms);
892 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
894 self->simcall.call = SIMCALL_COMM_TESTANY;
895 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
896 memset(self->simcall.args, 0, sizeof(self->simcall.args));
897 self->simcall.args[0].dp = (void*) comms;
898 if (self != simix_global->maestro_process) {
899 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
900 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
901 SIMIX_process_yield(self);
903 SIMIX_simcall_handle(&self->simcall, 0);
905 return (int) self->simcall.result.i;
908 inline static void* simcall_BODY_comm_get_src_data(smx_synchro_t comm) {
909 smx_process_t self = SIMIX_process_self();
911 /* Go to that function to follow the code flow through the simcall barrier */
912 if (0) SIMIX_comm_get_src_data(comm);
913 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
915 self->simcall.call = SIMCALL_COMM_GET_SRC_DATA;
916 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
917 memset(self->simcall.args, 0, sizeof(self->simcall.args));
918 self->simcall.args[0].dp = (void*) comm;
919 if (self != simix_global->maestro_process) {
920 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
921 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
922 SIMIX_process_yield(self);
924 SIMIX_simcall_handle(&self->simcall, 0);
926 return (void*) self->simcall.result.dp;
929 inline static void* simcall_BODY_comm_get_dst_data(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_get_dst_data(comm);
934 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
936 self->simcall.call = SIMCALL_COMM_GET_DST_DATA;
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);
947 return (void*) self->simcall.result.dp;
950 inline static smx_process_t simcall_BODY_comm_get_src_proc(smx_synchro_t comm) {
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) SIMIX_comm_get_src_proc(comm);
955 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
957 self->simcall.call = SIMCALL_COMM_GET_SRC_PROC;
958 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
959 memset(self->simcall.args, 0, sizeof(self->simcall.args));
960 self->simcall.args[0].dp = (void*) comm;
961 if (self != simix_global->maestro_process) {
962 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
963 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
964 SIMIX_process_yield(self);
966 SIMIX_simcall_handle(&self->simcall, 0);
968 return (smx_process_t) self->simcall.result.dp;
971 inline static smx_process_t simcall_BODY_comm_get_dst_proc(smx_synchro_t comm) {
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) SIMIX_comm_get_dst_proc(comm);
976 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
978 self->simcall.call = SIMCALL_COMM_GET_DST_PROC;
979 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
980 memset(self->simcall.args, 0, sizeof(self->simcall.args));
981 self->simcall.args[0].dp = (void*) comm;
982 if (self != simix_global->maestro_process) {
983 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
984 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
985 SIMIX_process_yield(self);
987 SIMIX_simcall_handle(&self->simcall, 0);
989 return (smx_process_t) self->simcall.result.dp;
992 inline static smx_mutex_t simcall_BODY_mutex_init() {
993 smx_process_t self = SIMIX_process_self();
995 /* Go to that function to follow the code flow through the simcall barrier */
996 if (0) simcall_HANDLER_mutex_init(&self->simcall);
997 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
999 self->simcall.call = SIMCALL_MUTEX_INIT;
1000 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1001 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1003 if (self != simix_global->maestro_process) {
1004 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1005 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1006 SIMIX_process_yield(self);
1008 SIMIX_simcall_handle(&self->simcall, 0);
1010 return (smx_mutex_t) self->simcall.result.dp;
1013 inline static void simcall_BODY_mutex_lock(smx_mutex_t mutex) {
1014 smx_process_t self = SIMIX_process_self();
1016 /* Go to that function to follow the code flow through the simcall barrier */
1017 if (0) simcall_HANDLER_mutex_lock(&self->simcall, mutex);
1018 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1020 self->simcall.call = SIMCALL_MUTEX_LOCK;
1021 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1022 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1023 self->simcall.args[0].dp = (void*) mutex;
1024 if (self != simix_global->maestro_process) {
1025 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1026 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1027 SIMIX_process_yield(self);
1029 SIMIX_simcall_handle(&self->simcall, 0);
1034 inline static int simcall_BODY_mutex_trylock(smx_mutex_t mutex) {
1035 smx_process_t self = SIMIX_process_self();
1037 /* Go to that function to follow the code flow through the simcall barrier */
1038 if (0) simcall_HANDLER_mutex_trylock(&self->simcall, mutex);
1039 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1041 self->simcall.call = SIMCALL_MUTEX_TRYLOCK;
1042 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1043 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1044 self->simcall.args[0].dp = (void*) mutex;
1045 if (self != simix_global->maestro_process) {
1046 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1047 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1048 SIMIX_process_yield(self);
1050 SIMIX_simcall_handle(&self->simcall, 0);
1052 return (int) self->simcall.result.i;
1055 inline static void simcall_BODY_mutex_unlock(smx_mutex_t mutex) {
1056 smx_process_t self = SIMIX_process_self();
1058 /* Go to that function to follow the code flow through the simcall barrier */
1059 if (0) simcall_HANDLER_mutex_unlock(&self->simcall, mutex);
1060 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1062 self->simcall.call = SIMCALL_MUTEX_UNLOCK;
1063 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1064 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1065 self->simcall.args[0].dp = (void*) mutex;
1066 if (self != simix_global->maestro_process) {
1067 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1068 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1069 SIMIX_process_yield(self);
1071 SIMIX_simcall_handle(&self->simcall, 0);
1076 inline static smx_cond_t simcall_BODY_cond_init() {
1077 smx_process_t self = SIMIX_process_self();
1079 /* Go to that function to follow the code flow through the simcall barrier */
1080 if (0) SIMIX_cond_init();
1081 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1083 self->simcall.call = SIMCALL_COND_INIT;
1084 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1085 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1087 if (self != simix_global->maestro_process) {
1088 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1089 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1090 SIMIX_process_yield(self);
1092 SIMIX_simcall_handle(&self->simcall, 0);
1094 return (smx_cond_t) self->simcall.result.dp;
1097 inline static void simcall_BODY_cond_signal(smx_cond_t cond) {
1098 smx_process_t self = SIMIX_process_self();
1100 /* Go to that function to follow the code flow through the simcall barrier */
1101 if (0) SIMIX_cond_signal(cond);
1102 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1104 self->simcall.call = SIMCALL_COND_SIGNAL;
1105 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1106 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1107 self->simcall.args[0].dp = (void*) cond;
1108 if (self != simix_global->maestro_process) {
1109 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1110 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1111 SIMIX_process_yield(self);
1113 SIMIX_simcall_handle(&self->simcall, 0);
1118 inline static void simcall_BODY_cond_wait(smx_cond_t cond, smx_mutex_t mutex) {
1119 smx_process_t self = SIMIX_process_self();
1121 /* Go to that function to follow the code flow through the simcall barrier */
1122 if (0) simcall_HANDLER_cond_wait(&self->simcall, cond, mutex);
1123 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1125 self->simcall.call = SIMCALL_COND_WAIT;
1126 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1127 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1128 self->simcall.args[0].dp = (void*) cond;
1129 self->simcall.args[1].dp = (void*) mutex;
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);
1140 inline static void simcall_BODY_cond_wait_timeout(smx_cond_t cond, smx_mutex_t mutex, double timeout) {
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) simcall_HANDLER_cond_wait_timeout(&self->simcall, cond, mutex, timeout);
1145 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1147 self->simcall.call = SIMCALL_COND_WAIT_TIMEOUT;
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*) cond;
1151 self->simcall.args[1].dp = (void*) mutex;
1152 self->simcall.args[2].d = (double) timeout;
1153 if (self != simix_global->maestro_process) {
1154 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1155 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1156 SIMIX_process_yield(self);
1158 SIMIX_simcall_handle(&self->simcall, 0);
1163 inline static void simcall_BODY_cond_broadcast(smx_cond_t cond) {
1164 smx_process_t self = SIMIX_process_self();
1166 /* Go to that function to follow the code flow through the simcall barrier */
1167 if (0) SIMIX_cond_broadcast(cond);
1168 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1170 self->simcall.call = SIMCALL_COND_BROADCAST;
1171 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1172 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1173 self->simcall.args[0].dp = (void*) cond;
1174 if (self != simix_global->maestro_process) {
1175 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1176 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1177 SIMIX_process_yield(self);
1179 SIMIX_simcall_handle(&self->simcall, 0);
1184 inline static smx_sem_t simcall_BODY_sem_init(unsigned int capacity) {
1185 smx_process_t self = SIMIX_process_self();
1187 /* Go to that function to follow the code flow through the simcall barrier */
1188 if (0) SIMIX_sem_init(capacity);
1189 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1191 self->simcall.call = SIMCALL_SEM_INIT;
1192 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1193 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1194 self->simcall.args[0].ui = (unsigned int) capacity;
1195 if (self != simix_global->maestro_process) {
1196 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1197 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1198 SIMIX_process_yield(self);
1200 SIMIX_simcall_handle(&self->simcall, 0);
1202 return (smx_sem_t) self->simcall.result.dp;
1205 inline static void simcall_BODY_sem_release(smx_sem_t sem) {
1206 smx_process_t self = SIMIX_process_self();
1208 /* Go to that function to follow the code flow through the simcall barrier */
1209 if (0) simcall_HANDLER_sem_release(&self->simcall, sem);
1210 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1212 self->simcall.call = SIMCALL_SEM_RELEASE;
1213 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1214 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1215 self->simcall.args[0].dp = (void*) sem;
1216 if (self != simix_global->maestro_process) {
1217 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1218 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1219 SIMIX_process_yield(self);
1221 SIMIX_simcall_handle(&self->simcall, 0);
1226 inline static int simcall_BODY_sem_would_block(smx_sem_t sem) {
1227 smx_process_t self = SIMIX_process_self();
1229 /* Go to that function to follow the code flow through the simcall barrier */
1230 if (0) simcall_HANDLER_sem_would_block(&self->simcall, sem);
1231 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1233 self->simcall.call = SIMCALL_SEM_WOULD_BLOCK;
1234 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1235 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1236 self->simcall.args[0].dp = (void*) sem;
1237 if (self != simix_global->maestro_process) {
1238 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1239 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1240 SIMIX_process_yield(self);
1242 SIMIX_simcall_handle(&self->simcall, 0);
1244 return (int) self->simcall.result.i;
1247 inline static void simcall_BODY_sem_acquire(smx_sem_t sem) {
1248 smx_process_t self = SIMIX_process_self();
1250 /* Go to that function to follow the code flow through the simcall barrier */
1251 if (0) simcall_HANDLER_sem_acquire(&self->simcall, sem);
1252 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1254 self->simcall.call = SIMCALL_SEM_ACQUIRE;
1255 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1256 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1257 self->simcall.args[0].dp = (void*) sem;
1258 if (self != simix_global->maestro_process) {
1259 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1260 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1261 SIMIX_process_yield(self);
1263 SIMIX_simcall_handle(&self->simcall, 0);
1268 inline static void simcall_BODY_sem_acquire_timeout(smx_sem_t sem, double timeout) {
1269 smx_process_t self = SIMIX_process_self();
1271 /* Go to that function to follow the code flow through the simcall barrier */
1272 if (0) simcall_HANDLER_sem_acquire_timeout(&self->simcall, sem, timeout);
1273 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1275 self->simcall.call = SIMCALL_SEM_ACQUIRE_TIMEOUT;
1276 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1277 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1278 self->simcall.args[0].dp = (void*) sem;
1279 self->simcall.args[1].d = (double) timeout;
1280 if (self != simix_global->maestro_process) {
1281 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1282 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1283 SIMIX_process_yield(self);
1285 SIMIX_simcall_handle(&self->simcall, 0);
1290 inline static int simcall_BODY_sem_get_capacity(smx_sem_t sem) {
1291 smx_process_t self = SIMIX_process_self();
1293 /* Go to that function to follow the code flow through the simcall barrier */
1294 if (0) simcall_HANDLER_sem_get_capacity(&self->simcall, sem);
1295 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1297 self->simcall.call = SIMCALL_SEM_GET_CAPACITY;
1298 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1299 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1300 self->simcall.args[0].dp = (void*) sem;
1301 if (self != simix_global->maestro_process) {
1302 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1303 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1304 SIMIX_process_yield(self);
1306 SIMIX_simcall_handle(&self->simcall, 0);
1308 return (int) self->simcall.result.i;
1311 inline static sg_size_t simcall_BODY_file_read(smx_file_t fd, sg_size_t size, sg_host_t host) {
1312 smx_process_t self = SIMIX_process_self();
1314 /* Go to that function to follow the code flow through the simcall barrier */
1315 if (0) simcall_HANDLER_file_read(&self->simcall, fd, size, host);
1316 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1318 self->simcall.call = SIMCALL_FILE_READ;
1319 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1320 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1321 self->simcall.args[0].dp = (void*) fd;
1322 self->simcall.args[1].sgsz = (sg_size_t) size;
1323 self->simcall.args[2].dp = (void*) host;
1324 if (self != simix_global->maestro_process) {
1325 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1326 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1327 SIMIX_process_yield(self);
1329 SIMIX_simcall_handle(&self->simcall, 0);
1331 return (sg_size_t) self->simcall.result.sgsz;
1334 inline static sg_size_t simcall_BODY_file_write(smx_file_t fd, sg_size_t size, sg_host_t host) {
1335 smx_process_t self = SIMIX_process_self();
1337 /* Go to that function to follow the code flow through the simcall barrier */
1338 if (0) simcall_HANDLER_file_write(&self->simcall, fd, size, host);
1339 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1341 self->simcall.call = SIMCALL_FILE_WRITE;
1342 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1343 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1344 self->simcall.args[0].dp = (void*) fd;
1345 self->simcall.args[1].sgsz = (sg_size_t) size;
1346 self->simcall.args[2].dp = (void*) host;
1347 if (self != simix_global->maestro_process) {
1348 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1349 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1350 SIMIX_process_yield(self);
1352 SIMIX_simcall_handle(&self->simcall, 0);
1354 return (sg_size_t) self->simcall.result.sgsz;
1357 inline static smx_file_t simcall_BODY_file_open(const char* fullpath, sg_host_t host) {
1358 smx_process_t self = SIMIX_process_self();
1360 /* Go to that function to follow the code flow through the simcall barrier */
1361 if (0) simcall_HANDLER_file_open(&self->simcall, fullpath, host);
1362 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1364 self->simcall.call = SIMCALL_FILE_OPEN;
1365 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1366 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1367 self->simcall.args[0].cc = (const char*) fullpath;
1368 self->simcall.args[1].dp = (void*) host;
1369 if (self != simix_global->maestro_process) {
1370 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1371 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1372 SIMIX_process_yield(self);
1374 SIMIX_simcall_handle(&self->simcall, 0);
1376 return (smx_file_t) self->simcall.result.dp;
1379 inline static int simcall_BODY_file_close(smx_file_t fd, sg_host_t host) {
1380 smx_process_t self = SIMIX_process_self();
1382 /* Go to that function to follow the code flow through the simcall barrier */
1383 if (0) simcall_HANDLER_file_close(&self->simcall, fd, host);
1384 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1386 self->simcall.call = SIMCALL_FILE_CLOSE;
1387 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1388 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1389 self->simcall.args[0].dp = (void*) fd;
1390 self->simcall.args[1].dp = (void*) host;
1391 if (self != simix_global->maestro_process) {
1392 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1393 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1394 SIMIX_process_yield(self);
1396 SIMIX_simcall_handle(&self->simcall, 0);
1398 return (int) self->simcall.result.i;
1401 inline static int simcall_BODY_file_unlink(smx_file_t fd, sg_host_t host) {
1402 smx_process_t self = SIMIX_process_self();
1404 /* Go to that function to follow the code flow through the simcall barrier */
1405 if (0) SIMIX_file_unlink(fd, host);
1406 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1408 self->simcall.call = SIMCALL_FILE_UNLINK;
1409 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1410 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1411 self->simcall.args[0].dp = (void*) fd;
1412 self->simcall.args[1].dp = (void*) host;
1413 if (self != simix_global->maestro_process) {
1414 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1415 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1416 SIMIX_process_yield(self);
1418 SIMIX_simcall_handle(&self->simcall, 0);
1420 return (int) self->simcall.result.i;
1423 inline static sg_size_t simcall_BODY_file_get_size(smx_file_t fd) {
1424 smx_process_t self = SIMIX_process_self();
1426 /* Go to that function to follow the code flow through the simcall barrier */
1427 if (0) simcall_HANDLER_file_get_size(&self->simcall, fd);
1428 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1430 self->simcall.call = SIMCALL_FILE_GET_SIZE;
1431 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1432 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1433 self->simcall.args[0].dp = (void*) fd;
1434 if (self != simix_global->maestro_process) {
1435 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1436 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1437 SIMIX_process_yield(self);
1439 SIMIX_simcall_handle(&self->simcall, 0);
1441 return (sg_size_t) self->simcall.result.sgsz;
1444 inline static sg_size_t simcall_BODY_file_tell(smx_file_t fd) {
1445 smx_process_t self = SIMIX_process_self();
1447 /* Go to that function to follow the code flow through the simcall barrier */
1448 if (0) simcall_HANDLER_file_tell(&self->simcall, fd);
1449 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1451 self->simcall.call = SIMCALL_FILE_TELL;
1452 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1453 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1454 self->simcall.args[0].dp = (void*) fd;
1455 if (self != simix_global->maestro_process) {
1456 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1457 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1458 SIMIX_process_yield(self);
1460 SIMIX_simcall_handle(&self->simcall, 0);
1462 return (sg_size_t) self->simcall.result.sgsz;
1465 inline static int simcall_BODY_file_seek(smx_file_t fd, sg_offset_t offset, int origin) {
1466 smx_process_t self = SIMIX_process_self();
1468 /* Go to that function to follow the code flow through the simcall barrier */
1469 if (0) simcall_HANDLER_file_seek(&self->simcall, fd, offset, origin);
1470 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1472 self->simcall.call = SIMCALL_FILE_SEEK;
1473 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1474 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1475 self->simcall.args[0].dp = (void*) fd;
1476 self->simcall.args[1].sgoff = (sg_offset_t) offset;
1477 self->simcall.args[2].i = (int) origin;
1478 if (self != simix_global->maestro_process) {
1479 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1480 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1481 SIMIX_process_yield(self);
1483 SIMIX_simcall_handle(&self->simcall, 0);
1485 return (int) self->simcall.result.i;
1488 inline static xbt_dynar_t simcall_BODY_file_get_info(smx_file_t fd) {
1489 smx_process_t self = SIMIX_process_self();
1491 /* Go to that function to follow the code flow through the simcall barrier */
1492 if (0) simcall_HANDLER_file_get_info(&self->simcall, fd);
1493 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1495 self->simcall.call = SIMCALL_FILE_GET_INFO;
1496 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1497 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1498 self->simcall.args[0].dp = (void*) fd;
1499 if (self != simix_global->maestro_process) {
1500 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1501 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1502 SIMIX_process_yield(self);
1504 SIMIX_simcall_handle(&self->simcall, 0);
1506 return (xbt_dynar_t) self->simcall.result.dp;
1509 inline static int simcall_BODY_file_move(smx_file_t fd, const char* fullpath) {
1510 smx_process_t self = SIMIX_process_self();
1512 /* Go to that function to follow the code flow through the simcall barrier */
1513 if (0) simcall_HANDLER_file_move(&self->simcall, fd, fullpath);
1514 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1516 self->simcall.call = SIMCALL_FILE_MOVE;
1517 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1518 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1519 self->simcall.args[0].dp = (void*) fd;
1520 self->simcall.args[1].cc = (const char*) fullpath;
1521 if (self != simix_global->maestro_process) {
1522 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1523 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1524 SIMIX_process_yield(self);
1526 SIMIX_simcall_handle(&self->simcall, 0);
1528 return (int) self->simcall.result.i;
1531 inline static sg_size_t simcall_BODY_storage_get_free_size(smx_storage_t storage) {
1532 smx_process_t self = SIMIX_process_self();
1534 /* Go to that function to follow the code flow through the simcall barrier */
1535 if (0) simcall_HANDLER_storage_get_free_size(&self->simcall, storage);
1536 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1538 self->simcall.call = SIMCALL_STORAGE_GET_FREE_SIZE;
1539 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1540 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1541 self->simcall.args[0].dp = (void*) storage;
1542 if (self != simix_global->maestro_process) {
1543 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1544 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1545 SIMIX_process_yield(self);
1547 SIMIX_simcall_handle(&self->simcall, 0);
1549 return (sg_size_t) self->simcall.result.sgsz;
1552 inline static sg_size_t simcall_BODY_storage_get_used_size(smx_storage_t name) {
1553 smx_process_t self = SIMIX_process_self();
1555 /* Go to that function to follow the code flow through the simcall barrier */
1556 if (0) simcall_HANDLER_storage_get_used_size(&self->simcall, name);
1557 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1559 self->simcall.call = SIMCALL_STORAGE_GET_USED_SIZE;
1560 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1561 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1562 self->simcall.args[0].dp = (void*) name;
1563 if (self != simix_global->maestro_process) {
1564 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1565 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1566 SIMIX_process_yield(self);
1568 SIMIX_simcall_handle(&self->simcall, 0);
1570 return (sg_size_t) self->simcall.result.sgsz;
1573 inline static xbt_dict_t simcall_BODY_storage_get_properties(smx_storage_t storage) {
1574 smx_process_t self = SIMIX_process_self();
1576 /* Go to that function to follow the code flow through the simcall barrier */
1577 if (0) SIMIX_storage_get_properties(storage);
1578 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1580 self->simcall.call = SIMCALL_STORAGE_GET_PROPERTIES;
1581 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1582 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1583 self->simcall.args[0].dp = (void*) storage;
1584 if (self != simix_global->maestro_process) {
1585 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1586 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1587 SIMIX_process_yield(self);
1589 SIMIX_simcall_handle(&self->simcall, 0);
1591 return (xbt_dict_t) self->simcall.result.dp;
1594 inline static xbt_dict_t simcall_BODY_storage_get_content(smx_storage_t storage) {
1595 smx_process_t self = SIMIX_process_self();
1597 /* Go to that function to follow the code flow through the simcall barrier */
1598 if (0) SIMIX_storage_get_content(storage);
1599 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1601 self->simcall.call = SIMCALL_STORAGE_GET_CONTENT;
1602 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1603 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1604 self->simcall.args[0].dp = (void*) storage;
1605 if (self != simix_global->maestro_process) {
1606 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1607 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1608 SIMIX_process_yield(self);
1610 SIMIX_simcall_handle(&self->simcall, 0);
1612 return (xbt_dict_t) self->simcall.result.dp;
1615 inline static xbt_dict_t simcall_BODY_asr_get_properties(const char* name) {
1616 smx_process_t self = SIMIX_process_self();
1618 /* Go to that function to follow the code flow through the simcall barrier */
1619 if (0) simcall_HANDLER_asr_get_properties(&self->simcall, name);
1620 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1622 self->simcall.call = SIMCALL_ASR_GET_PROPERTIES;
1623 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1624 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1625 self->simcall.args[0].cc = (const char*) name;
1626 if (self != simix_global->maestro_process) {
1627 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1628 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1629 SIMIX_process_yield(self);
1631 SIMIX_simcall_handle(&self->simcall, 0);
1633 return (xbt_dict_t) self->simcall.result.dp;
1636 inline static int simcall_BODY_mc_random(int min, int max) {
1637 smx_process_t self = SIMIX_process_self();
1639 /* Go to that function to follow the code flow through the simcall barrier */
1640 if (0) simcall_HANDLER_mc_random(&self->simcall, min, max);
1641 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1643 self->simcall.call = SIMCALL_MC_RANDOM;
1644 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1645 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1646 self->simcall.args[0].i = (int) min;
1647 self->simcall.args[1].i = (int) max;
1648 if (self != simix_global->maestro_process) {
1649 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1650 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1651 SIMIX_process_yield(self);
1653 SIMIX_simcall_handle(&self->simcall, 0);
1655 return (int) self->simcall.result.i;
1658 inline static void simcall_BODY_set_category(smx_synchro_t synchro, const char* category) {
1659 smx_process_t self = SIMIX_process_self();
1661 /* Go to that function to follow the code flow through the simcall barrier */
1662 if (0) SIMIX_set_category(synchro, category);
1663 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1665 self->simcall.call = SIMCALL_SET_CATEGORY;
1666 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1667 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1668 self->simcall.args[0].dp = (void*) synchro;
1669 self->simcall.args[1].cc = (const char*) category;
1670 if (self != simix_global->maestro_process) {
1671 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1672 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1673 SIMIX_process_yield(self);
1675 SIMIX_simcall_handle(&self->simcall, 0);
1680 inline static void simcall_BODY_run_kernel(void* code) {
1681 smx_process_t self = SIMIX_process_self();
1683 /* Go to that function to follow the code flow through the simcall barrier */
1684 if (0) SIMIX_run_kernel(code);
1685 /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
1687 self->simcall.call = SIMCALL_RUN_KERNEL;
1688 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1689 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1690 self->simcall.args[0].dp = (void*) code;
1691 if (self != simix_global->maestro_process) {
1692 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1693 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1694 SIMIX_process_yield(self);
1696 SIMIX_simcall_handle(&self->simcall, 0);