Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
plug some memleaks in simdag tests
[simgrid.git] / include / simgrid / host.h
1 /* Copyright (c) 2013-2016. The SimGrid Team.
2  * All rights reserved.                                                     */
3
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. */
6
7 #ifndef SIMGRID_HOST_H_
8 #define SIMGRID_HOST_H_
9
10 #include <stddef.h>
11
12 #include <xbt/dict.h>
13 #include <xbt/dynar.h>
14
15 #include <simgrid/forward.h>
16
17 #ifdef __cplusplus
18 #include <simgrid/s4u/host.hpp>
19 #endif
20
21 SG_BEGIN_DECL()
22
23 XBT_PUBLIC(size_t) sg_host_count();
24 XBT_PUBLIC(sg_host_t *) sg_host_list(void);
25
26 XBT_PUBLIC(size_t) sg_host_extension_create(void(*deleter)(void*));
27 XBT_PUBLIC(void*) sg_host_extension_get(sg_host_t host, size_t rank);
28 XBT_PUBLIC(sg_host_t) sg_host_by_name(const char *name);
29 XBT_PUBLIC(sg_host_t) sg_host_by_name_or_create(const char *name);
30 XBT_PUBLIC(const char*) sg_host_get_name(sg_host_t host);
31 XBT_PUBLIC(xbt_dynar_t) sg_hosts_as_dynar(void);
32
33 // ========== User Data ==============
34 XBT_PUBLIC(void*) sg_host_user(sg_host_t host);
35 XBT_PUBLIC(void) sg_host_user_set(sg_host_t host, void* userdata);
36 XBT_PUBLIC(void) sg_host_user_destroy(sg_host_t host);
37
38 // ========== MSG Layer ==============
39 typedef struct s_msg_host_priv *msg_host_priv_t;
40 msg_host_priv_t sg_host_msg(sg_host_t host);
41 XBT_PUBLIC(void) sg_host_msg_set(sg_host_t host, msg_host_priv_t priv);
42
43 // ========== Simix layer =============
44 typedef struct s_smx_host_priv *smx_host_priv_t;
45 XBT_PUBLIC(smx_host_priv_t) sg_host_simix(sg_host_t host);
46 XBT_PUBLIC(void) sg_host_simix_set(sg_host_t host, smx_host_priv_t priv);
47 XBT_PUBLIC(void) sg_host_simix_destroy(sg_host_t host);
48
49 // Module initializer. Won't survive the conversion to C++. Hopefully.
50 XBT_PUBLIC(void) sg_host_init(void);
51
52 // ========= storage related functions ============
53 XBT_PUBLIC(xbt_dict_t) sg_host_get_mounted_storage_list(sg_host_t host);
54 XBT_PUBLIC(xbt_dynar_t) sg_host_get_attached_storage_list(sg_host_t host);
55 // =========== user-level functions ===============
56 XBT_PUBLIC(double) sg_host_speed(sg_host_t host);
57 XBT_PUBLIC(double) sg_host_get_available_speed(sg_host_t host);
58 XBT_PUBLIC(int) sg_host_core_count(sg_host_t host);
59 XBT_PUBLIC(int) sg_host_is_on(sg_host_t host);
60
61 XBT_PUBLIC(int) sg_host_get_nb_pstates(sg_host_t host);
62 XBT_PUBLIC(int) sg_host_get_pstate(sg_host_t host);
63 XBT_PUBLIC(void) sg_host_set_pstate(sg_host_t host,int pstate);
64 XBT_PUBLIC(xbt_dict_t) sg_host_get_properties(sg_host_t host);
65 XBT_PUBLIC(const char *) sg_host_get_property_value(sg_host_t host,
66                                                      const char *name);
67 XBT_PUBLIC(void) sg_host_dump(sg_host_t ws);
68 SG_END_DECL()
69
70 #endif /* SIMGRID_HOST_H_ */