Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Don't define (nor use) any MSG symbol when MSG is not built in.
[simgrid.git] / include / simgrid / plugins / load.h
1 /* Copyright (c) 2017-2020. 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_LOAD_H_
7 #define SIMGRID_PLUGINS_LOAD_H_
8
9 #include <simgrid/forward.h>
10 #include <xbt/base.h>
11
12 SG_BEGIN_DECL
13
14 XBT_PUBLIC void sg_host_load_plugin_init();
15 XBT_PUBLIC double sg_host_get_current_load(const_sg_host_t host);
16 XBT_PUBLIC double sg_host_get_avg_load(const_sg_host_t host);
17 XBT_PUBLIC double sg_host_get_idle_time(const_sg_host_t host);
18 XBT_PUBLIC double sg_host_get_total_idle_time(const_sg_host_t host);
19 XBT_PUBLIC double sg_host_get_computed_flops(const_sg_host_t host);
20 XBT_PUBLIC void sg_host_load_reset(const_sg_host_t host);
21
22 XBT_PUBLIC void sg_link_load_plugin_init();
23 XBT_PUBLIC void sg_link_load_track(const_sg_link_t link);
24 XBT_PUBLIC void sg_link_load_untrack(const_sg_link_t link);
25 XBT_PUBLIC void sg_link_load_reset(const_sg_link_t link);
26 XBT_PUBLIC double sg_link_get_cum_load(const_sg_link_t link);
27 XBT_PUBLIC double sg_link_get_avg_load(const_sg_link_t link);
28 XBT_PUBLIC double sg_link_get_min_instantaneous_load(const_sg_link_t link);
29 XBT_PUBLIC double sg_link_get_max_instantaneous_load(const_sg_link_t link);
30
31 #if SIMGRID_HAVE_MSG
32
33 #define MSG_host_load_plugin_init() sg_host_load_plugin_init()
34 /** @brief Returns the current load of that host, as a ratio = achieved_flops / (core_current_speed * core_amount)
35  *
36  *  See simgrid::plugin::HostLoad::get_current_load() for the full documentation.
37  */
38 #define MSG_host_get_current_load(host) sg_host_get_current_load(host)
39 #define MSG_host_get_computed_flops(host) sg_host_get_computed_flops(host)
40 #define MSG_host_get_avg_load(host) sg_host_get_avg_load(host)
41
42 #endif // SIMGRID_HAVE_MSG
43
44 SG_END_DECL
45
46 #endif