Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'lua'
[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 extern xbt_dict_t process_function_set;
26 extern xbt_dynar_t process_list;
27 extern xbt_dict_t machine_set;
28
29 typedef struct s_process_t {
30   int argc;
31   char **argv;
32   char *host;
33 } s_process_t;
34
35 void s_process_free(void *process);
36
37 /* UNIX files */
38 void generate_sim(const char *project);
39 void generate_rl(const char *project);
40 void generate_makefile_am(const char *project);
41 void generate_makefile_local(const char *project);
42
43 /* ********************************************************************************* */
44 /*                           Console functions                                       */
45 /* ********************************************************************************* */
46
47 typedef struct t_AS_attr {
48   const char *id;
49   const char *mode;
50   xbt_dynar_t host_list_d;
51   xbt_dynar_t link_list_d;
52   xbt_dynar_t route_list_d;
53   xbt_dynar_t router_list_d;
54   xbt_dynar_t sub_as_list_id;
55 } AS_attr, *p_AS_attr;
56
57 typedef struct t_host_attr {
58   //platform attribute
59   // Mandatory attributes
60   const char *id;
61   double power_peak;
62   // Optional attributes
63   double power_scale;
64   const char *power_trace;
65   int state_initial;
66   const char *state_trace;
67   int core;
68   //deployment attribute
69   const char *function;
70   xbt_dynar_t args_list;
71   xbt_dict_t properties;
72 } host_attr, *p_host_attr;
73
74
75 typedef struct t_link_attr {
76   //mandatory attributes
77   const char *id;
78   double bandwidth;
79   double latency;
80   // Optional attributes
81   const char *bandwidth_trace;
82   const char *latency_trace;
83   const char *state_trace;
84   int state_initial;
85   int policy;
86 } link_attr, *p_link_attr;
87
88
89 typedef struct t_route_attr {
90   const char *src_id;
91   const char *dest_id;
92   xbt_dynar_t links_id;
93
94 } route_attr, *p_route_attr;
95
96 typedef struct t_router_attr {
97         const char *id;
98 } router_attr, *p_router_attr;
99
100 // Public Functions
101
102 int console_add_host(lua_State*);
103 int console_add_link(lua_State*);
104 int console_add_route(lua_State*);
105 int console_add_AS(lua_State*);
106 int console_set_function(lua_State*);
107 int console_host_set_property(lua_State*);
108
109 int console_parse_platform(void);
110 int console_parse_application(void);
111 int console_parse_platform_wsL07(void);
112
113 #endif