Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright lines for 2022.
[simgrid.git] / include / simgrid / plugins / live_migration.h
1 /* Copyright (c) 2017-2022. 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 SIMGRID_PLUGINS_LIVE_MIGRATION_H_
7 #define SIMGRID_PLUGINS_LIVE_MIGRATION_H_
8
9 #include <simgrid/config.h>
10 #include <simgrid/forward.h>
11 #include <xbt/base.h>
12
13 SG_BEGIN_DECL
14
15 XBT_PUBLIC void sg_vm_live_migration_plugin_init();
16 XBT_PRIVATE void sg_vm_dirty_page_tracking_init();
17 XBT_PUBLIC void sg_vm_start_dirty_page_tracking(const_sg_vm_t vm);
18 XBT_PUBLIC void sg_vm_stop_dirty_page_tracking(const_sg_vm_t vm);
19 XBT_PUBLIC double sg_vm_lookup_computed_flops(const_sg_vm_t vm);
20 XBT_PUBLIC void sg_vm_migrate(sg_vm_t vm, sg_host_t dst_pm);
21 XBT_PUBLIC void sg_vm_set_dirty_page_intensity(const_sg_vm_t vm, double intensity);
22 XBT_PUBLIC double sg_vm_get_dirty_page_intensity(const_sg_vm_t vm);
23 XBT_PUBLIC void sg_vm_set_working_set_memory(const_sg_vm_t vm, sg_size_t size);
24 XBT_PUBLIC sg_size_t sg_vm_get_working_set_memory(const_sg_vm_t vm);
25 XBT_PUBLIC void sg_vm_set_migration_speed(const_sg_vm_t vm, double speed);
26 XBT_PUBLIC double sg_vm_get_migration_speed(const_sg_vm_t vm);
27 XBT_PUBLIC double sg_vm_get_max_downtime(const_sg_vm_t vm);
28 XBT_PUBLIC int sg_vm_is_migrating(const_sg_vm_t vm);
29 XBT_PUBLIC sg_vm_t sg_vm_create_migratable(sg_host_t pm, const char* name, int coreAmount, int ramsize,
30                                            int mig_netspeed, int dp_intensity);
31
32 #if SIMGRID_HAVE_MSG
33
34 #define MSG_vm_live_migration_plugin_init() sg_vm_live_migration_plugin_init()
35
36 #define MSG_vm_create_migratable(pm, name, coreAmount, ramsize, mig_netspeed, dp_intensity)                            \
37   sg_vm_create_migratable((pm), (name), (coreAmount), (ramsize), (mig_netspeed), (dp_intensity))
38
39 #define MSG_vm_is_migrating(vm) sg_vm_is_migrating(vm)
40 #define MSG_vm_migrate(vm, dst_pm) sg_vm_migrate((vm), (dst_pm))
41
42 #endif // SIMGRID_HAVE_MSG
43
44 SG_END_DECL
45
46 #endif