Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Kill features marked deprecated until v3.19.
[simgrid.git] / include / simgrid / msg.h
1 /* Copyright (c) 2004-2018. The SimGrid Team. All rights reserved.          */
2
3 /* This program is free software; you can redistribute it and/or modify it
4  * under the terms of the license (GNU LGPL) which comes with this package. */
5
6 #ifndef MSG_H
7 #define MSG_H
8
9 #include "simgrid/forward.h"
10 #include "simgrid/host.h"
11
12 #include "xbt/base.h"
13 #include "xbt/dict.h"
14 #include "xbt/dynar.h"
15
16 #ifdef __cplusplus
17 #include "simgrid/simix.h"
18 #include <map>
19 namespace simgrid {
20 namespace msg {
21 class Comm;
22 }
23 }
24 typedef simgrid::msg::Comm sg_msg_Comm;
25 #else
26 typedef struct msg_Comm sg_msg_Comm;
27 #endif
28
29 SG_BEGIN_DECL()
30
31 /* *************************** Network Zones ******************************** */
32 #define msg_as_t msg_netzone_t /* portability macro */
33 typedef s4u_NetZone* msg_netzone_t;
34
35 /* ******************************** Host ************************************ */
36
37 /** @brief Host datatype.
38     @ingroup m_host_management
39
40     A <em>location</em> (or <em>host</em>) is any possible place where
41     a process may run. Thus it is represented as a <em>physical
42     resource with computing capabilities</em>, some <em>mailboxes</em>
43     to enable running process to communicate with remote ones, and
44     some <em>private data</em> that can be only accessed by local
45     process.
46  */
47 typedef sg_host_t msg_host_t;
48
49
50 XBT_PUBLIC_DATA(int) sg_storage_max_file_descriptors;
51 /* ******************************** Task ************************************ */
52
53 typedef struct s_simdata_task_t* simdata_task_t;
54
55 typedef struct msg_task {
56   char *name;                   /**< @brief task name if any */
57   simdata_task_t simdata;       /**< @brief simulator data */
58   void *data;                   /**< @brief user data */
59   long long int counter;        /* task unique identifier for instrumentation */
60   char *category;               /* task category for instrumentation */
61 } s_msg_task_t;
62
63 /** @brief Task datatype.
64     @ingroup m_task_management
65
66     A <em>task</em> may then be defined by a <em>computing
67     amount</em>, a <em>message size</em> and some <em>private
68     data</em>.
69  */
70 typedef struct msg_task *msg_task_t;
71
72 /* ******************************** VM ************************************* */
73 typedef sg_vm_t msg_vm_t;
74
75 /* ******************************** File ************************************ */
76 typedef sg_file_t msg_file_t;
77
78 /* ******************************** Storage ************************************ */
79
80 /** @brief Storage datatype.
81  *  @ingroup msg_storage_management
82  *
83  *  You should consider this as an opaque object.
84  */
85 typedef sg_storage_t msg_storage_t;
86
87 /**
88  * \brief @brief Communication action.
89  * \ingroup msg_task_usage
90  *
91  * Object representing an ongoing communication between processes. Such beast is usually obtained by using #MSG_task_isend, #MSG_task_irecv or friends.
92  */
93 typedef sg_msg_Comm* msg_comm_t;
94
95 /** \brief Default value for an uninitialized #msg_task_t.
96     \ingroup m_task_management
97 */
98 #define MSG_TASK_UNINITIALIZED NULL
99
100 /* ****************************** Process *********************************** */
101
102 /** @brief Process datatype.
103     @ingroup m_process_management
104
105     A process may be defined as a <em>code</em>, with some
106     <em>private data</em>, executing in a <em>location</em>.
107
108     You should not access directly to the fields of the pointed
109     structure, but always use the provided API to interact with
110     processes.
111  */
112 typedef s4u_Actor* msg_process_t;
113
114 /** @brief Return code of most MSG functions
115     @ingroup msg_simulation
116     @{ */
117 /* Keep these code as binary values: java bindings manipulate | of these values */
118 typedef enum {
119   MSG_OK = 0,                 /**< @brief Everything is right. Keep on going this way ! */
120   MSG_TIMEOUT = 1,            /**< @brief nothing good happened before the timer you provided elapsed */
121   MSG_TRANSFER_FAILURE = 2,   /**< @brief There has been a problem during you task
122       transfer. Either the network is down or the remote host has been
123       shutdown. */
124   MSG_HOST_FAILURE = 4,       /**< @brief System shutdown. The host on which you are
125       running has just been rebooted. Free your datastructures and
126       return now !*/
127   MSG_TASK_CANCELED = 8      /**< @brief Canceled task. This task has been canceled by somebody!*/
128 } msg_error_t;
129 /** @} */
130
131 /************************** Global ******************************************/
132 XBT_PUBLIC(void) MSG_config(const char *key, const char *value);
133 /** \ingroup msg_simulation
134  *  \brief Initialize the MSG internal data.
135  *  \hideinitializer
136  *
137  *  It also check that the link-time and compile-time versions of SimGrid do
138  *  match, so you should use this version instead of the #MSG_init_nocheck
139  *  function that does the same initializations, but without this check.
140  *
141  *  We allow to link against compiled versions that differ in the patch level.
142  */
143 #define MSG_init(argc,argv)  do {                                                          \
144   sg_version_check(SIMGRID_VERSION_MAJOR,SIMGRID_VERSION_MINOR,SIMGRID_VERSION_PATCH);\
145     MSG_init_nocheck(argc,argv);                                                        \
146   } while (0)
147
148 XBT_PUBLIC(void) MSG_init_nocheck(int *argc, char **argv);
149 XBT_PUBLIC(msg_error_t) MSG_main();;
150 XBT_PUBLIC(void) MSG_function_register(const char *name,
151                                        xbt_main_func_t code);
152 XBT_PUBLIC(void) MSG_function_register_default(xbt_main_func_t code);
153 XBT_PUBLIC(void) MSG_launch_application(const char *file);
154 /*Bypass the parser */
155 XBT_PUBLIC(void) MSG_set_function(const char *host_id,
156                                   const char *function_name,
157                                   xbt_dynar_t arguments);
158
159 XBT_PUBLIC(double) MSG_get_clock();
160 XBT_PUBLIC(unsigned long int) MSG_get_sent_msg();
161
162 /************************** Net Zones ***********************************/
163 XBT_PUBLIC(msg_netzone_t) MSG_zone_get_root();
164 XBT_PUBLIC(const char*) MSG_zone_get_name(msg_netzone_t zone);
165 XBT_PUBLIC(msg_netzone_t) MSG_zone_get_by_name(const char* name);
166 XBT_PUBLIC(void) MSG_zone_get_sons(msg_netzone_t zone, xbt_dict_t whereto);
167 XBT_PUBLIC(const char*) MSG_zone_get_property_value(msg_netzone_t as, const char* name);
168 XBT_PUBLIC(void) MSG_zone_set_property_value(msg_netzone_t netzone, const char* name, char* value);
169 XBT_PUBLIC(void) MSG_zone_get_hosts(msg_netzone_t zone, xbt_dynar_t whereto);
170
171 /************************** Storage handling ***********************************/
172 XBT_PUBLIC(const char *) MSG_storage_get_name(msg_storage_t storage);
173 XBT_PUBLIC(msg_storage_t) MSG_storage_get_by_name(const char *name);
174 XBT_PUBLIC(xbt_dict_t) MSG_storage_get_properties(msg_storage_t storage);
175 XBT_PUBLIC(void) MSG_storage_set_property_value(msg_storage_t storage, const char* name, char* value);
176 XBT_PUBLIC(const char *)MSG_storage_get_property_value(msg_storage_t storage, const char *name);
177 XBT_PUBLIC(xbt_dynar_t) MSG_storages_as_dynar();
178 XBT_PUBLIC(msg_error_t) MSG_storage_set_data(msg_storage_t host, void *data);
179 XBT_PUBLIC(void *) MSG_storage_get_data(msg_storage_t storage);
180 XBT_PUBLIC(const char *) MSG_storage_get_host(msg_storage_t storage);
181 XBT_PUBLIC(sg_size_t) MSG_storage_read(msg_storage_t storage, sg_size_t size);
182 XBT_PUBLIC(sg_size_t) MSG_storage_write(msg_storage_t storage, sg_size_t size);
183
184 /************************** Host handling ***********************************/
185 XBT_PUBLIC(msg_host_t) MSG_host_by_name(const char *name);
186 #define MSG_get_host_by_name(n) MSG_host_by_name(n) /* Rewrite the old name into the new one transparently */
187 XBT_PUBLIC(msg_error_t) MSG_host_set_data(msg_host_t host, void *data);
188 XBT_PUBLIC(void *) MSG_host_get_data(msg_host_t host);
189 /** \ingroup m_host_management
190  *
191  * \brief Return the name of the #msg_host_t. */
192 #define MSG_host_get_name(host) sg_host_get_name(host)
193 XBT_PUBLIC(void) MSG_host_on(msg_host_t host);
194 XBT_PUBLIC(void) MSG_host_off(msg_host_t host);
195 XBT_PUBLIC(msg_host_t) MSG_host_self();
196 XBT_PUBLIC(double) MSG_host_get_speed(msg_host_t h);
197 XBT_PUBLIC(int) MSG_host_get_core_number(msg_host_t h);
198 XBT_PUBLIC(void) MSG_host_get_process_list(msg_host_t h, xbt_dynar_t whereto);
199 XBT_PUBLIC(int) MSG_host_is_on(msg_host_t h);
200 XBT_PUBLIC(int) MSG_host_is_off(msg_host_t h);
201
202 XBT_ATTRIB_DEPRECATED_v320("Use MSG_host_get_speed(): v3.20 will drop MSG_host_get_current_power_peak() "
203                            "completely.") static inline double MSG_host_get_current_power_peak(msg_host_t host)
204 {
205   return MSG_host_get_speed(host);
206 }
207
208 XBT_PUBLIC(double) MSG_host_get_power_peak_at(msg_host_t h, int pstate);
209 XBT_PUBLIC(int)    MSG_host_get_nb_pstates(msg_host_t h);
210 #define MSG_host_get_pstate(h) sg_host_get_pstate(h) /* users don't know that MSG is the C version of SimGrid */
211 #define MSG_host_set_pstate(h, pstate) sg_host_set_pstate(h, pstate) /* (same here) */
212 XBT_PUBLIC(xbt_dynar_t) MSG_hosts_as_dynar();
213 XBT_PUBLIC(int) MSG_get_host_number();
214 XBT_PUBLIC(xbt_dict_t) MSG_host_get_mounted_storage_list(msg_host_t host);
215 XBT_PUBLIC(xbt_dynar_t) MSG_host_get_attached_storage_list(msg_host_t host);
216
217 /*property handlers*/
218 XBT_PUBLIC(xbt_dict_t) MSG_host_get_properties(msg_host_t host);
219 XBT_PUBLIC(const char*) MSG_host_get_property_value(msg_host_t host, const char* name);
220 XBT_PUBLIC(void) MSG_host_set_property_value(msg_host_t host, const char* name, char* value);
221
222 XBT_PUBLIC(void) MSG_create_environment(const char *file);
223
224 /************************** Process handling *********************************/
225 XBT_PUBLIC(msg_process_t) MSG_process_create(const char *name,
226                                            xbt_main_func_t code,
227                                            void *data, msg_host_t host);
228 XBT_PUBLIC(msg_process_t)
229 MSG_process_create_with_arguments(const char* name, xbt_main_func_t code, void* data, msg_host_t host, int argc,
230                                   char** argv);
231 XBT_PUBLIC(msg_process_t)
232 MSG_process_create_with_environment(const char* name, xbt_main_func_t code, void* data, msg_host_t host, int argc,
233                                     char** argv, xbt_dict_t properties);
234
235 XBT_PUBLIC(msg_process_t) MSG_process_attach(const char* name, void* data, msg_host_t host, xbt_dict_t properties);
236 XBT_PUBLIC(void) MSG_process_detach();
237
238 XBT_PUBLIC(void) MSG_process_kill(msg_process_t process);
239 XBT_PUBLIC(int) MSG_process_killall(int reset_PIDs);
240 XBT_PUBLIC(msg_error_t) MSG_process_migrate(msg_process_t process, msg_host_t host);
241 XBT_PUBLIC(void) MSG_process_yield();
242
243 XBT_PUBLIC(void *) MSG_process_get_data(msg_process_t process);
244 XBT_PUBLIC(msg_error_t) MSG_process_set_data(msg_process_t process,
245                                              void *data);
246 XBT_PUBLIC(void) MSG_process_set_data_cleanup(void_f_pvoid_t data_cleanup);
247 XBT_PUBLIC(msg_host_t) MSG_process_get_host(msg_process_t process);
248 XBT_PUBLIC(msg_process_t) MSG_process_from_PID(int PID);
249 XBT_PUBLIC(int) MSG_process_get_PID(msg_process_t process);
250 XBT_PUBLIC(int) MSG_process_get_PPID(msg_process_t process);
251 XBT_PUBLIC(const char *) MSG_process_get_name(msg_process_t process);
252 XBT_PUBLIC(int) MSG_process_self_PID();
253 XBT_PUBLIC(int) MSG_process_self_PPID();
254 XBT_PUBLIC(const char*) MSG_process_self_name();
255 XBT_PUBLIC(msg_process_t) MSG_process_self();
256 XBT_PUBLIC(xbt_dynar_t) MSG_processes_as_dynar();
257 XBT_PUBLIC(int) MSG_process_get_number();
258
259 XBT_PUBLIC(msg_error_t) MSG_process_set_kill_time(msg_process_t process, double kill_time);
260
261 /*property handlers*/
262 XBT_PUBLIC(xbt_dict_t) MSG_process_get_properties(msg_process_t process);
263 XBT_PUBLIC(const char*) MSG_process_get_property_value(msg_process_t process, const char* name);
264
265 XBT_PUBLIC(msg_error_t) MSG_process_suspend(msg_process_t process);
266 XBT_PUBLIC(msg_error_t) MSG_process_resume(msg_process_t process);
267 XBT_PUBLIC(int) MSG_process_is_suspended(msg_process_t process);
268 XBT_PUBLIC(void) MSG_process_on_exit(int_f_pvoid_pvoid_t fun, void *data);
269 XBT_PUBLIC(void) MSG_process_auto_restart_set(msg_process_t process, int auto_restart);
270
271 XBT_PUBLIC(void) MSG_process_daemonize(msg_process_t process);
272 XBT_PUBLIC(msg_process_t) MSG_process_restart(msg_process_t process);
273 XBT_PUBLIC(void) MSG_process_ref(msg_process_t process);
274 XBT_PUBLIC(void) MSG_process_unref(msg_process_t process);
275
276 /************************** Task handling ************************************/
277 XBT_PUBLIC(msg_task_t) MSG_task_create(const char* name, double flops_amount, double bytes_amount, void* data);
278 XBT_PUBLIC(msg_task_t) MSG_parallel_task_create(const char *name,
279                                               int host_nb,
280                                               const msg_host_t * host_list,
281                                               double *flops_amount,
282                                               double *bytes_amount,
283                                               void *data);
284 XBT_PUBLIC(void *) MSG_task_get_data(msg_task_t task);
285 XBT_PUBLIC(void) MSG_task_set_data(msg_task_t task, void *data);
286 XBT_PUBLIC(void) MSG_task_set_copy_callback(void (*callback) (
287     msg_task_t task, msg_process_t src, msg_process_t dst));
288 XBT_PUBLIC(msg_process_t) MSG_task_get_sender(msg_task_t task);
289 XBT_PUBLIC(msg_host_t) MSG_task_get_source(msg_task_t task);
290 XBT_PUBLIC(const char *) MSG_task_get_name(msg_task_t task);
291 XBT_PUBLIC(void) MSG_task_set_name(msg_task_t task, const char *name);
292 XBT_PUBLIC(msg_error_t) MSG_task_cancel(msg_task_t task);
293 XBT_PUBLIC(msg_error_t) MSG_task_destroy(msg_task_t task);
294
295 XBT_PUBLIC(msg_error_t) MSG_task_execute(msg_task_t task);
296 XBT_PUBLIC(msg_error_t) MSG_parallel_task_execute(msg_task_t task);
297 XBT_PUBLIC(msg_error_t) MSG_parallel_task_execute_with_timeout(msg_task_t task, double timeout);
298 XBT_PUBLIC(void) MSG_task_set_priority(msg_task_t task, double priority);
299 XBT_PUBLIC(void) MSG_task_set_bound(msg_task_t task, double bound);
300
301 XBT_PUBLIC(msg_error_t) MSG_process_join(msg_process_t process, double timeout);
302 XBT_PUBLIC(msg_error_t) MSG_process_sleep(double nb_sec);
303
304 XBT_PUBLIC(void) MSG_task_set_flops_amount(msg_task_t task, double flops_amount);
305 XBT_PUBLIC(double) MSG_task_get_flops_amount(msg_task_t task);
306 XBT_PUBLIC(double) MSG_task_get_remaining_work_ratio(msg_task_t task);
307 XBT_PUBLIC(void) MSG_task_set_bytes_amount(msg_task_t task, double bytes_amount);
308
309
310 XBT_PUBLIC(double) MSG_task_get_remaining_communication(msg_task_t task);
311 XBT_PUBLIC(int) MSG_task_is_latency_bounded(msg_task_t task);
312 XBT_PUBLIC(double) MSG_task_get_bytes_amount(msg_task_t task);
313
314 XBT_PUBLIC(msg_error_t) MSG_task_receive_ext(msg_task_t* task, const char* alias, double timeout, msg_host_t host);
315
316 XBT_PUBLIC(msg_error_t) MSG_task_receive_with_timeout(msg_task_t* task, const char* alias, double timeout);
317
318 XBT_PUBLIC(msg_error_t) MSG_task_receive(msg_task_t* task, const char* alias);
319 #define MSG_task_recv(t,a) MSG_task_receive(t,a)
320
321 XBT_PUBLIC(msg_error_t)
322 MSG_task_receive_ext_bounded(msg_task_t* task, const char* alias, double timeout, msg_host_t host, double rate);
323
324 XBT_PUBLIC(msg_error_t)
325 MSG_task_receive_with_timeout_bounded(msg_task_t* task, const char* alias, double timeout, double rate);
326 XBT_PUBLIC(msg_error_t) MSG_task_receive_bounded(msg_task_t * task, const char *alias,double rate);
327 #define MSG_task_recv_bounded(t,a,r) MSG_task_receive_bounded(t,a,r)
328
329 XBT_PUBLIC(msg_comm_t) MSG_task_isend(msg_task_t task, const char *alias);
330 XBT_PUBLIC(msg_comm_t) MSG_task_isend_bounded(msg_task_t task, const char *alias, double maxrate);
331 XBT_ATTRIB_DEPRECATED_v320(
332     "This function will be removed from SimGrid v3.20. If you really need this function, please speak up quickly.")
333     XBT_PUBLIC(msg_comm_t) MSG_task_isend_with_matching(msg_task_t task, const char* alias,
334                                                         int (*match_fun)(void*, void*, void*), void* match_data);
335
336 XBT_PUBLIC(void) MSG_task_dsend(msg_task_t task, const char *alias, void_f_pvoid_t cleanup);
337 XBT_PUBLIC(void) MSG_task_dsend_bounded(msg_task_t task, const char *alias, void_f_pvoid_t cleanup, double maxrate);
338 XBT_PUBLIC(msg_comm_t) MSG_task_irecv(msg_task_t * task, const char *alias);
339 XBT_PUBLIC(msg_comm_t) MSG_task_irecv_bounded(msg_task_t * task, const char *alias, double rate);
340 XBT_PUBLIC(int) MSG_comm_test(msg_comm_t comm);
341 XBT_PUBLIC(int) MSG_comm_testany(xbt_dynar_t comms);
342 XBT_PUBLIC(void) MSG_comm_destroy(msg_comm_t comm);
343 XBT_PUBLIC(msg_error_t) MSG_comm_wait(msg_comm_t comm, double timeout);
344 XBT_PUBLIC(void) MSG_comm_waitall(msg_comm_t * comm, int nb_elem, double timeout);
345 XBT_PUBLIC(int) MSG_comm_waitany(xbt_dynar_t comms);
346 XBT_PUBLIC(msg_task_t) MSG_comm_get_task(msg_comm_t comm);
347 XBT_PUBLIC(msg_error_t) MSG_comm_get_status(msg_comm_t comm);
348
349 XBT_PUBLIC(int) MSG_task_listen(const char *alias);
350 XBT_PUBLIC(msg_error_t) MSG_task_send_with_timeout(msg_task_t task, const char *alias, double timeout);
351 XBT_PUBLIC(msg_error_t) MSG_task_send_with_timeout_bounded(msg_task_t task, const char *alias, double timeout, double maxrate);
352 XBT_PUBLIC(msg_error_t) MSG_task_send(msg_task_t task, const char *alias);
353 XBT_PUBLIC(msg_error_t) MSG_task_send_bounded(msg_task_t task, const char *alias, double rate);
354 XBT_PUBLIC(int) MSG_task_listen_from(const char *alias);
355 XBT_PUBLIC(void) MSG_task_set_category (msg_task_t task, const char *category);
356 XBT_PUBLIC(const char *) MSG_task_get_category (msg_task_t task);
357
358 /************************** Mailbox handling ************************************/
359
360 /* @brief MSG_mailbox_set_async - set a mailbox as eager
361  * Sets the mailbox to a permanent receiver mode. Messages sent to this mailbox will then be sent just after the send
362  * is issued, without waiting for the corresponding receive.
363  * This call should be done before issuing any receive, and on the receiver's side only
364  * @param alias    The alias of the mailbox to modify.
365  */
366 XBT_PUBLIC(void) MSG_mailbox_set_async(const char *alias);
367
368 /************************** Action handling **********************************/
369 XBT_PUBLIC(msg_error_t) MSG_action_trace_run(char *path);
370 XBT_PUBLIC(void) MSG_action_init();
371 XBT_PUBLIC(void) MSG_action_exit();
372
373 /** @brief Opaque type representing a semaphore
374  *  @ingroup msg_synchro
375  *  @hideinitializer
376  */
377 typedef struct s_smx_sem_t* msg_sem_t; // Yeah that's a rename of the smx_sem_t which doesnt require smx_sem_t to be
378                                        // declared here
379 XBT_PUBLIC(msg_sem_t) MSG_sem_init(int initial_value);
380 XBT_PUBLIC(void) MSG_sem_acquire(msg_sem_t sem);
381 XBT_PUBLIC(msg_error_t) MSG_sem_acquire_timeout(msg_sem_t sem, double timeout);
382 XBT_PUBLIC(void) MSG_sem_release(msg_sem_t sem);
383 XBT_PUBLIC(int) MSG_sem_get_capacity(msg_sem_t sem);
384 XBT_PUBLIC(void) MSG_sem_destroy(msg_sem_t sem);
385 XBT_PUBLIC(int) MSG_sem_would_block(msg_sem_t sem);
386
387 /** @brief Opaque type representing a barrier identifier
388  *  @ingroup msg_synchro
389  *  @hideinitializer
390  */
391
392 #define MSG_BARRIER_SERIAL_PROCESS -1
393 typedef struct s_msg_bar_t* msg_bar_t;
394 XBT_PUBLIC(msg_bar_t) MSG_barrier_init( unsigned int count);
395 XBT_PUBLIC(void) MSG_barrier_destroy(msg_bar_t bar);
396 XBT_PUBLIC(int) MSG_barrier_wait(msg_bar_t bar);
397
398 /** @brief Opaque type describing a Virtual Machine.
399  *  @ingroup msg_VMs
400  *
401  * All this is highly experimental and the interface will probably change in the future.
402  * Please don't depend on this yet (although testing is welcomed if you feel so).
403  * Usual lack of guaranty of any kind applies here, and is even increased.
404  *
405  */
406
407 XBT_PUBLIC(int) MSG_vm_is_created(msg_vm_t vm);
408 XBT_PUBLIC(int) MSG_vm_is_running(msg_vm_t vm);
409 XBT_PUBLIC(int) MSG_vm_is_migrating(msg_vm_t vm);
410 XBT_PUBLIC(int) MSG_vm_is_suspended(msg_vm_t vm);
411
412 XBT_PUBLIC(const char*) MSG_vm_get_name(msg_vm_t vm);
413 XBT_PUBLIC(void) MSG_vm_set_ramsize(msg_vm_t vm, size_t size);
414 XBT_PUBLIC(size_t) MSG_vm_get_ramsize(msg_vm_t vm);
415
416 // TODO add VDI later
417 XBT_PUBLIC(msg_vm_t) MSG_vm_create_core(msg_host_t location, const char *name);
418 XBT_PUBLIC(msg_vm_t) MSG_vm_create_multicore(msg_host_t pm, const char* name, int coreAmount);
419 XBT_PUBLIC(msg_vm_t)
420 MSG_vm_create(msg_host_t ind_pm, const char* name, int coreAmount, int ramsize, int mig_netspeed, int dp_intensity);
421
422 XBT_PUBLIC(void) MSG_vm_destroy(msg_vm_t vm);
423
424 XBT_PUBLIC(void) MSG_vm_start(msg_vm_t vm);
425
426 /* Shutdown the guest operating system. */
427 XBT_PUBLIC(void) MSG_vm_shutdown(msg_vm_t vm);
428
429 /* Suspend the execution of the VM, but keep its state on memory. */
430 XBT_PUBLIC(void) MSG_vm_suspend(msg_vm_t vm);
431 XBT_PUBLIC(void) MSG_vm_resume(msg_vm_t vm);
432
433 XBT_PUBLIC(msg_host_t) MSG_vm_get_pm(msg_vm_t vm);
434 XBT_PUBLIC(void) MSG_vm_set_bound(msg_vm_t vm, double bound);
435
436 #include "simgrid/instr.h"
437
438 /* ****************************************************************************************** */
439 /* Used only by the bindings -- unclean pimple, please ignore if you're not writing a binding */
440 XBT_PUBLIC(smx_context_t) MSG_process_get_smx_ctx(msg_process_t process);
441
442 SG_END_DECL()
443
444 #ifdef __cplusplus
445 XBT_PUBLIC(msg_process_t)
446 MSG_process_create_from_stdfunc(const char* name, std::function<void()> code, void* data, msg_host_t host,
447                                 std::map<std::string, std::string>* properties);
448 #endif
449
450 #endif