1 /*********************************************
2 * File Generated by src/simix/simcalls.py *
3 * from src/simix/simcalls.in *
4 * Do not modify this file, add new simcalls *
5 * in src/simix/simcalls.in *
6 *********************************************/
8 inline static smx_host_t simcall_BODY_host_get_by_name(const char* name) {
9 smx_process_t self = SIMIX_process_self();
10 self->simcall.call = SIMCALL_HOST_GET_BY_NAME;
11 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
12 memset(self->simcall.args, 0, sizeof(self->simcall.args));
13 self->simcall.args[0].cc = (const char*) name;
14 if (self != simix_global->maestro_process) {
15 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
16 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
17 SIMIX_process_yield(self);
19 SIMIX_simcall_pre(&self->simcall, 0);
21 return self->simcall.result.dp;
23 inline static const char* simcall_BODY_host_get_name(smx_host_t host) {
24 smx_process_t self = SIMIX_process_self();
25 self->simcall.call = SIMCALL_HOST_GET_NAME;
26 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
27 memset(self->simcall.args, 0, sizeof(self->simcall.args));
28 self->simcall.args[0].dp = (void*) host;
29 if (self != simix_global->maestro_process) {
30 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
31 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
32 SIMIX_process_yield(self);
34 SIMIX_simcall_pre(&self->simcall, 0);
36 return self->simcall.result.cc;
38 inline static void simcall_BODY_host_on(smx_host_t host) {
39 smx_process_t self = SIMIX_process_self();
40 self->simcall.call = SIMCALL_HOST_ON;
41 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
42 memset(self->simcall.args, 0, sizeof(self->simcall.args));
43 self->simcall.args[0].dp = (void*) host;
44 if (self != simix_global->maestro_process) {
45 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
46 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
47 SIMIX_process_yield(self);
49 SIMIX_simcall_pre(&self->simcall, 0);
53 inline static void simcall_BODY_host_off(smx_host_t host) {
54 smx_process_t self = SIMIX_process_self();
55 self->simcall.call = SIMCALL_HOST_OFF;
56 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
57 memset(self->simcall.args, 0, sizeof(self->simcall.args));
58 self->simcall.args[0].dp = (void*) host;
59 if (self != simix_global->maestro_process) {
60 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
61 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
62 SIMIX_process_yield(self);
64 SIMIX_simcall_pre(&self->simcall, 0);
68 inline static xbt_dict_t simcall_BODY_host_get_properties(smx_host_t host) {
69 smx_process_t self = SIMIX_process_self();
70 self->simcall.call = SIMCALL_HOST_GET_PROPERTIES;
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*) host;
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_pre(&self->simcall, 0);
81 return self->simcall.result.dp;
83 inline static int simcall_BODY_host_get_core(smx_host_t host) {
84 smx_process_t self = SIMIX_process_self();
85 self->simcall.call = SIMCALL_HOST_GET_CORE;
86 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
87 memset(self->simcall.args, 0, sizeof(self->simcall.args));
88 self->simcall.args[0].dp = (void*) host;
89 if (self != simix_global->maestro_process) {
90 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
91 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
92 SIMIX_process_yield(self);
94 SIMIX_simcall_pre(&self->simcall, 0);
96 return self->simcall.result.i;
98 inline static xbt_swag_t simcall_BODY_host_get_process_list(smx_host_t host) {
99 smx_process_t self = SIMIX_process_self();
100 self->simcall.call = SIMCALL_HOST_GET_PROCESS_LIST;
101 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
102 memset(self->simcall.args, 0, sizeof(self->simcall.args));
103 self->simcall.args[0].dp = (void*) host;
104 if (self != simix_global->maestro_process) {
105 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
106 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
107 SIMIX_process_yield(self);
109 SIMIX_simcall_pre(&self->simcall, 0);
111 return self->simcall.result.dp;
113 inline static double simcall_BODY_host_get_speed(smx_host_t host) {
114 smx_process_t self = SIMIX_process_self();
115 self->simcall.call = SIMCALL_HOST_GET_SPEED;
116 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
117 memset(self->simcall.args, 0, sizeof(self->simcall.args));
118 self->simcall.args[0].dp = (void*) host;
119 if (self != simix_global->maestro_process) {
120 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
121 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
122 SIMIX_process_yield(self);
124 SIMIX_simcall_pre(&self->simcall, 0);
126 return self->simcall.result.d;
128 inline static double simcall_BODY_host_get_available_speed(smx_host_t host) {
129 smx_process_t self = SIMIX_process_self();
130 self->simcall.call = SIMCALL_HOST_GET_AVAILABLE_SPEED;
131 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
132 memset(self->simcall.args, 0, sizeof(self->simcall.args));
133 self->simcall.args[0].dp = (void*) host;
134 if (self != simix_global->maestro_process) {
135 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
136 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
137 SIMIX_process_yield(self);
139 SIMIX_simcall_pre(&self->simcall, 0);
141 return self->simcall.result.d;
143 inline static int simcall_BODY_host_get_state(smx_host_t host) {
144 smx_process_t self = SIMIX_process_self();
145 self->simcall.call = SIMCALL_HOST_GET_STATE;
146 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
147 memset(self->simcall.args, 0, sizeof(self->simcall.args));
148 self->simcall.args[0].dp = (void*) host;
149 if (self != simix_global->maestro_process) {
150 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
151 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
152 SIMIX_process_yield(self);
154 SIMIX_simcall_pre(&self->simcall, 0);
156 return self->simcall.result.i;
158 inline static void* simcall_BODY_host_get_data(smx_host_t host) {
159 smx_process_t self = SIMIX_process_self();
160 self->simcall.call = SIMCALL_HOST_GET_DATA;
161 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
162 memset(self->simcall.args, 0, sizeof(self->simcall.args));
163 self->simcall.args[0].dp = (void*) host;
164 if (self != simix_global->maestro_process) {
165 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
166 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
167 SIMIX_process_yield(self);
169 SIMIX_simcall_pre(&self->simcall, 0);
171 return self->simcall.result.dp;
173 inline static void simcall_BODY_host_set_data(smx_host_t host, void* data) {
174 smx_process_t self = SIMIX_process_self();
175 self->simcall.call = SIMCALL_HOST_SET_DATA;
176 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
177 memset(self->simcall.args, 0, sizeof(self->simcall.args));
178 self->simcall.args[0].dp = (void*) host;
179 self->simcall.args[1].dp = (void*) data;
180 if (self != simix_global->maestro_process) {
181 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
182 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
183 SIMIX_process_yield(self);
185 SIMIX_simcall_pre(&self->simcall, 0);
189 inline static double simcall_BODY_host_get_current_power_peak(smx_host_t host) {
190 smx_process_t self = SIMIX_process_self();
191 self->simcall.call = SIMCALL_HOST_GET_CURRENT_POWER_PEAK;
192 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
193 memset(self->simcall.args, 0, sizeof(self->simcall.args));
194 self->simcall.args[0].dp = (void*) host;
195 if (self != simix_global->maestro_process) {
196 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
197 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
198 SIMIX_process_yield(self);
200 SIMIX_simcall_pre(&self->simcall, 0);
202 return self->simcall.result.d;
204 inline static double simcall_BODY_host_get_power_peak_at(smx_host_t host, int pstate_index) {
205 smx_process_t self = SIMIX_process_self();
206 self->simcall.call = SIMCALL_HOST_GET_POWER_PEAK_AT;
207 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
208 memset(self->simcall.args, 0, sizeof(self->simcall.args));
209 self->simcall.args[0].dp = (void*) host;
210 self->simcall.args[1].i = (int) pstate_index;
211 if (self != simix_global->maestro_process) {
212 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
213 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
214 SIMIX_process_yield(self);
216 SIMIX_simcall_pre(&self->simcall, 0);
218 return self->simcall.result.d;
220 inline static int simcall_BODY_host_get_nb_pstates(smx_host_t host) {
221 smx_process_t self = SIMIX_process_self();
222 self->simcall.call = SIMCALL_HOST_GET_NB_PSTATES;
223 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
224 memset(self->simcall.args, 0, sizeof(self->simcall.args));
225 self->simcall.args[0].dp = (void*) host;
226 if (self != simix_global->maestro_process) {
227 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
228 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
229 SIMIX_process_yield(self);
231 SIMIX_simcall_pre(&self->simcall, 0);
233 return self->simcall.result.i;
235 inline static void simcall_BODY_host_set_power_peak_at(smx_host_t host, int pstate_index) {
236 smx_process_t self = SIMIX_process_self();
237 self->simcall.call = SIMCALL_HOST_SET_POWER_PEAK_AT;
238 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
239 memset(self->simcall.args, 0, sizeof(self->simcall.args));
240 self->simcall.args[0].dp = (void*) host;
241 self->simcall.args[1].i = (int) pstate_index;
242 if (self != simix_global->maestro_process) {
243 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
244 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
245 SIMIX_process_yield(self);
247 SIMIX_simcall_pre(&self->simcall, 0);
251 inline static double simcall_BODY_host_get_consumed_energy(smx_host_t host) {
252 smx_process_t self = SIMIX_process_self();
253 self->simcall.call = SIMCALL_HOST_GET_CONSUMED_ENERGY;
254 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
255 memset(self->simcall.args, 0, sizeof(self->simcall.args));
256 self->simcall.args[0].dp = (void*) host;
257 if (self != simix_global->maestro_process) {
258 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
259 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
260 SIMIX_process_yield(self);
262 SIMIX_simcall_pre(&self->simcall, 0);
264 return self->simcall.result.d;
266 inline static smx_action_t simcall_BODY_host_execute(const char* name, smx_host_t host, double computation_amount, double priority, double bound, unsigned long affinity_mask) {
267 smx_process_t self = SIMIX_process_self();
268 self->simcall.call = SIMCALL_HOST_EXECUTE;
269 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
270 memset(self->simcall.args, 0, sizeof(self->simcall.args));
271 self->simcall.args[0].cc = (const char*) name;
272 self->simcall.args[1].dp = (void*) host;
273 self->simcall.args[2].d = (double) computation_amount;
274 self->simcall.args[3].d = (double) priority;
275 self->simcall.args[4].d = (double) bound;
276 self->simcall.args[5].ul = (unsigned long) affinity_mask;
277 if (self != simix_global->maestro_process) {
278 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
279 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
280 SIMIX_process_yield(self);
282 SIMIX_simcall_pre(&self->simcall, 0);
284 return self->simcall.result.dp;
286 inline static smx_action_t simcall_BODY_host_parallel_execute(const char* name, int host_nb, smx_host_t* host_list, double* computation_amount, double* communication_amount, double amount, double rate) {
287 smx_process_t self = SIMIX_process_self();
288 self->simcall.call = SIMCALL_HOST_PARALLEL_EXECUTE;
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].cc = (const char*) name;
292 self->simcall.args[1].i = (int) host_nb;
293 self->simcall.args[2].dp = (void*) host_list;
294 self->simcall.args[3].dp = (void*) computation_amount;
295 self->simcall.args[4].dp = (void*) communication_amount;
296 self->simcall.args[5].d = (double) amount;
297 self->simcall.args[6].d = (double) rate;
298 if (self != simix_global->maestro_process) {
299 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
300 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
301 SIMIX_process_yield(self);
303 SIMIX_simcall_pre(&self->simcall, 0);
305 return self->simcall.result.dp;
307 inline static void simcall_BODY_host_execution_destroy(smx_action_t execution) {
308 smx_process_t self = SIMIX_process_self();
309 self->simcall.call = SIMCALL_HOST_EXECUTION_DESTROY;
310 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
311 memset(self->simcall.args, 0, sizeof(self->simcall.args));
312 self->simcall.args[0].dp = (void*) execution;
313 if (self != simix_global->maestro_process) {
314 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
315 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
316 SIMIX_process_yield(self);
318 SIMIX_simcall_pre(&self->simcall, 0);
322 inline static void simcall_BODY_host_execution_cancel(smx_action_t execution) {
323 smx_process_t self = SIMIX_process_self();
324 self->simcall.call = SIMCALL_HOST_EXECUTION_CANCEL;
325 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
326 memset(self->simcall.args, 0, sizeof(self->simcall.args));
327 self->simcall.args[0].dp = (void*) execution;
328 if (self != simix_global->maestro_process) {
329 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
330 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
331 SIMIX_process_yield(self);
333 SIMIX_simcall_pre(&self->simcall, 0);
337 inline static double simcall_BODY_host_execution_get_remains(smx_action_t execution) {
338 smx_process_t self = SIMIX_process_self();
339 self->simcall.call = SIMCALL_HOST_EXECUTION_GET_REMAINS;
340 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
341 memset(self->simcall.args, 0, sizeof(self->simcall.args));
342 self->simcall.args[0].dp = (void*) execution;
343 if (self != simix_global->maestro_process) {
344 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
345 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
346 SIMIX_process_yield(self);
348 SIMIX_simcall_pre(&self->simcall, 0);
350 return self->simcall.result.d;
352 inline static int simcall_BODY_host_execution_get_state(smx_action_t execution) {
353 smx_process_t self = SIMIX_process_self();
354 self->simcall.call = SIMCALL_HOST_EXECUTION_GET_STATE;
355 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
356 memset(self->simcall.args, 0, sizeof(self->simcall.args));
357 self->simcall.args[0].dp = (void*) execution;
358 if (self != simix_global->maestro_process) {
359 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
360 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
361 SIMIX_process_yield(self);
363 SIMIX_simcall_pre(&self->simcall, 0);
365 return self->simcall.result.i;
367 inline static void simcall_BODY_host_execution_set_priority(smx_action_t execution, double priority) {
368 smx_process_t self = SIMIX_process_self();
369 self->simcall.call = SIMCALL_HOST_EXECUTION_SET_PRIORITY;
370 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
371 memset(self->simcall.args, 0, sizeof(self->simcall.args));
372 self->simcall.args[0].dp = (void*) execution;
373 self->simcall.args[1].d = (double) priority;
374 if (self != simix_global->maestro_process) {
375 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
376 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
377 SIMIX_process_yield(self);
379 SIMIX_simcall_pre(&self->simcall, 0);
383 inline static void simcall_BODY_host_execution_set_bound(smx_action_t execution, double bound) {
384 smx_process_t self = SIMIX_process_self();
385 self->simcall.call = SIMCALL_HOST_EXECUTION_SET_BOUND;
386 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
387 memset(self->simcall.args, 0, sizeof(self->simcall.args));
388 self->simcall.args[0].dp = (void*) execution;
389 self->simcall.args[1].d = (double) bound;
390 if (self != simix_global->maestro_process) {
391 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
392 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
393 SIMIX_process_yield(self);
395 SIMIX_simcall_pre(&self->simcall, 0);
399 inline static void simcall_BODY_host_execution_set_affinity(smx_action_t execution, smx_host_t ws, unsigned long mask) {
400 smx_process_t self = SIMIX_process_self();
401 self->simcall.call = SIMCALL_HOST_EXECUTION_SET_AFFINITY;
402 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
403 memset(self->simcall.args, 0, sizeof(self->simcall.args));
404 self->simcall.args[0].dp = (void*) execution;
405 self->simcall.args[1].dp = (void*) ws;
406 self->simcall.args[2].ul = (unsigned long) mask;
407 if (self != simix_global->maestro_process) {
408 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
409 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
410 SIMIX_process_yield(self);
412 SIMIX_simcall_pre(&self->simcall, 0);
416 inline static int simcall_BODY_host_execution_wait(smx_action_t execution) {
417 smx_process_t self = SIMIX_process_self();
418 self->simcall.call = SIMCALL_HOST_EXECUTION_WAIT;
419 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
420 memset(self->simcall.args, 0, sizeof(self->simcall.args));
421 self->simcall.args[0].dp = (void*) execution;
422 if (self != simix_global->maestro_process) {
423 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
424 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
425 SIMIX_process_yield(self);
427 SIMIX_simcall_pre(&self->simcall, 0);
429 return self->simcall.result.i;
431 inline static xbt_dict_t simcall_BODY_host_get_storage_list(smx_host_t host) {
432 smx_process_t self = SIMIX_process_self();
433 self->simcall.call = SIMCALL_HOST_GET_STORAGE_LIST;
434 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
435 memset(self->simcall.args, 0, sizeof(self->simcall.args));
436 self->simcall.args[0].dp = (void*) host;
437 if (self != simix_global->maestro_process) {
438 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
439 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
440 SIMIX_process_yield(self);
442 SIMIX_simcall_pre(&self->simcall, 0);
444 return self->simcall.result.dp;
446 inline static void simcall_BODY_host_get_params(smx_host_t ind_vm, ws_params_t params) {
447 smx_process_t self = SIMIX_process_self();
448 self->simcall.call = SIMCALL_HOST_GET_PARAMS;
449 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
450 memset(self->simcall.args, 0, sizeof(self->simcall.args));
451 self->simcall.args[0].dp = (void*) ind_vm;
452 self->simcall.args[1].dp = (void*) params;
453 if (self != simix_global->maestro_process) {
454 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
455 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
456 SIMIX_process_yield(self);
458 SIMIX_simcall_pre(&self->simcall, 0);
462 inline static void simcall_BODY_host_set_params(smx_host_t ind_vm, ws_params_t params) {
463 smx_process_t self = SIMIX_process_self();
464 self->simcall.call = SIMCALL_HOST_SET_PARAMS;
465 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
466 memset(self->simcall.args, 0, sizeof(self->simcall.args));
467 self->simcall.args[0].dp = (void*) ind_vm;
468 self->simcall.args[1].dp = (void*) params;
469 if (self != simix_global->maestro_process) {
470 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
471 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
472 SIMIX_process_yield(self);
474 SIMIX_simcall_pre(&self->simcall, 0);
478 inline static void* simcall_BODY_vm_create(const char* name, smx_host_t ind_pm) {
479 smx_process_t self = SIMIX_process_self();
480 self->simcall.call = SIMCALL_VM_CREATE;
481 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
482 memset(self->simcall.args, 0, sizeof(self->simcall.args));
483 self->simcall.args[0].cc = (const char*) name;
484 self->simcall.args[1].dp = (void*) ind_pm;
485 if (self != simix_global->maestro_process) {
486 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
487 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
488 SIMIX_process_yield(self);
490 SIMIX_simcall_pre(&self->simcall, 0);
492 return self->simcall.result.dp;
494 inline static void simcall_BODY_vm_start(smx_host_t ind_vm) {
495 smx_process_t self = SIMIX_process_self();
496 self->simcall.call = SIMCALL_VM_START;
497 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
498 memset(self->simcall.args, 0, sizeof(self->simcall.args));
499 self->simcall.args[0].dp = (void*) ind_vm;
500 if (self != simix_global->maestro_process) {
501 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
502 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
503 SIMIX_process_yield(self);
505 SIMIX_simcall_pre(&self->simcall, 0);
509 inline static void simcall_BODY_vm_set_state(smx_host_t ind_vm, int state) {
510 smx_process_t self = SIMIX_process_self();
511 self->simcall.call = SIMCALL_VM_SET_STATE;
512 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
513 memset(self->simcall.args, 0, sizeof(self->simcall.args));
514 self->simcall.args[0].dp = (void*) ind_vm;
515 self->simcall.args[1].i = (int) state;
516 if (self != simix_global->maestro_process) {
517 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
518 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
519 SIMIX_process_yield(self);
521 SIMIX_simcall_pre(&self->simcall, 0);
525 inline static int simcall_BODY_vm_get_state(smx_host_t ind_vm) {
526 smx_process_t self = SIMIX_process_self();
527 self->simcall.call = SIMCALL_VM_GET_STATE;
528 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
529 memset(self->simcall.args, 0, sizeof(self->simcall.args));
530 self->simcall.args[0].dp = (void*) ind_vm;
531 if (self != simix_global->maestro_process) {
532 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
533 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
534 SIMIX_process_yield(self);
536 SIMIX_simcall_pre(&self->simcall, 0);
538 return self->simcall.result.i;
540 inline static void simcall_BODY_vm_migrate(smx_host_t ind_vm, smx_host_t ind_dst_pm) {
541 smx_process_t self = SIMIX_process_self();
542 self->simcall.call = SIMCALL_VM_MIGRATE;
543 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
544 memset(self->simcall.args, 0, sizeof(self->simcall.args));
545 self->simcall.args[0].dp = (void*) ind_vm;
546 self->simcall.args[1].dp = (void*) ind_dst_pm;
547 if (self != simix_global->maestro_process) {
548 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
549 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
550 SIMIX_process_yield(self);
552 SIMIX_simcall_pre(&self->simcall, 0);
556 inline static void* simcall_BODY_vm_get_pm(smx_host_t ind_vm) {
557 smx_process_t self = SIMIX_process_self();
558 self->simcall.call = SIMCALL_VM_GET_PM;
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*) ind_vm;
562 if (self != simix_global->maestro_process) {
563 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
564 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
565 SIMIX_process_yield(self);
567 SIMIX_simcall_pre(&self->simcall, 0);
569 return self->simcall.result.dp;
571 inline static void simcall_BODY_vm_set_bound(smx_host_t ind_vm, double bound) {
572 smx_process_t self = SIMIX_process_self();
573 self->simcall.call = SIMCALL_VM_SET_BOUND;
574 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
575 memset(self->simcall.args, 0, sizeof(self->simcall.args));
576 self->simcall.args[0].dp = (void*) ind_vm;
577 self->simcall.args[1].d = (double) bound;
578 if (self != simix_global->maestro_process) {
579 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
580 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
581 SIMIX_process_yield(self);
583 SIMIX_simcall_pre(&self->simcall, 0);
587 inline static void simcall_BODY_vm_set_affinity(smx_host_t ind_vm, smx_host_t ind_pm, unsigned long mask) {
588 smx_process_t self = SIMIX_process_self();
589 self->simcall.call = SIMCALL_VM_SET_AFFINITY;
590 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
591 memset(self->simcall.args, 0, sizeof(self->simcall.args));
592 self->simcall.args[0].dp = (void*) ind_vm;
593 self->simcall.args[1].dp = (void*) ind_pm;
594 self->simcall.args[2].ul = (unsigned long) mask;
595 if (self != simix_global->maestro_process) {
596 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
597 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
598 SIMIX_process_yield(self);
600 SIMIX_simcall_pre(&self->simcall, 0);
604 inline static void simcall_BODY_vm_destroy(smx_host_t ind_vm) {
605 smx_process_t self = SIMIX_process_self();
606 self->simcall.call = SIMCALL_VM_DESTROY;
607 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
608 memset(self->simcall.args, 0, sizeof(self->simcall.args));
609 self->simcall.args[0].dp = (void*) ind_vm;
610 if (self != simix_global->maestro_process) {
611 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
612 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
613 SIMIX_process_yield(self);
615 SIMIX_simcall_pre(&self->simcall, 0);
619 inline static void simcall_BODY_vm_suspend(smx_host_t ind_vm) {
620 smx_process_t self = SIMIX_process_self();
621 self->simcall.call = SIMCALL_VM_SUSPEND;
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*) ind_vm;
625 if (self != simix_global->maestro_process) {
626 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
627 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
628 SIMIX_process_yield(self);
630 SIMIX_simcall_pre(&self->simcall, 0);
634 inline static void simcall_BODY_vm_resume(smx_host_t ind_vm) {
635 smx_process_t self = SIMIX_process_self();
636 self->simcall.call = SIMCALL_VM_RESUME;
637 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
638 memset(self->simcall.args, 0, sizeof(self->simcall.args));
639 self->simcall.args[0].dp = (void*) ind_vm;
640 if (self != simix_global->maestro_process) {
641 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
642 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
643 SIMIX_process_yield(self);
645 SIMIX_simcall_pre(&self->simcall, 0);
649 inline static void simcall_BODY_vm_shutdown(smx_host_t ind_vm) {
650 smx_process_t self = SIMIX_process_self();
651 self->simcall.call = SIMCALL_VM_SHUTDOWN;
652 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
653 memset(self->simcall.args, 0, sizeof(self->simcall.args));
654 self->simcall.args[0].dp = (void*) ind_vm;
655 if (self != simix_global->maestro_process) {
656 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
657 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
658 SIMIX_process_yield(self);
660 SIMIX_simcall_pre(&self->simcall, 0);
664 inline static void simcall_BODY_vm_save(smx_host_t ind_vm) {
665 smx_process_t self = SIMIX_process_self();
666 self->simcall.call = SIMCALL_VM_SAVE;
667 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
668 memset(self->simcall.args, 0, sizeof(self->simcall.args));
669 self->simcall.args[0].dp = (void*) ind_vm;
670 if (self != simix_global->maestro_process) {
671 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
672 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
673 SIMIX_process_yield(self);
675 SIMIX_simcall_pre(&self->simcall, 0);
679 inline static void simcall_BODY_vm_restore(smx_host_t ind_vm) {
680 smx_process_t self = SIMIX_process_self();
681 self->simcall.call = SIMCALL_VM_RESTORE;
682 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
683 memset(self->simcall.args, 0, sizeof(self->simcall.args));
684 self->simcall.args[0].dp = (void*) ind_vm;
685 if (self != simix_global->maestro_process) {
686 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
687 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
688 SIMIX_process_yield(self);
690 SIMIX_simcall_pre(&self->simcall, 0);
694 inline static void simcall_BODY_process_create(smx_process_t* process, 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) {
695 smx_process_t self = SIMIX_process_self();
696 self->simcall.call = SIMCALL_PROCESS_CREATE;
697 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
698 memset(self->simcall.args, 0, sizeof(self->simcall.args));
699 self->simcall.args[0].dp = (void*) process;
700 self->simcall.args[1].cc = (const char*) name;
701 self->simcall.args[2].fp = (FPtr) code;
702 self->simcall.args[3].dp = (void*) data;
703 self->simcall.args[4].cc = (const char*) hostname;
704 self->simcall.args[5].d = (double) kill_time;
705 self->simcall.args[6].i = (int) argc;
706 self->simcall.args[7].dp = (void*) argv;
707 self->simcall.args[8].dp = (void*) properties;
708 self->simcall.args[9].i = (int) auto_restart;
709 if (self != simix_global->maestro_process) {
710 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
711 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
712 SIMIX_process_yield(self);
714 SIMIX_simcall_pre(&self->simcall, 0);
718 inline static void simcall_BODY_process_kill(smx_process_t process) {
719 smx_process_t self = SIMIX_process_self();
720 self->simcall.call = SIMCALL_PROCESS_KILL;
721 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
722 memset(self->simcall.args, 0, sizeof(self->simcall.args));
723 self->simcall.args[0].dp = (void*) process;
724 if (self != simix_global->maestro_process) {
725 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
726 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
727 SIMIX_process_yield(self);
729 SIMIX_simcall_pre(&self->simcall, 0);
733 inline static void simcall_BODY_process_killall(int reset_pid) {
734 smx_process_t self = SIMIX_process_self();
735 self->simcall.call = SIMCALL_PROCESS_KILLALL;
736 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
737 memset(self->simcall.args, 0, sizeof(self->simcall.args));
738 self->simcall.args[0].i = (int) reset_pid;
739 if (self != simix_global->maestro_process) {
740 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
741 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
742 SIMIX_process_yield(self);
744 SIMIX_simcall_pre(&self->simcall, 0);
748 inline static void simcall_BODY_process_cleanup(smx_process_t process) {
749 smx_process_t self = SIMIX_process_self();
750 self->simcall.call = SIMCALL_PROCESS_CLEANUP;
751 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
752 memset(self->simcall.args, 0, sizeof(self->simcall.args));
753 self->simcall.args[0].dp = (void*) process;
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_pre(&self->simcall, 0);
763 inline static void simcall_BODY_process_change_host(smx_process_t process, smx_host_t dest) {
764 smx_process_t self = SIMIX_process_self();
765 self->simcall.call = SIMCALL_PROCESS_CHANGE_HOST;
766 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
767 memset(self->simcall.args, 0, sizeof(self->simcall.args));
768 self->simcall.args[0].dp = (void*) process;
769 self->simcall.args[1].dp = (void*) dest;
770 if (self != simix_global->maestro_process) {
771 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
772 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
773 SIMIX_process_yield(self);
775 SIMIX_simcall_pre(&self->simcall, 0);
779 inline static void simcall_BODY_process_suspend(smx_process_t process) {
780 smx_process_t self = SIMIX_process_self();
781 self->simcall.call = SIMCALL_PROCESS_SUSPEND;
782 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
783 memset(self->simcall.args, 0, sizeof(self->simcall.args));
784 self->simcall.args[0].dp = (void*) process;
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_pre(&self->simcall, 0);
794 inline static void simcall_BODY_process_resume(smx_process_t process) {
795 smx_process_t self = SIMIX_process_self();
796 self->simcall.call = SIMCALL_PROCESS_RESUME;
797 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
798 memset(self->simcall.args, 0, sizeof(self->simcall.args));
799 self->simcall.args[0].dp = (void*) process;
800 if (self != simix_global->maestro_process) {
801 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
802 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
803 SIMIX_process_yield(self);
805 SIMIX_simcall_pre(&self->simcall, 0);
809 inline static int simcall_BODY_process_count() {
810 smx_process_t self = SIMIX_process_self();
811 self->simcall.call = SIMCALL_PROCESS_COUNT;
812 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
813 memset(self->simcall.args, 0, sizeof(self->simcall.args));
815 if (self != simix_global->maestro_process) {
816 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
817 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
818 SIMIX_process_yield(self);
820 SIMIX_simcall_pre(&self->simcall, 0);
822 return self->simcall.result.i;
824 inline static int simcall_BODY_process_get_PID(smx_process_t process) {
825 smx_process_t self = SIMIX_process_self();
826 self->simcall.call = SIMCALL_PROCESS_GET_PID;
827 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
828 memset(self->simcall.args, 0, sizeof(self->simcall.args));
829 self->simcall.args[0].dp = (void*) process;
830 if (self != simix_global->maestro_process) {
831 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
832 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
833 SIMIX_process_yield(self);
835 SIMIX_simcall_pre(&self->simcall, 0);
837 return self->simcall.result.i;
839 inline static int simcall_BODY_process_get_PPID(smx_process_t process) {
840 smx_process_t self = SIMIX_process_self();
841 self->simcall.call = SIMCALL_PROCESS_GET_PPID;
842 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
843 memset(self->simcall.args, 0, sizeof(self->simcall.args));
844 self->simcall.args[0].dp = (void*) process;
845 if (self != simix_global->maestro_process) {
846 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
847 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
848 SIMIX_process_yield(self);
850 SIMIX_simcall_pre(&self->simcall, 0);
852 return self->simcall.result.i;
854 inline static void* simcall_BODY_process_get_data(smx_process_t process) {
855 smx_process_t self = SIMIX_process_self();
856 self->simcall.call = SIMCALL_PROCESS_GET_DATA;
857 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
858 memset(self->simcall.args, 0, sizeof(self->simcall.args));
859 self->simcall.args[0].dp = (void*) process;
860 if (self != simix_global->maestro_process) {
861 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
862 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
863 SIMIX_process_yield(self);
865 SIMIX_simcall_pre(&self->simcall, 0);
867 return self->simcall.result.dp;
869 inline static void simcall_BODY_process_set_data(smx_process_t process, void* data) {
870 smx_process_t self = SIMIX_process_self();
871 self->simcall.call = SIMCALL_PROCESS_SET_DATA;
872 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
873 memset(self->simcall.args, 0, sizeof(self->simcall.args));
874 self->simcall.args[0].dp = (void*) process;
875 self->simcall.args[1].dp = (void*) data;
876 if (self != simix_global->maestro_process) {
877 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
878 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
879 SIMIX_process_yield(self);
881 SIMIX_simcall_pre(&self->simcall, 0);
885 inline static smx_host_t simcall_BODY_process_get_host(smx_process_t process) {
886 smx_process_t self = SIMIX_process_self();
887 self->simcall.call = SIMCALL_PROCESS_GET_HOST;
888 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
889 memset(self->simcall.args, 0, sizeof(self->simcall.args));
890 self->simcall.args[0].dp = (void*) process;
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_pre(&self->simcall, 0);
898 return self->simcall.result.dp;
900 inline static const char* simcall_BODY_process_get_name(smx_process_t process) {
901 smx_process_t self = SIMIX_process_self();
902 self->simcall.call = SIMCALL_PROCESS_GET_NAME;
903 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
904 memset(self->simcall.args, 0, sizeof(self->simcall.args));
905 self->simcall.args[0].dp = (void*) process;
906 if (self != simix_global->maestro_process) {
907 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
908 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
909 SIMIX_process_yield(self);
911 SIMIX_simcall_pre(&self->simcall, 0);
913 return self->simcall.result.cc;
915 inline static int simcall_BODY_process_is_suspended(smx_process_t process) {
916 smx_process_t self = SIMIX_process_self();
917 self->simcall.call = SIMCALL_PROCESS_IS_SUSPENDED;
918 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
919 memset(self->simcall.args, 0, sizeof(self->simcall.args));
920 self->simcall.args[0].dp = (void*) process;
921 if (self != simix_global->maestro_process) {
922 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
923 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
924 SIMIX_process_yield(self);
926 SIMIX_simcall_pre(&self->simcall, 0);
928 return self->simcall.result.i;
930 inline static xbt_dict_t simcall_BODY_process_get_properties(smx_process_t process) {
931 smx_process_t self = SIMIX_process_self();
932 self->simcall.call = SIMCALL_PROCESS_GET_PROPERTIES;
933 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
934 memset(self->simcall.args, 0, sizeof(self->simcall.args));
935 self->simcall.args[0].dp = (void*) process;
936 if (self != simix_global->maestro_process) {
937 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
938 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
939 SIMIX_process_yield(self);
941 SIMIX_simcall_pre(&self->simcall, 0);
943 return self->simcall.result.dp;
945 inline static int simcall_BODY_process_sleep(double duration) {
946 smx_process_t self = SIMIX_process_self();
947 self->simcall.call = SIMCALL_PROCESS_SLEEP;
948 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
949 memset(self->simcall.args, 0, sizeof(self->simcall.args));
950 self->simcall.args[0].d = (double) duration;
951 if (self != simix_global->maestro_process) {
952 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
953 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
954 SIMIX_process_yield(self);
956 SIMIX_simcall_pre(&self->simcall, 0);
958 return self->simcall.result.i;
960 inline static void simcall_BODY_process_on_exit(smx_process_t process, int_f_pvoid_t fun, void* data) {
961 smx_process_t self = SIMIX_process_self();
962 self->simcall.call = SIMCALL_PROCESS_ON_EXIT;
963 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
964 memset(self->simcall.args, 0, sizeof(self->simcall.args));
965 self->simcall.args[0].dp = (void*) process;
966 self->simcall.args[1].fp = (FPtr) fun;
967 self->simcall.args[2].dp = (void*) data;
968 if (self != simix_global->maestro_process) {
969 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
970 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
971 SIMIX_process_yield(self);
973 SIMIX_simcall_pre(&self->simcall, 0);
977 inline static void simcall_BODY_process_auto_restart_set(smx_process_t process, int auto_restart) {
978 smx_process_t self = SIMIX_process_self();
979 self->simcall.call = SIMCALL_PROCESS_AUTO_RESTART_SET;
980 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
981 memset(self->simcall.args, 0, sizeof(self->simcall.args));
982 self->simcall.args[0].dp = (void*) process;
983 self->simcall.args[1].i = (int) auto_restart;
984 if (self != simix_global->maestro_process) {
985 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
986 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
987 SIMIX_process_yield(self);
989 SIMIX_simcall_pre(&self->simcall, 0);
993 inline static smx_process_t simcall_BODY_process_restart(smx_process_t process) {
994 smx_process_t self = SIMIX_process_self();
995 self->simcall.call = SIMCALL_PROCESS_RESTART;
996 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
997 memset(self->simcall.args, 0, sizeof(self->simcall.args));
998 self->simcall.args[0].dp = (void*) process;
999 if (self != simix_global->maestro_process) {
1000 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1001 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1002 SIMIX_process_yield(self);
1004 SIMIX_simcall_pre(&self->simcall, 0);
1006 return self->simcall.result.dp;
1008 inline static smx_rdv_t simcall_BODY_rdv_create(const char* name) {
1009 smx_process_t self = SIMIX_process_self();
1010 self->simcall.call = SIMCALL_RDV_CREATE;
1011 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1012 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1013 self->simcall.args[0].cc = (const char*) name;
1014 if (self != simix_global->maestro_process) {
1015 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1016 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1017 SIMIX_process_yield(self);
1019 SIMIX_simcall_pre(&self->simcall, 0);
1021 return self->simcall.result.dp;
1023 inline static void simcall_BODY_rdv_destroy(smx_rdv_t rdv) {
1024 smx_process_t self = SIMIX_process_self();
1025 self->simcall.call = SIMCALL_RDV_DESTROY;
1026 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1027 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1028 self->simcall.args[0].dp = (void*) rdv;
1029 if (self != simix_global->maestro_process) {
1030 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1031 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1032 SIMIX_process_yield(self);
1034 SIMIX_simcall_pre(&self->simcall, 0);
1038 inline static smx_host_t simcall_BODY_rdv_get_by_name(const char* name) {
1039 smx_process_t self = SIMIX_process_self();
1040 self->simcall.call = SIMCALL_RDV_GET_BY_NAME;
1041 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1042 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1043 self->simcall.args[0].cc = (const char*) name;
1044 if (self != simix_global->maestro_process) {
1045 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1046 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1047 SIMIX_process_yield(self);
1049 SIMIX_simcall_pre(&self->simcall, 0);
1051 return self->simcall.result.dp;
1053 inline static unsigned int simcall_BODY_rdv_comm_count_by_host(smx_rdv_t rdv, smx_host_t host) {
1054 smx_process_t self = SIMIX_process_self();
1055 self->simcall.call = SIMCALL_RDV_COMM_COUNT_BY_HOST;
1056 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1057 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1058 self->simcall.args[0].dp = (void*) rdv;
1059 self->simcall.args[1].dp = (void*) host;
1060 if (self != simix_global->maestro_process) {
1061 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1062 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1063 SIMIX_process_yield(self);
1065 SIMIX_simcall_pre(&self->simcall, 0);
1067 return self->simcall.result.ui;
1069 inline static smx_action_t simcall_BODY_rdv_get_head(smx_rdv_t rdv) {
1070 smx_process_t self = SIMIX_process_self();
1071 self->simcall.call = SIMCALL_RDV_GET_HEAD;
1072 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1073 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1074 self->simcall.args[0].dp = (void*) rdv;
1075 if (self != simix_global->maestro_process) {
1076 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1077 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1078 SIMIX_process_yield(self);
1080 SIMIX_simcall_pre(&self->simcall, 0);
1082 return self->simcall.result.dp;
1084 inline static void simcall_BODY_rdv_set_receiver(smx_rdv_t rdv, smx_process_t receiver) {
1085 smx_process_t self = SIMIX_process_self();
1086 self->simcall.call = SIMCALL_RDV_SET_RECEIVER;
1087 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1088 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1089 self->simcall.args[0].dp = (void*) rdv;
1090 self->simcall.args[1].dp = (void*) receiver;
1091 if (self != simix_global->maestro_process) {
1092 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1093 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1094 SIMIX_process_yield(self);
1096 SIMIX_simcall_pre(&self->simcall, 0);
1100 inline static smx_process_t simcall_BODY_rdv_get_receiver(smx_rdv_t rdv) {
1101 smx_process_t self = SIMIX_process_self();
1102 self->simcall.call = SIMCALL_RDV_GET_RECEIVER;
1103 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1104 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1105 self->simcall.args[0].dp = (void*) rdv;
1106 if (self != simix_global->maestro_process) {
1107 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1108 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1109 SIMIX_process_yield(self);
1111 SIMIX_simcall_pre(&self->simcall, 0);
1113 return self->simcall.result.dp;
1115 inline static smx_action_t simcall_BODY_comm_iprobe(smx_rdv_t rdv, int src, int tag, simix_match_func_t match_fun, void* data) {
1116 smx_process_t self = SIMIX_process_self();
1117 self->simcall.call = SIMCALL_COMM_IPROBE;
1118 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1119 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1120 self->simcall.args[0].dp = (void*) rdv;
1121 self->simcall.args[1].i = (int) src;
1122 self->simcall.args[2].i = (int) tag;
1123 self->simcall.args[3].fp = (FPtr) match_fun;
1124 self->simcall.args[4].dp = (void*) data;
1125 if (self != simix_global->maestro_process) {
1126 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1127 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1128 SIMIX_process_yield(self);
1130 SIMIX_simcall_pre(&self->simcall, 0);
1132 return self->simcall.result.dp;
1134 inline static void simcall_BODY_comm_send(smx_rdv_t rdv, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, void* data, double timeout) {
1135 smx_process_t self = SIMIX_process_self();
1136 self->simcall.call = SIMCALL_COMM_SEND;
1137 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1138 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1139 self->simcall.args[0].dp = (void*) rdv;
1140 self->simcall.args[1].d = (double) task_size;
1141 self->simcall.args[2].d = (double) rate;
1142 self->simcall.args[3].dp = (void*) src_buff;
1143 self->simcall.args[4].sz = (size_t) src_buff_size;
1144 self->simcall.args[5].fp = (FPtr) match_fun;
1145 self->simcall.args[6].dp = (void*) data;
1146 self->simcall.args[7].d = (double) timeout;
1147 if (self != simix_global->maestro_process) {
1148 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1149 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1150 SIMIX_process_yield(self);
1152 SIMIX_simcall_pre(&self->simcall, 0);
1156 inline static smx_action_t simcall_BODY_comm_isend(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, void* data, int detached) {
1157 smx_process_t self = SIMIX_process_self();
1158 self->simcall.call = SIMCALL_COMM_ISEND;
1159 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1160 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1161 self->simcall.args[0].dp = (void*) rdv;
1162 self->simcall.args[1].d = (double) task_size;
1163 self->simcall.args[2].d = (double) rate;
1164 self->simcall.args[3].dp = (void*) src_buff;
1165 self->simcall.args[4].sz = (size_t) src_buff_size;
1166 self->simcall.args[5].fp = (FPtr) match_fun;
1167 self->simcall.args[6].fp = (FPtr) clean_fun;
1168 self->simcall.args[7].dp = (void*) data;
1169 self->simcall.args[8].i = (int) detached;
1170 if (self != simix_global->maestro_process) {
1171 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1172 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1173 SIMIX_process_yield(self);
1175 SIMIX_simcall_pre(&self->simcall, 0);
1177 return self->simcall.result.dp;
1179 inline static void simcall_BODY_comm_recv(smx_rdv_t rdv, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, void* data, double timeout) {
1180 smx_process_t self = SIMIX_process_self();
1181 self->simcall.call = SIMCALL_COMM_RECV;
1182 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1183 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1184 self->simcall.args[0].dp = (void*) rdv;
1185 self->simcall.args[1].dp = (void*) dst_buff;
1186 self->simcall.args[2].dp = (void*) dst_buff_size;
1187 self->simcall.args[3].fp = (FPtr) match_fun;
1188 self->simcall.args[4].dp = (void*) data;
1189 self->simcall.args[5].d = (double) timeout;
1190 if (self != simix_global->maestro_process) {
1191 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1192 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1193 SIMIX_process_yield(self);
1195 SIMIX_simcall_pre(&self->simcall, 0);
1199 inline static smx_action_t simcall_BODY_comm_irecv(smx_rdv_t rdv, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, void* data) {
1200 smx_process_t self = SIMIX_process_self();
1201 self->simcall.call = SIMCALL_COMM_IRECV;
1202 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1203 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1204 self->simcall.args[0].dp = (void*) rdv;
1205 self->simcall.args[1].dp = (void*) dst_buff;
1206 self->simcall.args[2].dp = (void*) dst_buff_size;
1207 self->simcall.args[3].fp = (FPtr) match_fun;
1208 self->simcall.args[4].dp = (void*) data;
1209 if (self != simix_global->maestro_process) {
1210 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1211 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1212 SIMIX_process_yield(self);
1214 SIMIX_simcall_pre(&self->simcall, 0);
1216 return self->simcall.result.dp;
1218 inline static void simcall_BODY_comm_recv_bounded(smx_rdv_t rdv, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, void* data, double timeout, double rate) {
1219 smx_process_t self = SIMIX_process_self();
1220 self->simcall.call = SIMCALL_COMM_RECV_BOUNDED;
1221 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1222 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1223 self->simcall.args[0].dp = (void*) rdv;
1224 self->simcall.args[1].dp = (void*) dst_buff;
1225 self->simcall.args[2].dp = (void*) dst_buff_size;
1226 self->simcall.args[3].fp = (FPtr) match_fun;
1227 self->simcall.args[4].dp = (void*) data;
1228 self->simcall.args[5].d = (double) timeout;
1229 self->simcall.args[6].d = (double) rate;
1230 if (self != simix_global->maestro_process) {
1231 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1232 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1233 SIMIX_process_yield(self);
1235 SIMIX_simcall_pre(&self->simcall, 0);
1239 inline static smx_action_t simcall_BODY_comm_irecv_bounded(smx_rdv_t rdv, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, void* data, double rate) {
1240 smx_process_t self = SIMIX_process_self();
1241 self->simcall.call = SIMCALL_COMM_IRECV_BOUNDED;
1242 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1243 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1244 self->simcall.args[0].dp = (void*) rdv;
1245 self->simcall.args[1].dp = (void*) dst_buff;
1246 self->simcall.args[2].dp = (void*) dst_buff_size;
1247 self->simcall.args[3].fp = (FPtr) match_fun;
1248 self->simcall.args[4].dp = (void*) data;
1249 self->simcall.args[5].d = (double) rate;
1250 if (self != simix_global->maestro_process) {
1251 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1252 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1253 SIMIX_process_yield(self);
1255 SIMIX_simcall_pre(&self->simcall, 0);
1257 return self->simcall.result.dp;
1259 inline static void simcall_BODY_comm_destroy(smx_action_t comm) {
1260 smx_process_t self = SIMIX_process_self();
1261 self->simcall.call = SIMCALL_COMM_DESTROY;
1262 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1263 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1264 self->simcall.args[0].dp = (void*) comm;
1265 if (self != simix_global->maestro_process) {
1266 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1267 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1268 SIMIX_process_yield(self);
1270 SIMIX_simcall_pre(&self->simcall, 0);
1274 inline static void simcall_BODY_comm_cancel(smx_action_t comm) {
1275 smx_process_t self = SIMIX_process_self();
1276 self->simcall.call = SIMCALL_COMM_CANCEL;
1277 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1278 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1279 self->simcall.args[0].dp = (void*) comm;
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_pre(&self->simcall, 0);
1289 inline static int simcall_BODY_comm_waitany(xbt_dynar_t comms) {
1290 smx_process_t self = SIMIX_process_self();
1291 self->simcall.call = SIMCALL_COMM_WAITANY;
1292 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1293 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1294 self->simcall.args[0].dp = (void*) comms;
1295 if (self != simix_global->maestro_process) {
1296 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1297 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1298 SIMIX_process_yield(self);
1300 SIMIX_simcall_pre(&self->simcall, 0);
1302 return self->simcall.result.i;
1304 inline static void simcall_BODY_comm_wait(smx_action_t comm, double timeout) {
1305 smx_process_t self = SIMIX_process_self();
1306 self->simcall.call = SIMCALL_COMM_WAIT;
1307 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1308 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1309 self->simcall.args[0].dp = (void*) comm;
1310 self->simcall.args[1].d = (double) timeout;
1311 if (self != simix_global->maestro_process) {
1312 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1313 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1314 SIMIX_process_yield(self);
1316 SIMIX_simcall_pre(&self->simcall, 0);
1320 inline static int simcall_BODY_comm_test(smx_action_t comm) {
1321 smx_process_t self = SIMIX_process_self();
1322 self->simcall.call = SIMCALL_COMM_TEST;
1323 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1324 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1325 self->simcall.args[0].dp = (void*) comm;
1326 if (self != simix_global->maestro_process) {
1327 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1328 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1329 SIMIX_process_yield(self);
1331 SIMIX_simcall_pre(&self->simcall, 0);
1333 return self->simcall.result.i;
1335 inline static int simcall_BODY_comm_testany(xbt_dynar_t comms) {
1336 smx_process_t self = SIMIX_process_self();
1337 self->simcall.call = SIMCALL_COMM_TESTANY;
1338 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1339 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1340 self->simcall.args[0].dp = (void*) comms;
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_pre(&self->simcall, 0);
1348 return self->simcall.result.i;
1350 inline static double simcall_BODY_comm_get_remains(smx_action_t comm) {
1351 smx_process_t self = SIMIX_process_self();
1352 self->simcall.call = SIMCALL_COMM_GET_REMAINS;
1353 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1354 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1355 self->simcall.args[0].dp = (void*) comm;
1356 if (self != simix_global->maestro_process) {
1357 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1358 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1359 SIMIX_process_yield(self);
1361 SIMIX_simcall_pre(&self->simcall, 0);
1363 return self->simcall.result.d;
1365 inline static int simcall_BODY_comm_get_state(smx_action_t comm) {
1366 smx_process_t self = SIMIX_process_self();
1367 self->simcall.call = SIMCALL_COMM_GET_STATE;
1368 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1369 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1370 self->simcall.args[0].dp = (void*) comm;
1371 if (self != simix_global->maestro_process) {
1372 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1373 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1374 SIMIX_process_yield(self);
1376 SIMIX_simcall_pre(&self->simcall, 0);
1378 return self->simcall.result.i;
1380 inline static void* simcall_BODY_comm_get_src_data(smx_action_t comm) {
1381 smx_process_t self = SIMIX_process_self();
1382 self->simcall.call = SIMCALL_COMM_GET_SRC_DATA;
1383 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1384 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1385 self->simcall.args[0].dp = (void*) comm;
1386 if (self != simix_global->maestro_process) {
1387 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1388 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1389 SIMIX_process_yield(self);
1391 SIMIX_simcall_pre(&self->simcall, 0);
1393 return self->simcall.result.dp;
1395 inline static void* simcall_BODY_comm_get_dst_data(smx_action_t comm) {
1396 smx_process_t self = SIMIX_process_self();
1397 self->simcall.call = SIMCALL_COMM_GET_DST_DATA;
1398 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1399 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1400 self->simcall.args[0].dp = (void*) comm;
1401 if (self != simix_global->maestro_process) {
1402 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1403 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1404 SIMIX_process_yield(self);
1406 SIMIX_simcall_pre(&self->simcall, 0);
1408 return self->simcall.result.dp;
1410 inline static smx_process_t simcall_BODY_comm_get_src_proc(smx_action_t comm) {
1411 smx_process_t self = SIMIX_process_self();
1412 self->simcall.call = SIMCALL_COMM_GET_SRC_PROC;
1413 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1414 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1415 self->simcall.args[0].dp = (void*) comm;
1416 if (self != simix_global->maestro_process) {
1417 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1418 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1419 SIMIX_process_yield(self);
1421 SIMIX_simcall_pre(&self->simcall, 0);
1423 return self->simcall.result.dp;
1425 inline static smx_process_t simcall_BODY_comm_get_dst_proc(smx_action_t comm) {
1426 smx_process_t self = SIMIX_process_self();
1427 self->simcall.call = SIMCALL_COMM_GET_DST_PROC;
1428 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1429 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1430 self->simcall.args[0].dp = (void*) comm;
1431 if (self != simix_global->maestro_process) {
1432 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1433 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1434 SIMIX_process_yield(self);
1436 SIMIX_simcall_pre(&self->simcall, 0);
1438 return self->simcall.result.dp;
1440 inline static smx_mutex_t simcall_BODY_mutex_init() {
1441 smx_process_t self = SIMIX_process_self();
1442 self->simcall.call = SIMCALL_MUTEX_INIT;
1443 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1444 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1446 if (self != simix_global->maestro_process) {
1447 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1448 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1449 SIMIX_process_yield(self);
1451 SIMIX_simcall_pre(&self->simcall, 0);
1453 return self->simcall.result.dp;
1455 inline static void simcall_BODY_mutex_destroy(smx_mutex_t mutex) {
1456 smx_process_t self = SIMIX_process_self();
1457 self->simcall.call = SIMCALL_MUTEX_DESTROY;
1458 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1459 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1460 self->simcall.args[0].dp = (void*) mutex;
1461 if (self != simix_global->maestro_process) {
1462 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1463 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1464 SIMIX_process_yield(self);
1466 SIMIX_simcall_pre(&self->simcall, 0);
1470 inline static void simcall_BODY_mutex_lock(smx_mutex_t mutex) {
1471 smx_process_t self = SIMIX_process_self();
1472 self->simcall.call = SIMCALL_MUTEX_LOCK;
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*) mutex;
1476 if (self != simix_global->maestro_process) {
1477 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1478 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1479 SIMIX_process_yield(self);
1481 SIMIX_simcall_pre(&self->simcall, 0);
1485 inline static int simcall_BODY_mutex_trylock(smx_mutex_t mutex) {
1486 smx_process_t self = SIMIX_process_self();
1487 self->simcall.call = SIMCALL_MUTEX_TRYLOCK;
1488 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1489 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1490 self->simcall.args[0].dp = (void*) mutex;
1491 if (self != simix_global->maestro_process) {
1492 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1493 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1494 SIMIX_process_yield(self);
1496 SIMIX_simcall_pre(&self->simcall, 0);
1498 return self->simcall.result.i;
1500 inline static void simcall_BODY_mutex_unlock(smx_mutex_t mutex) {
1501 smx_process_t self = SIMIX_process_self();
1502 self->simcall.call = SIMCALL_MUTEX_UNLOCK;
1503 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1504 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1505 self->simcall.args[0].dp = (void*) mutex;
1506 if (self != simix_global->maestro_process) {
1507 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1508 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1509 SIMIX_process_yield(self);
1511 SIMIX_simcall_pre(&self->simcall, 0);
1515 inline static smx_cond_t simcall_BODY_cond_init() {
1516 smx_process_t self = SIMIX_process_self();
1517 self->simcall.call = SIMCALL_COND_INIT;
1518 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1519 memset(self->simcall.args, 0, sizeof(self->simcall.args));
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_pre(&self->simcall, 0);
1528 return self->simcall.result.dp;
1530 inline static void simcall_BODY_cond_destroy(smx_cond_t cond) {
1531 smx_process_t self = SIMIX_process_self();
1532 self->simcall.call = SIMCALL_COND_DESTROY;
1533 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1534 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1535 self->simcall.args[0].dp = (void*) cond;
1536 if (self != simix_global->maestro_process) {
1537 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1538 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1539 SIMIX_process_yield(self);
1541 SIMIX_simcall_pre(&self->simcall, 0);
1545 inline static void simcall_BODY_cond_signal(smx_cond_t cond) {
1546 smx_process_t self = SIMIX_process_self();
1547 self->simcall.call = SIMCALL_COND_SIGNAL;
1548 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1549 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1550 self->simcall.args[0].dp = (void*) cond;
1551 if (self != simix_global->maestro_process) {
1552 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1553 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1554 SIMIX_process_yield(self);
1556 SIMIX_simcall_pre(&self->simcall, 0);
1560 inline static void simcall_BODY_cond_wait(smx_cond_t cond, smx_mutex_t mutex) {
1561 smx_process_t self = SIMIX_process_self();
1562 self->simcall.call = SIMCALL_COND_WAIT;
1563 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1564 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1565 self->simcall.args[0].dp = (void*) cond;
1566 self->simcall.args[1].dp = (void*) mutex;
1567 if (self != simix_global->maestro_process) {
1568 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1569 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1570 SIMIX_process_yield(self);
1572 SIMIX_simcall_pre(&self->simcall, 0);
1576 inline static void simcall_BODY_cond_wait_timeout(smx_cond_t cond, smx_mutex_t mutex, double timeout) {
1577 smx_process_t self = SIMIX_process_self();
1578 self->simcall.call = SIMCALL_COND_WAIT_TIMEOUT;
1579 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1580 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1581 self->simcall.args[0].dp = (void*) cond;
1582 self->simcall.args[1].dp = (void*) mutex;
1583 self->simcall.args[2].d = (double) timeout;
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_pre(&self->simcall, 0);
1593 inline static void simcall_BODY_cond_broadcast(smx_cond_t cond) {
1594 smx_process_t self = SIMIX_process_self();
1595 self->simcall.call = SIMCALL_COND_BROADCAST;
1596 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1597 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1598 self->simcall.args[0].dp = (void*) cond;
1599 if (self != simix_global->maestro_process) {
1600 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1601 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1602 SIMIX_process_yield(self);
1604 SIMIX_simcall_pre(&self->simcall, 0);
1608 inline static smx_sem_t simcall_BODY_sem_init(int capacity) {
1609 smx_process_t self = SIMIX_process_self();
1610 self->simcall.call = SIMCALL_SEM_INIT;
1611 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1612 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1613 self->simcall.args[0].i = (int) capacity;
1614 if (self != simix_global->maestro_process) {
1615 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1616 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1617 SIMIX_process_yield(self);
1619 SIMIX_simcall_pre(&self->simcall, 0);
1621 return self->simcall.result.dp;
1623 inline static void simcall_BODY_sem_destroy(smx_sem_t sem) {
1624 smx_process_t self = SIMIX_process_self();
1625 self->simcall.call = SIMCALL_SEM_DESTROY;
1626 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1627 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1628 self->simcall.args[0].dp = (void*) sem;
1629 if (self != simix_global->maestro_process) {
1630 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1631 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1632 SIMIX_process_yield(self);
1634 SIMIX_simcall_pre(&self->simcall, 0);
1638 inline static void simcall_BODY_sem_release(smx_sem_t sem) {
1639 smx_process_t self = SIMIX_process_self();
1640 self->simcall.call = SIMCALL_SEM_RELEASE;
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*) sem;
1644 if (self != simix_global->maestro_process) {
1645 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1646 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1647 SIMIX_process_yield(self);
1649 SIMIX_simcall_pre(&self->simcall, 0);
1653 inline static int simcall_BODY_sem_would_block(smx_sem_t sem) {
1654 smx_process_t self = SIMIX_process_self();
1655 self->simcall.call = SIMCALL_SEM_WOULD_BLOCK;
1656 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1657 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1658 self->simcall.args[0].dp = (void*) sem;
1659 if (self != simix_global->maestro_process) {
1660 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1661 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1662 SIMIX_process_yield(self);
1664 SIMIX_simcall_pre(&self->simcall, 0);
1666 return self->simcall.result.i;
1668 inline static void simcall_BODY_sem_acquire(smx_sem_t sem) {
1669 smx_process_t self = SIMIX_process_self();
1670 self->simcall.call = SIMCALL_SEM_ACQUIRE;
1671 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1672 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1673 self->simcall.args[0].dp = (void*) sem;
1674 if (self != simix_global->maestro_process) {
1675 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1676 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1677 SIMIX_process_yield(self);
1679 SIMIX_simcall_pre(&self->simcall, 0);
1683 inline static void simcall_BODY_sem_acquire_timeout(smx_sem_t sem, double timeout) {
1684 smx_process_t self = SIMIX_process_self();
1685 self->simcall.call = SIMCALL_SEM_ACQUIRE_TIMEOUT;
1686 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1687 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1688 self->simcall.args[0].dp = (void*) sem;
1689 self->simcall.args[1].d = (double) timeout;
1690 if (self != simix_global->maestro_process) {
1691 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1692 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1693 SIMIX_process_yield(self);
1695 SIMIX_simcall_pre(&self->simcall, 0);
1699 inline static int simcall_BODY_sem_get_capacity(smx_sem_t sem) {
1700 smx_process_t self = SIMIX_process_self();
1701 self->simcall.call = SIMCALL_SEM_GET_CAPACITY;
1702 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1703 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1704 self->simcall.args[0].dp = (void*) sem;
1705 if (self != simix_global->maestro_process) {
1706 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1707 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1708 SIMIX_process_yield(self);
1710 SIMIX_simcall_pre(&self->simcall, 0);
1712 return self->simcall.result.i;
1714 inline static void* simcall_BODY_file_get_data(smx_file_t fd) {
1715 smx_process_t self = SIMIX_process_self();
1716 self->simcall.call = SIMCALL_FILE_GET_DATA;
1717 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1718 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1719 self->simcall.args[0].dp = (void*) fd;
1720 if (self != simix_global->maestro_process) {
1721 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1722 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1723 SIMIX_process_yield(self);
1725 SIMIX_simcall_pre(&self->simcall, 0);
1727 return self->simcall.result.dp;
1729 inline static void simcall_BODY_file_set_data(smx_file_t fd, void* data) {
1730 smx_process_t self = SIMIX_process_self();
1731 self->simcall.call = SIMCALL_FILE_SET_DATA;
1732 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1733 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1734 self->simcall.args[0].dp = (void*) fd;
1735 self->simcall.args[1].dp = (void*) data;
1736 if (self != simix_global->maestro_process) {
1737 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1738 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1739 SIMIX_process_yield(self);
1741 SIMIX_simcall_pre(&self->simcall, 0);
1745 inline static sg_size_t simcall_BODY_file_read(smx_file_t fd, sg_size_t size) {
1746 smx_process_t self = SIMIX_process_self();
1747 self->simcall.call = SIMCALL_FILE_READ;
1748 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1749 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1750 self->simcall.args[0].dp = (void*) fd;
1751 self->simcall.args[1].sgsz = (sg_size_t) size;
1752 if (self != simix_global->maestro_process) {
1753 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1754 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1755 SIMIX_process_yield(self);
1757 SIMIX_simcall_pre(&self->simcall, 0);
1759 return self->simcall.result.sgsz;
1761 inline static sg_size_t simcall_BODY_file_write(smx_file_t fd, sg_size_t size) {
1762 smx_process_t self = SIMIX_process_self();
1763 self->simcall.call = SIMCALL_FILE_WRITE;
1764 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1765 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1766 self->simcall.args[0].dp = (void*) fd;
1767 self->simcall.args[1].sgsz = (sg_size_t) size;
1768 if (self != simix_global->maestro_process) {
1769 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1770 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1771 SIMIX_process_yield(self);
1773 SIMIX_simcall_pre(&self->simcall, 0);
1775 return self->simcall.result.sgsz;
1777 inline static smx_file_t simcall_BODY_file_open(const char* mount, const char* path) {
1778 smx_process_t self = SIMIX_process_self();
1779 self->simcall.call = SIMCALL_FILE_OPEN;
1780 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1781 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1782 self->simcall.args[0].cc = (const char*) mount;
1783 self->simcall.args[1].cc = (const char*) path;
1784 if (self != simix_global->maestro_process) {
1785 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1786 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1787 SIMIX_process_yield(self);
1789 SIMIX_simcall_pre(&self->simcall, 0);
1791 return self->simcall.result.dp;
1793 inline static int simcall_BODY_file_close(smx_file_t fd) {
1794 smx_process_t self = SIMIX_process_self();
1795 self->simcall.call = SIMCALL_FILE_CLOSE;
1796 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1797 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1798 self->simcall.args[0].dp = (void*) fd;
1799 if (self != simix_global->maestro_process) {
1800 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1801 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1802 SIMIX_process_yield(self);
1804 SIMIX_simcall_pre(&self->simcall, 0);
1806 return self->simcall.result.i;
1808 inline static int simcall_BODY_file_unlink(smx_file_t fd) {
1809 smx_process_t self = SIMIX_process_self();
1810 self->simcall.call = SIMCALL_FILE_UNLINK;
1811 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1812 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1813 self->simcall.args[0].dp = (void*) fd;
1814 if (self != simix_global->maestro_process) {
1815 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1816 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1817 SIMIX_process_yield(self);
1819 SIMIX_simcall_pre(&self->simcall, 0);
1821 return self->simcall.result.i;
1823 inline static xbt_dict_t simcall_BODY_file_ls(const char* mount, const char* path) {
1824 smx_process_t self = SIMIX_process_self();
1825 self->simcall.call = SIMCALL_FILE_LS;
1826 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1827 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1828 self->simcall.args[0].cc = (const char*) mount;
1829 self->simcall.args[1].cc = (const char*) path;
1830 if (self != simix_global->maestro_process) {
1831 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1832 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1833 SIMIX_process_yield(self);
1835 SIMIX_simcall_pre(&self->simcall, 0);
1837 return self->simcall.result.dp;
1839 inline static sg_size_t simcall_BODY_file_get_size(smx_file_t fd) {
1840 smx_process_t self = SIMIX_process_self();
1841 self->simcall.call = SIMCALL_FILE_GET_SIZE;
1842 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1843 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1844 self->simcall.args[0].dp = (void*) fd;
1845 if (self != simix_global->maestro_process) {
1846 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1847 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1848 SIMIX_process_yield(self);
1850 SIMIX_simcall_pre(&self->simcall, 0);
1852 return self->simcall.result.sgsz;
1854 inline static sg_size_t simcall_BODY_file_tell(smx_file_t fd) {
1855 smx_process_t self = SIMIX_process_self();
1856 self->simcall.call = SIMCALL_FILE_TELL;
1857 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1858 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1859 self->simcall.args[0].dp = (void*) fd;
1860 if (self != simix_global->maestro_process) {
1861 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1862 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1863 SIMIX_process_yield(self);
1865 SIMIX_simcall_pre(&self->simcall, 0);
1867 return self->simcall.result.sgsz;
1869 inline static int simcall_BODY_file_seek(smx_file_t fd, sg_size_t offset, int origin) {
1870 smx_process_t self = SIMIX_process_self();
1871 self->simcall.call = SIMCALL_FILE_SEEK;
1872 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1873 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1874 self->simcall.args[0].dp = (void*) fd;
1875 self->simcall.args[1].sgsz = (sg_size_t) offset;
1876 self->simcall.args[2].i = (int) origin;
1877 if (self != simix_global->maestro_process) {
1878 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1879 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1880 SIMIX_process_yield(self);
1882 SIMIX_simcall_pre(&self->simcall, 0);
1884 return self->simcall.result.i;
1886 inline static xbt_dynar_t simcall_BODY_file_get_info(smx_file_t fd) {
1887 smx_process_t self = SIMIX_process_self();
1888 self->simcall.call = SIMCALL_FILE_GET_INFO;
1889 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1890 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1891 self->simcall.args[0].dp = (void*) fd;
1892 if (self != simix_global->maestro_process) {
1893 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1894 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1895 SIMIX_process_yield(self);
1897 SIMIX_simcall_pre(&self->simcall, 0);
1899 return self->simcall.result.dp;
1901 inline static void simcall_BODY_storage_file_rename(smx_storage_t storage, const char* src, const char* dest) {
1902 smx_process_t self = SIMIX_process_self();
1903 self->simcall.call = SIMCALL_STORAGE_FILE_RENAME;
1904 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1905 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1906 self->simcall.args[0].dp = (void*) storage;
1907 self->simcall.args[1].cc = (const char*) src;
1908 self->simcall.args[2].cc = (const char*) dest;
1909 if (self != simix_global->maestro_process) {
1910 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1911 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1912 SIMIX_process_yield(self);
1914 SIMIX_simcall_pre(&self->simcall, 0);
1918 inline static sg_size_t simcall_BODY_storage_get_free_size(const char* name) {
1919 smx_process_t self = SIMIX_process_self();
1920 self->simcall.call = SIMCALL_STORAGE_GET_FREE_SIZE;
1921 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1922 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1923 self->simcall.args[0].cc = (const char*) name;
1924 if (self != simix_global->maestro_process) {
1925 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1926 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1927 SIMIX_process_yield(self);
1929 SIMIX_simcall_pre(&self->simcall, 0);
1931 return self->simcall.result.sgsz;
1933 inline static sg_size_t simcall_BODY_storage_get_used_size(const char* name) {
1934 smx_process_t self = SIMIX_process_self();
1935 self->simcall.call = SIMCALL_STORAGE_GET_USED_SIZE;
1936 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1937 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1938 self->simcall.args[0].cc = (const char*) name;
1939 if (self != simix_global->maestro_process) {
1940 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1941 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1942 SIMIX_process_yield(self);
1944 SIMIX_simcall_pre(&self->simcall, 0);
1946 return self->simcall.result.sgsz;
1948 inline static xbt_dict_t simcall_BODY_storage_get_properties(smx_storage_t storage) {
1949 smx_process_t self = SIMIX_process_self();
1950 self->simcall.call = SIMCALL_STORAGE_GET_PROPERTIES;
1951 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1952 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1953 self->simcall.args[0].dp = (void*) storage;
1954 if (self != simix_global->maestro_process) {
1955 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1956 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1957 SIMIX_process_yield(self);
1959 SIMIX_simcall_pre(&self->simcall, 0);
1961 return self->simcall.result.dp;
1963 inline static xbt_dict_t simcall_BODY_storage_get_content(smx_storage_t storage) {
1964 smx_process_t self = SIMIX_process_self();
1965 self->simcall.call = SIMCALL_STORAGE_GET_CONTENT;
1966 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1967 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1968 self->simcall.args[0].dp = (void*) storage;
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_pre(&self->simcall, 0);
1976 return self->simcall.result.dp;
1978 inline static xbt_dict_t simcall_BODY_asr_get_properties(const char* name) {
1979 smx_process_t self = SIMIX_process_self();
1980 self->simcall.call = SIMCALL_ASR_GET_PROPERTIES;
1981 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1982 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1983 self->simcall.args[0].cc = (const char*) name;
1984 if (self != simix_global->maestro_process) {
1985 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
1986 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
1987 SIMIX_process_yield(self);
1989 SIMIX_simcall_pre(&self->simcall, 0);
1991 return self->simcall.result.dp;
1993 #ifdef HAVE_LATENCY_BOUND_TRACKING
1994 inline static int simcall_BODY_comm_is_latency_bounded(smx_action_t comm) {
1995 smx_process_t self = SIMIX_process_self();
1996 self->simcall.call = SIMCALL_COMM_IS_LATENCY_BOUNDED;
1997 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
1998 memset(self->simcall.args, 0, sizeof(self->simcall.args));
1999 self->simcall.args[0].dp = (void*) comm;
2000 if (self != simix_global->maestro_process) {
2001 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
2002 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
2003 SIMIX_process_yield(self);
2005 SIMIX_simcall_pre(&self->simcall, 0);
2007 return self->simcall.result.i;
2012 inline static void simcall_BODY_set_category(smx_action_t action, const char* category) {
2013 smx_process_t self = SIMIX_process_self();
2014 self->simcall.call = SIMCALL_SET_CATEGORY;
2015 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
2016 memset(self->simcall.args, 0, sizeof(self->simcall.args));
2017 self->simcall.args[0].dp = (void*) action;
2018 self->simcall.args[1].cc = (const char*) category;
2019 if (self != simix_global->maestro_process) {
2020 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
2021 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
2022 SIMIX_process_yield(self);
2024 SIMIX_simcall_pre(&self->simcall, 0);
2031 inline static void* simcall_BODY_mc_snapshot() {
2032 smx_process_t self = SIMIX_process_self();
2033 self->simcall.call = SIMCALL_MC_SNAPSHOT;
2034 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
2035 memset(self->simcall.args, 0, sizeof(self->simcall.args));
2037 if (self != simix_global->maestro_process) {
2038 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
2039 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
2040 SIMIX_process_yield(self);
2042 SIMIX_simcall_pre(&self->simcall, 0);
2044 return self->simcall.result.dp;
2046 inline static int simcall_BODY_mc_compare_snapshots(void* s1, void* s2) {
2047 smx_process_t self = SIMIX_process_self();
2048 self->simcall.call = SIMCALL_MC_COMPARE_SNAPSHOTS;
2049 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
2050 memset(self->simcall.args, 0, sizeof(self->simcall.args));
2051 self->simcall.args[0].dp = (void*) s1;
2052 self->simcall.args[1].dp = (void*) s2;
2053 if (self != simix_global->maestro_process) {
2054 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
2055 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
2056 SIMIX_process_yield(self);
2058 SIMIX_simcall_pre(&self->simcall, 0);
2060 return self->simcall.result.i;
2062 inline static int simcall_BODY_mc_random(int min, int max) {
2063 smx_process_t self = SIMIX_process_self();
2064 self->simcall.call = SIMCALL_MC_RANDOM;
2065 memset(&self->simcall.result, 0, sizeof(self->simcall.result));
2066 memset(self->simcall.args, 0, sizeof(self->simcall.args));
2067 self->simcall.args[0].i = (int) min;
2068 self->simcall.args[1].i = (int) max;
2069 if (self != simix_global->maestro_process) {
2070 XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
2071 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
2072 SIMIX_process_yield(self);
2074 SIMIX_simcall_pre(&self->simcall, 0);
2076 return self->simcall.result.i;