1 /* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
7 #ifndef _SIMIX_SMURF_PRIVATE_H
8 #define _SIMIX_SMURF_PRIVATE_H
10 /********************************* Requests ***********************************/
12 REQ_NO_REQ, /* Used when there is no ongoing request here */
15 REQ_HOST_GET_PROPERTIES,
17 REQ_HOST_GET_AVAILABLE_SPEED,
22 REQ_HOST_PARALLEL_EXECUTE,
23 REQ_HOST_EXECUTION_DESTROY,
24 REQ_HOST_EXECUTION_CANCEL,
25 REQ_HOST_EXECUTION_GET_REMAINS,
26 REQ_HOST_EXECUTION_GET_STATE,
27 REQ_HOST_EXECUTION_SET_PRIORITY,
28 REQ_HOST_EXECUTION_WAIT,
31 REQ_PROCESS_CHANGE_HOST,
39 REQ_PROCESS_IS_SUSPENDED,
40 REQ_PROCESS_GET_PROPERTIES,
45 REQ_RDV_COMM_COUNT_BY_HOST,
57 REQ_COMM_GET_SRC_DATA,
58 REQ_COMM_GET_DST_DATA,
59 REQ_COMM_GET_SRC_BUFF,
60 REQ_COMM_GET_DST_BUFF,
61 REQ_COMM_GET_SRC_BUFF_SIZE,
62 REQ_COMM_GET_DST_BUFF_SIZE,
63 REQ_COMM_GET_SRC_PROC,
64 REQ_COMM_GET_DST_PROC,
65 #ifdef HAVE_LATENCY_BOUND_TRACKING
66 REQ_COMM_IS_LATENCY_BOUNDED,
80 REQ_COND_WAIT_TIMEOUT,
87 REQ_SEM_ACQUIRE_TIMEOUT,
91 typedef struct s_smx_req {
92 s_xbt_swag_hookup_t state_hookup;
111 } host_get_properties;
121 } host_get_available_speed;
141 double computation_amount;
148 smx_host_t *host_list;
149 double *computation_amount;
150 double *communication_amount;
154 } host_parallel_execute;
157 smx_action_t execution;
158 } host_execution_destroy;
161 smx_action_t execution;
162 } host_execution_cancel;
165 smx_action_t execution;
167 } host_execution_get_remains;
170 smx_action_t execution;
171 e_smx_state_t result;
172 } host_execution_get_state;
175 smx_action_t execution;
177 } host_execution_set_priority;
180 smx_action_t execution;
181 } host_execution_wait;
185 xbt_main_func_t code;
187 const char *hostname;
190 xbt_dict_t properties;
191 smx_process_t result;
195 smx_process_t process;
199 smx_process_t process;
202 } process_change_host;
205 smx_process_t process;
209 smx_process_t process;
217 smx_process_t process;
222 smx_process_t process;
227 smx_process_t process;
232 smx_process_t process;
237 smx_process_t process;
239 } process_is_suspended;
242 smx_process_t process;
244 } process_get_properties;
248 e_smx_state_t result;
269 } rdv_comm_count_by_host;
281 size_t src_buff_size;
282 int (*match_fun)(void *, void *);
290 size_t *dst_buff_size;
291 int (*match_fun)(void *, void *);
331 e_smx_state_t result;
357 } comm_get_src_buff_size;
362 } comm_get_dst_buff_size;
366 smx_process_t result;
371 smx_process_t result;
374 #ifdef HAVE_LATENCY_BOUND_TRACKING
378 } comm_is_latency_bounded;
384 const char *category;
461 } sem_acquire_timeout;
468 } s_smx_req_t, *smx_req_t;
470 /******************************** General *************************************/
472 void SIMIX_request_init(void);
473 void SIMIX_request_destroy(void);
474 void SIMIX_request_push(void);
475 smx_req_t SIMIX_request_pop(void);
476 void SIMIX_request_answer(smx_req_t);
477 void SIMIX_request_pre(smx_req_t, unsigned int);
478 void SIMIX_request_post(smx_action_t);
479 int SIMIX_request_is_visible(smx_req_t req);
480 int SIMIX_request_is_enabled(smx_req_t req);
481 int SIMIX_request_is_enabled_by_idx(smx_req_t req, unsigned int idx);
482 XBT_INLINE smx_req_t SIMIX_req_mine(void);