Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot//simgrid/simgrid
[simgrid.git] / src / bindings / lua / simgrid_lua.h
1 /* This program is free software; you can redistribute it and/or modify it
2  * under the terms of the license (GNU LGPL) which comes with this package. */
3
4 #ifndef GRAS_STUB_GENERATOR_H
5 #define GRAS_STUB_GENERATOR_H
6
7 #include <stdio.h>
8 #include <lauxlib.h>
9 #include <lualib.h>
10 #include "msg/msg.h"
11 #include "simdag/simdag.h"
12 #include <gras.h>
13 #include "xbt.h"
14 #include "xbt/dynar.h"
15 #include "xbt/dict.h"
16 #include "xbt/sysdep.h"
17 #include "xbt/function_types.h"
18 #include "xbt/log.h"
19 #include "surf/surfxml_parse.h"
20 #include "surf/surf_private.h"
21 #include "surf/surf.h"
22 #include "portable.h"           /* Needed for the time of the SIMIX convertion */
23 #include <stdarg.h>
24
25
26 xbt_dict_t process_function_set;
27 xbt_dynar_t process_list;
28 xbt_dict_t machine_set;
29
30 typedef struct s_process_t {
31   int argc;
32   char **argv;
33   char *host;
34 } s_process_t;
35
36 char *warning;
37
38 void s_process_free(void *process);
39
40 /* UNIX files */
41 void generate_sim(const char *project);
42 void generate_rl(const char *project);
43 void generate_makefile_am(const char *project);
44 void generate_makefile_local(const char *project);
45
46 /* ********************************************************************************* */
47 /*                           Console functions                                       */
48 /* ********************************************************************************* */
49
50 typedef struct t_AS_attr {
51   const char *id;
52   const char *mode;
53   xbt_dynar_t host_list_d;
54   xbt_dynar_t link_list_d;
55   xbt_dynar_t route_list_d;
56   xbt_dynar_t router_list_d;
57   xbt_dynar_t sub_as_list_id;
58 } AS_attr, *p_AS_attr;
59
60 typedef struct t_host_attr {
61   //platform attribute
62   // Mandatory attributes
63   const char *id;
64   double power_peak;
65   // Optional attributes
66   double power_scale;
67   const char *power_trace;
68   int state_initial;
69   const char *state_trace;
70   int core;
71   //deployment attribute
72   const char *function;
73   xbt_dynar_t args_list;
74   xbt_dict_t properties;
75 } host_attr, *p_host_attr;
76
77
78 typedef struct t_link_attr {
79   //mandatory attributes
80   const char *id;
81   double bandwidth;
82   double latency;
83   // Optional attributes
84   const char *bandwidth_trace;
85   const char *latency_trace;
86   const char *state_trace;
87   int state_initial;
88   int policy;
89 } link_attr, *p_link_attr;
90
91
92 typedef struct t_route_attr {
93   const char *src_id;
94   const char *dest_id;
95   xbt_dynar_t links_id;
96
97 } route_attr, *p_route_attr;
98
99 typedef struct t_router_attr {
100         const char *id;
101 } router_attr, *p_router_attr;
102
103 // Public Functions
104
105 int console_add_host(lua_State*);
106 int console_add_link(lua_State*);
107 int console_add_route(lua_State*);
108 int console_add_AS(lua_State*);
109 int console_set_function(lua_State*);
110 int console_host_set_property(lua_State*);
111
112 int console_parse_platform(void);
113 int console_parse_application(void);
114 int console_parse_platform_wsL07(void);
115
116 #endif