Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Define and throw simgrid::TracingError.
[simgrid.git] / include / simgrid / vm.h
1 /* Public interface to the Link datatype                                    */
2
3 /* Copyright (c) 2018-2019. The SimGrid Team. All rights reserved.          */
4
5 /* This program is free software; you can redistribute it and/or modify it
6  * under the terms of the license (GNU LGPL) which comes with this package. */
7
8 #ifndef INCLUDE_SIMGRID_VM_H_
9 #define INCLUDE_SIMGRID_VM_H_
10
11 #include <simgrid/forward.h>
12 #include <xbt/base.h>
13
14 /* C interface */
15 SG_BEGIN_DECL()
16
17 /** @brief Opaque type describing a Virtual Machine.
18  *  @ingroup msg_VMs
19  *
20  * All this is highly experimental and the interface will probably change in the future.
21  * Please don't depend on this yet (although testing is welcomed if you feel so).
22  * Usual lack of guaranty of any kind applies here, and is even increased.
23  *
24  */
25 XBT_PUBLIC sg_vm_t sg_vm_create_core(sg_host_t pm, const char* name);
26 XBT_PUBLIC sg_vm_t sg_vm_create_multicore(sg_host_t pm, const char* name, int coreAmount);
27
28 XBT_PUBLIC int sg_vm_is_created(sg_vm_t vm);
29 XBT_PUBLIC int sg_vm_is_running(sg_vm_t vm);
30 XBT_PUBLIC int sg_vm_is_suspended(sg_vm_t vm);
31
32 XBT_PUBLIC const char* sg_vm_get_name(sg_vm_t vm);
33 XBT_PUBLIC void sg_vm_set_ramsize(sg_vm_t vm, size_t size);
34 XBT_PUBLIC size_t sg_vm_get_ramsize(sg_vm_t vm);
35 XBT_PUBLIC void sg_vm_set_bound(sg_vm_t vm, double bound);
36 XBT_PUBLIC sg_host_t sg_vm_get_pm(sg_vm_t vm);
37
38 XBT_PUBLIC void sg_vm_start(sg_vm_t vm);
39 XBT_PUBLIC void sg_vm_suspend(sg_vm_t vm);
40 XBT_PUBLIC void sg_vm_resume(sg_vm_t vm);
41 XBT_PUBLIC void sg_vm_shutdown(sg_vm_t vm);
42 XBT_PUBLIC void sg_vm_destroy(sg_vm_t vm);
43
44 SG_END_DECL()
45
46 #endif /* INCLUDE_SIMGRID_VM_H_ */