Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
eac85bf03614e94ce942b15ab46b20f265cac5fc
[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 SG_BEGIN_DECL()
18
19 XBT_PUBLIC(void) sg_host_exit();
20
21 XBT_PUBLIC(size_t) sg_host_count();
22 XBT_PUBLIC(sg_host_t *) sg_host_list();
23
24 XBT_PUBLIC(size_t) sg_host_extension_create(void(*deleter)(void*));
25 XBT_PUBLIC(void*) sg_host_extension_get(sg_host_t host, size_t rank);
26 XBT_PUBLIC(sg_host_t) sg_host_by_name(const char *name);
27 XBT_PUBLIC(const char*) sg_host_get_name(sg_host_t host);
28 XBT_PUBLIC(xbt_dynar_t) sg_hosts_as_dynar();
29
30 // ========== User Data ==============
31 XBT_PUBLIC(void*) sg_host_user(sg_host_t host);
32 XBT_PUBLIC(void) sg_host_user_set(sg_host_t host, void* userdata);
33 XBT_PUBLIC(void) sg_host_user_destroy(sg_host_t host);
34
35 // ========= storage related functions ============
36 XBT_PUBLIC(xbt_dict_t) sg_host_get_mounted_storage_list(sg_host_t host);
37 XBT_PUBLIC(xbt_dynar_t) sg_host_get_attached_storage_list(sg_host_t host);
38 // =========== user-level functions ===============
39 XBT_PUBLIC(double) sg_host_speed(sg_host_t host);
40 XBT_PUBLIC(double) sg_host_get_available_speed(sg_host_t host);
41
42 XBT_PUBLIC(int) sg_host_get_nb_pstates(sg_host_t host);
43 XBT_PUBLIC(int) sg_host_get_pstate(sg_host_t host);
44 XBT_PUBLIC(void) sg_host_set_pstate(sg_host_t host,int pstate);
45 XBT_PUBLIC(xbt_dict_t) sg_host_get_properties(sg_host_t host);
46 XBT_PUBLIC(const char*) sg_host_get_property_value(sg_host_t host, const char* name);
47 XBT_PUBLIC(void) sg_host_route(sg_host_t from, sg_host_t to, xbt_dynar_t links);
48 XBT_PUBLIC(double) sg_host_route_latency(sg_host_t from, sg_host_t to);
49 XBT_PUBLIC(double) sg_host_route_bandwidth(sg_host_t from, sg_host_t to);
50 XBT_PUBLIC(void) sg_host_dump(sg_host_t ws);
51 SG_END_DECL()
52
53 #endif /* SIMGRID_HOST_H_ */