ROSS
ross-extern.h
Go to the documentation of this file.
1 #ifndef INC_ross_extern_h
2 #define INC_ross_extern_h
3 
4 extern void tw_rand_init_streams(tw_lp * lp, unsigned int nstreams);
5 
6 /*
7  * tw-stats.c
8  */
9 extern void tw_get_stats(tw_pe * me, tw_statistics *s);
10 extern void tw_stats(tw_pe *me);
11 
12 /*
13  * ross-global.c
14  */
18 extern tw_lp_map g_tw_mapping;
19 extern tw_lpid g_tw_nlp;
20 extern tw_lpid g_tw_lp_offset;
21 extern tw_kpid g_tw_nkp;
22 extern tw_lp **g_tw_lp;
23 extern tw_kp **g_tw_kp;
24 extern int g_tw_fossil_attempts;
25 extern unsigned int g_tw_nRNG_per_lp;
27 extern tw_seed g_tw_rng_seed;
28 extern unsigned int g_tw_mblock;
29 extern unsigned int g_tw_gvt_interval;
30 extern unsigned long long g_tw_max_opt_lookahead;
31 extern unsigned long long g_tw_gvt_realtime_interval;
32 extern unsigned long long g_tw_gvt_interval_start_cycles;
33 extern double g_tw_ts_end;
34 extern unsigned int g_tw_sim_started;
35 extern size_t g_tw_msg_sz;
36 extern size_t g_tw_event_msg_sz;
37 extern size_t g_tw_delta_sz;
38 extern uint32_t g_tw_buddy_alloc;
40 extern uint32_t g_tw_avl_node_count;
41 
42 extern unsigned int g_tw_lz4_knob;
43 
44 extern double g_tw_lookahead;
45 extern double g_tw_min_detected_offset;
46 
47 extern tw_pe *g_tw_pe;
48 extern unsigned int g_tw_events_per_pe;
49 extern unsigned int g_tw_events_per_pe_extra;
50 
51 extern unsigned int g_tw_gvt_threshold;
52 extern unsigned int g_tw_gvt_done;
53 
54 extern unsigned int g_tw_net_device_size;
55 extern tw_peid g_tw_mynode;
57 
58 extern FILE *g_tw_csv;
59 
60 extern tw_lptype * g_tw_lp_types;
62 
63 /*
64  * Cycle Counter variables
65  */
72 
73 /*
74  * clock-*
75  */
76 extern const tw_optdef *tw_clock_setup();
77 extern void tw_clock_init(tw_pe * me);
78 extern tw_clock tw_clock_now(tw_pe * me);
79 extern tw_clock tw_clock_read();
80 extern unsigned long long g_tw_clock_rate;
81 
82 /*
83  * tw-event.c
84  */
85 extern void tw_event_send(tw_event * event);
86 extern void tw_event_rollback(tw_event * event);
87 
88 /*
89  * ross-inline.h
90  */
91 static inline void tw_event_free(tw_pe *, tw_event *);
92 static inline void tw_free_output_messages(tw_event *e, int print_message);
93 static inline void * tw_event_data(tw_event * event);
94 
95 /*
96  * tw-lp.c
97  */
98 extern tw_lp *tw_lp_next_onpe(tw_lp * last, tw_pe * pe);
99 extern void tw_lp_settype(tw_lpid lp, tw_lptype * type);
100 extern void tw_lp_onpe(tw_lpid index, tw_pe * pe, tw_lpid id);
101 extern void tw_lp_onkp(tw_lp * lp, tw_kp * kp);
102 extern void tw_init_lps(tw_pe * me);
103 extern void tw_pre_run_lps(tw_pe * me);
104 extern void tw_lp_setup_types();
105 extern void tw_lp_suspend(tw_lp * lp, int do_orig_event_rc, int error_num );
106 
107 /*
108  * tw-kp.c
109  */
110 extern void tw_kp_onpe(tw_kpid id, tw_pe * pe);
111 extern void kp_fossil_remote(tw_kp * kp);
112 extern tw_kp* tw_kp_next_onpe(tw_kp * last, tw_pe * pe);
113 extern void tw_init_kps(tw_pe * me);
115 extern void tw_kp_put_back_output_buffer(tw_out *out);
116 
117 extern void tw_kp_rollback_event(tw_event *event);
118 extern void tw_kp_rollback_to(tw_kp * kp, tw_stime to);
119 
120 /*
121  * tw-pe.c
122  */
123 extern void tw_pe_settype(const tw_petype * type);
124 extern void tw_pe_init(void);
125 extern void tw_pe_fossil_collect(void);
126 
127 /*
128  * tw-setup.c
129  */
130 extern void tw_init(int *argc, char ***argv);
131 extern void tw_define_lps(tw_lpid nlp, size_t msg_sz);
132 extern void tw_run(void);
133 extern void tw_end(void);
134 extern tw_lpid map_onetype (tw_lpid gid);
135 
136 /*
137  * tw-sched.c
138  */
139 extern void tw_sched_init(tw_pe * me);
140 extern void tw_scheduler_sequential(tw_pe * me);
141 extern void tw_scheduler_conservative(tw_pe * me);
142 extern void tw_scheduler_optimistic(tw_pe * me);
143 extern void tw_scheduler_optimistic_debug(tw_pe * me);
144 extern void tw_scheduler_optimistic_realtime(tw_pe * me);
145 
146 /*
147  * tw-state.c
148  */
149 extern void tw_snapshot(tw_lp *lp, size_t state_sz);
150 extern long tw_snapshot_delta(tw_lp *lp, size_t state_sz);
151 extern void tw_snapshot_restore(tw_lp *lp, size_t state_sz);
152 
153 /*
154  * tw-timing.c
155  */
156 extern void tw_wall_now(tw_wtime * t);
157 extern void tw_wall_sub(tw_wtime * r, tw_wtime * a, tw_wtime * b);
158 extern double tw_wall_to_double(tw_wtime * t);
159 
160 /*
161  * tw-util.c
162  */
163 
164 #define TW_LOC __FILE__,__LINE__
165 extern int tw_output(tw_lp *lp, const char *fmt, ...);
166 extern void tw_error(const char *file, int line, const char *fmt, ...) NORETURN;
167 extern void tw_warning(const char *file, int line, const char *fmt, ...);
168 extern void tw_printf(const char *file, int line, const char *fmt, ...);
169 extern void tw_calloc_stats(size_t *alloc, size_t *waste);
170 extern void* tw_calloc(const char *file, int line, const char *for_who, size_t e_sz, size_t n);
171 
172 #endif
void tw_clock_init(tw_pe *me)
Definition: aarch64.c:28
tw_synch g_tw_synchronization_protocol
Definition: ross-global.c:18
tw_lp * tw_lp_next_onpe(tw_lp *last, tw_pe *pe)
unsigned int g_tw_gvt_done
Definition: ross-global.c:81
double g_tw_min_detected_offset
Definition: ross-global.c:55
void tw_kp_onpe(tw_kpid id, tw_pe *pe)
Definition: tw-kp.c:4
void tw_pe_settype(const tw_petype *type)
Definition: tw-pe.c:9
tw_lp ** g_tw_lp
Definition: ross-global.c:26
double tw_stime
Definition: ross.h:150
tw_clock g_tw_cycles_rbs
int tw_output(tw_lp *lp, const char *fmt,...)
Definition: tw-util.c:8
tw_clock g_tw_cycles_ev_abort
void tw_init_kps(tw_pe *me)
Definition: tw-kp.c:131
double g_tw_ts_end
Definition: ross-global.c:68
void tw_error(const char *file, int line, const char *fmt,...) NORETURN
Definition: tw-util.c:74
size_t g_tw_msg_sz
Definition: ross-global.c:33
tw_lpid g_tw_lp_offset
Definition: ross-global.c:24
void tw_pe_init(void)
Definition: tw-pe.c:32
unsigned int g_tw_sim_started
Definition: ross-global.c:32
unsigned int g_tw_gvt_threshold
Definition: ross-global.c:80
void tw_rand_init_streams(tw_lp *lp, unsigned int nstreams)
Definition: rand-clcg4.c:320
void kp_fossil_remote(tw_kp *kp)
void tw_scheduler_optimistic(tw_pe *me)
Definition: tw-sched.c:634
void tw_warning(const char *file, int line, const char *fmt,...)
Definition: tw-util.c:90
static void tw_event_free(tw_pe *, tw_event *)
void tw_kp_rollback_to(tw_kp *kp, tw_stime to)
Definition: tw-kp.c:23
Holds the entire PE state.
Definition: ross-types.h:375
tw_lpid g_tw_nlp
Definition: ross-global.c:23
tw_lp_map
Definition: ross-types.h:37
size_t g_tw_delta_sz
Definition: ross-global.c:34
tw_clock tw_clock_read()
Definition: bgl.c:16
tw_clock tw_clock_now(tw_pe *me)
Definition: aarch64.c:35
void tw_lp_onpe(tw_lpid index, tw_pe *pe, tw_lpid id)
Definition: tw-lp.c:57
int32_t * tw_seed
Definition: rand-clcg4.h:4
unsigned long long g_tw_gvt_realtime_interval
Definition: ross-global.c:65
void tw_lp_settype(tw_lpid lp, tw_lptype *type)
Definition: tw-lp.c:38
uint64_t tw_lpid
Definition: ross.h:160
Function Pointers for ROSS Event Handlers.
Definition: ross-types.h:87
void tw_stats(tw_pe *me)
Definition: tw-stats.c:125
struct timeval tw_wtime
Definition: tw-timing.h:4
Statistics tallied over the duration of the simulation.
Definition: ross-types.h:107
unsigned int g_tw_net_device_size
Definition: ross-global.c:87
Event Stucture.
Definition: ross-types.h:250
void tw_get_stats(tw_pe *me, tw_statistics *s)
Definition: tw-stats.c:35
map_local_f g_tw_custom_lp_global_to_local_map
Definition: ross-global.c:19
tw_clock g_tw_cycles_cancel
unsigned int g_tw_events_per_pe_extra
Definition: ross-global.c:78
buddy_list_bucket_t * g_tw_buddy_master
Definition: ross-global.c:36
unsigned int g_tw_gvt_interval
Definition: ross-global.c:63
const tw_optdef * tw_clock_setup()
Definition: aarch64.c:20
unsigned int g_tw_mblock
Definition: ross-global.c:62
tw_seed g_tw_rng_seed
Definition: ross-global.c:31
tw_lpid(* tw_typemap_f)(tw_lpid gid)
Definition: ross-types.h:99
void tw_pre_run_lps(tw_pe *me)
Definition: tw-lp.c:147
tw_clock g_tw_cycles_gvt
FILE * g_tw_csv
Definition: ross-global.c:91
static void * tw_event_data(tw_event *event)
void tw_run(void)
Definition: tw-setup.c:339
#define NORETURN
Definition: ross.h:94
tw_lp_map g_tw_mapping
Definition: ross-global.c:21
uint32_t g_tw_avl_node_count
Definition: ross-global.c:37
tw_clock g_tw_cycles_ev_queue
tw_peid g_tw_mynode
Definition: ross-global.c:88
tw_peid g_tw_masternode
Definition: ross-global.c:89
void tw_wall_now(tw_wtime *t)
Definition: tw-timing.c:4
void tw_wall_sub(tw_wtime *r, tw_wtime *a, tw_wtime *b)
Definition: tw-timing.c:11
void tw_snapshot_restore(tw_lp *lp, size_t state_sz)
Definition: tw-state.c:55
void tw_lp_onkp(tw_lp *lp, tw_kp *kp)
Definition: tw-lp.c:73
uint32_t g_tw_buddy_alloc
Definition: ross-global.c:35
tw_typemap_f g_tw_lp_typemap
Definition: ross-global.c:102
void tw_init(int *argc, char ***argv)
Definition: tw-setup.c:33
long tw_snapshot_delta(tw_lp *lp, size_t state_sz)
Definition: tw-state.c:21
void tw_scheduler_sequential(tw_pe *me)
Definition: tw-sched.c:445
map_custom_f g_tw_custom_initial_mapping
Definition: ross-global.c:20
static void tw_free_output_messages(tw_event *e, int print_message)
void tw_pe_fossil_collect(void)
Definition: tw-pe.c:62
int g_tw_fossil_attempts
Definition: ross-global.c:28
tw_lptype * g_tw_lp_types
Definition: ross-global.c:101
unsigned int g_tw_nRNG_per_lp
Definition: ross-global.c:29
tw_pe * g_tw_pe
Definition: ross-global.c:75
tw_lpid map_onetype(tw_lpid gid)
Definition: tw-setup.c:538
void tw_kp_rollback_event(tw_event *event)
Definition: tw-kp.c:67
void tw_init_lps(tw_pe *me)
Definition: tw-lp.c:83
unsigned long long g_tw_clock_rate
Definition: ross-global.c:98
void tw_scheduler_optimistic_debug(tw_pe *me)
Definition: tw-sched.c:733
unsigned long tw_peid
Definition: ross.h:147
enum tw_synch_e tw_synch
Definition: ross-types.h:35
void tw_lp_suspend(tw_lp *lp, int do_orig_event_rc, int error_num)
Definition: tw-lp.c:227
tw_peid tw_kpid
Definition: ross-types.h:45
tw_pe * pe
Definition: avl_tree.c:11
uint64_t tw_clock
Definition: aarch64.h:4
size_t g_tw_event_msg_sz
Definition: ross-global.c:43
void tw_scheduler_optimistic_realtime(tw_pe *me)
Definition: tw-sched.c:680
tw_kp * tw_kp_next_onpe(tw_kp *last, tw_pe *pe)
void tw_end(void)
Definition: tw-setup.c:420
void(* map_custom_f)(void)
Definition: ross-types.h:75
Rollback-aware output mechanism.
Definition: ross-types.h:236
double tw_wall_to_double(tw_wtime *t)
Definition: tw-timing.c:24
tw_lpid g_tw_rng_default
Definition: ross-global.c:30
void tw_event_send(tw_event *event)
Definition: tw-event.c:9
Virtual Functions for per PE ops.
Definition: ross-types.h:59
void tw_event_rollback(tw_event *event)
Definition: tw-event.c:181
tw_kpid g_tw_nkp
Definition: ross-global.c:25
unsigned long long g_tw_max_opt_lookahead
Definition: ross-global.c:64
void tw_snapshot(tw_lp *lp, size_t state_sz)
Definition: tw-state.c:9
void tw_sched_init(tw_pe *me)
Definition: tw-sched.c:404
void tw_kp_put_back_output_buffer(tw_out *out)
Definition: tw-kp.c:175
void tw_scheduler_conservative(tw_pe *me)
Definition: tw-sched.c:514
unsigned int g_tw_lz4_knob
Definition: ross-global.c:41
tw_clock g_tw_cycles_ev_proc
double g_tw_lookahead
Definition: ross-global.c:49
void * tw_calloc(const char *file, int line, const char *for_who, size_t e_sz, size_t n)
Definition: tw-util.c:203
tw_out * tw_kp_grab_output_buffer(tw_kp *kp)
Definition: tw-kp.c:162
void tw_define_lps(tw_lpid nlp, size_t msg_sz)
Definition: tw-setup.c:218
tw_lp *(* map_local_f)(tw_lpid)
Definition: ross-types.h:74
unsigned long long g_tw_gvt_interval_start_cycles
Definition: ross-global.c:66
unsigned int g_tw_events_per_pe
Definition: ross-global.c:76
void tw_lp_setup_types()
Definition: tw-lp.c:11
void tw_printf(const char *file, int line, const char *fmt,...)
Definition: tw-util.c:61
void tw_calloc_stats(size_t *alloc, size_t *waste)
Definition: tw-util.c:120
LP State Structure.
Definition: ross-types.h:304
tw_kp ** g_tw_kp
Definition: ross-global.c:27