Go to the source code of this file.
Macros | |
#define | TW_LOC __FILE__,__LINE__ |
Functions | |
void | tw_rand_init_streams (tw_lp *lp, unsigned int nstreams, unsigned int n_core_streams) |
void | tw_get_stats (tw_pe *me, tw_statistics *s) |
void | tw_stats (tw_pe *me) |
void | tw_all_lp_stats (tw_pe *me) |
const tw_optdef * | tw_clock_setup () |
void | tw_clock_init (tw_pe *me) |
tw_clock | tw_clock_now (tw_pe *me) |
tw_clock | tw_clock_read () |
void | tw_event_send (tw_event *event) |
void | tw_event_rollback (tw_event *event) |
static void | tw_event_free (tw_pe *, tw_event *) |
static void | tw_free_output_messages (tw_event *e, int print_message) |
static void * | tw_event_data (tw_event *event) |
tw_lp * | tw_lp_next_onpe (tw_lp *last, tw_pe *pe) |
void | tw_lp_settype (tw_lpid lp, tw_lptype *type) |
void | tw_lp_onpe (tw_lpid index, tw_pe *pe, tw_lpid id) |
void | tw_lp_onkp (tw_lp *lp, tw_kp *kp) |
void | tw_init_lps (tw_pe *me) |
void | tw_pre_run_lps (tw_pe *me) |
void | tw_lp_setup_types () |
void | tw_lp_suspend (tw_lp *lp, int do_orig_event_rc, int error_num) |
void | tw_kp_onpe (tw_kpid id, tw_pe *pe) |
void | kp_fossil_remote (tw_kp *kp) |
tw_kp * | tw_kp_next_onpe (tw_kp *last, tw_pe *pe) |
void | tw_init_kps (tw_pe *me) |
tw_out * | tw_kp_grab_output_buffer (tw_kp *kp) |
void | tw_kp_put_back_output_buffer (tw_out *out) |
void | tw_kp_rollback_event (tw_event *event) |
void | tw_kp_rollback_to (tw_kp *kp, tw_stime to) |
void | tw_pe_settype (const tw_petype *type) |
void | tw_pe_init (void) |
void | tw_pe_fossil_collect (void) |
void | tw_init (int *argc, char ***argv) |
void | tw_define_lps (tw_lpid nlp, size_t msg_sz) |
void | tw_run (void) |
void | tw_end (void) |
tw_lpid | map_onetype (tw_lpid gid) |
void | tw_sched_init (tw_pe *me) |
void | tw_scheduler_sequential (tw_pe *me) |
void | tw_scheduler_conservative (tw_pe *me) |
void | tw_scheduler_optimistic (tw_pe *me) |
void | tw_scheduler_optimistic_debug (tw_pe *me) |
void | tw_scheduler_optimistic_realtime (tw_pe *me) |
void | tw_scheduler_sequential_rollback_check (tw_pe *me) |
void | tw_scheduler_rollback_and_cancel_events_pe (tw_pe *pe) |
void | tw_snapshot (tw_lp *lp, size_t state_sz) |
long | tw_snapshot_delta (tw_lp *lp, size_t state_sz) |
void | tw_snapshot_restore (tw_lp *lp, size_t state_sz) |
void | tw_wall_now (tw_wtime *t) |
void | tw_wall_sub (tw_wtime *r, tw_wtime *a, tw_wtime *b) |
double | tw_wall_to_double (tw_wtime *t) |
int | tw_output (tw_lp *lp, const char *fmt,...) |
void | tw_error (const char *file, int line, const char *fmt,...) |
void | tw_warning (const char *file, int line, const char *fmt,...) |
void | tw_printf (const char *file, int line, const char *fmt,...) |
void | tw_calloc_stats (size_t *alloc, size_t *waste) |
void * | tw_calloc (const char *file, int line, const char *for_who, size_t e_sz, size_t n) |
void | tw_fprint_binary_array (FILE *output, char const *prefix, void const *array, size_t size) |
Prints content of memory into hexadecimal. |
#define TW_LOC __FILE__,__LINE__ |
Definition at line 178 of file ross-extern.h.
|
extern |
Definition at line 594 of file tw-setup.c.
|
extern |
Definition at line 248 of file tw-stats.c.
|
extern |
|
extern |
|
extern |
Definition at line 28 of file aarch64.c.
References tw_pe::clock_offset, tw_pe::clock_time, tw_clock_read(), tw_clock_read(), and tw_clock_read().
Definition at line 35 of file aarch64.c.
References tw_pe::clock_offset, tw_pe::clock_time, tw_clock_read(), tw_clock_read(), and tw_clock_read().
|
extern |
Definition at line 16 of file bgl.c.
Referenced by tw_clock_init(), and tw_clock_now().
|
extern |
Definition at line 20 of file aarch64.c.
References clock_opts, and g_tw_clock_rate.
|
extern |
IMPORTANT: This function sets the value for g_tw_nlp which is a rather important global variable. It is also set in (very few) other places, but mainly just here.
We can't assume that every model uses equivalent values for g_tw_nlp across PEs so let's allreduce here to calculate how many total LPs there are in the sim.
Definition at line 264 of file tw-setup.c.
|
extern |
Definition at line 476 of file tw-setup.c.
|
extern |
Definition at line 77 of file tw-util.c.
Referenced by tw_calloc().
|
inlinestatic |
|
extern |
Definition at line 221 of file tw-event.c.
|
extern |
Definition at line 15 of file tw-event.c.
|
extern |
|
inlinestatic |
|
extern |
Definition at line 36 of file tw-stats.c.
Referenced by tw_stats().
|
extern |
Definition at line 53 of file tw-setup.c.
|
extern |
LP Suspension Design Notes! (John Jenkins, ANL)
Many times, when developing optimistic models, we are able to determine < LP state, event > pairs which represent infeasible model behavior. These types of simulation states typically arise when time warp causes us to receive and potentially process messages in an order we don't expect.
For example, consider a client/server protocol in which a server sends an ACK to a client upon completion of some event. In optimistic mode, the client can see what amounts to duplicate ACKs from the server due to the server LP rolling back and re-sending an ACK.
While some models can gracefully cope with such issues, more complex models can have troubles (the client in the example could for instance destroy the request metadata after receiving an ACK).
A solution, as noted in the "Dark Side of Risk" paper, is to introduce LP "self-suspend" functionality. If an LP is able to detect a < state, message > pair which is incorrect / unexpected in a well-behaved simulation, the LP should be able to put itself into suspend mode, refusing to process messages until rolled back to a pre < state, message > state. There are two benefits: 1) it greatly reduces the difficulty in tracking down and distinguishing proper model bugs from bugs arising from time-warp related issues such as out-of-order event receipt and 2) it improves simulation performance by pruning the number of processed events that we know are invalid and will be rolled back anyways.
I suggest the function signature tw_suspend(tw_lp *lp, int do_suspend_event_rc, const char * format, ...), with the following semantics:
After a call to tw_suspend, all subsequent events (both forward and reverse) that arrive at the suspended LP shall be processed as if they were no-ops. The reverse event handler of the event that caused the suspend will be run if do_orig_event_rc is nonzero; otherwise, the reverse event handler shall additionally be a no-op. Typically, do_orig_event_rc == 0 is desired, as good coding practices for moderate-or-greater complexity simulations dictate state/event validation prior to modifying LP state (partial rollbacks are very undesirable), but there may be messy logic in the user code for which a partial rollback is warranted (operations that free memory as a side effect of operations, for example). An LP exits suspend state upon rolling back the event that caused the suspend (whether or not that event is processed as a no-op). Upon GVT, if an LP is in self-suspend mode and the event that caused the suspend has a timestamp less than that of GVT, then the simulator shall report the format string of suspended LP(s) and exit. A NULL format string is acceptable for performance purposes, e.g. when doing "production" simulation runs.
lp | Pointer to the LP we're suspending |
do_orig_event_rc | A bool indicating whether or not to skip the RC function |
error_num | User-specified value for tracking purposes; ROSS ignores this |
|
extern |
|
extern |
|
extern |
Definition at line 9 of file tw-pe.c.
Referenced by tw_pe_init().
|
extern |
Definition at line 64 of file tw-util.c.
Referenced by tw_output().
|
extern |
Definition at line 329 of file rand-clcg4.c.
|
extern |
Definition at line 391 of file tw-setup.c.
|
extern |
Definition at line 477 of file tw-sched.c.
|
extern |
Definition at line 778 of file tw-sched.c.
|
extern |
Definition at line 922 of file tw-sched.c.
|
extern |
Definition at line 1028 of file tw-sched.c.
|
extern |
Definition at line 972 of file tw-sched.c.
|
extern |
This function can be called by the GVT hook to guarantee that the state of all LPs has been backtracked to GVT and that all events to process are in the priority queue (pe->pq), i.e, all other queues are empty (cancel events and network events)
Definition at line 529 of file tw-sched.c.
|
extern |
Definition at line 691 of file tw-sched.c.
|
extern |
Definition at line 1111 of file tw-sched.c.
|
extern |
Make a snapshot of the LP state and store it into the delta buffer
Definition at line 9 of file tw-state.c.
|
extern |
Create the delta from the current state and the snapshot. Compress it.
Definition at line 21 of file tw-state.c.
|
extern |
Restore the state of lp to the (decompressed) data held in buffer
Definition at line 55 of file tw-state.c.
|
extern |
Definition at line 126 of file tw-stats.c.
|
extern |
Definition at line 7 of file tw-timing.c.
Definition at line 14 of file tw-timing.c.
|
extern |
Definition at line 27 of file tw-timing.c.
|
extern |
|
extern |
Definition at line 41 of file ross-global.c.
|
extern |
Allocation for buddy system
Definition at line 39 of file ross-global.c.
|
extern |
Definition at line 40 of file ross-global.c.
|
extern |
Definition at line 102 of file ross-global.c.
|
extern |
Definition at line 35 of file ross-global.c.
|
extern |
Definition at line 95 of file ross-global.c.
|
extern |
Definition at line 21 of file ross-global.c.
|
extern |
Definition at line 20 of file ross-global.c.
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
Definition at line 38 of file ross-global.c.
|
extern |
Definition at line 47 of file ross-global.c.
|
extern |
Definition at line 80 of file ross-global.c.
|
extern |
Number of extra events allocated per PE. Command-line customizable.
Definition at line 82 of file ross-global.c.
|
extern |
Definition at line 30 of file ross-global.c.
|
extern |
Definition at line 85 of file ross-global.c.
|
extern |
Definition at line 67 of file ross-global.c.
|
extern |
Definition at line 70 of file ross-global.c.
|
extern |
Definition at line 69 of file ross-global.c.
|
extern |
Definition at line 84 of file ross-global.c.
|
extern |
Definition at line 29 of file ross-global.c.
|
extern |
Definition at line 53 of file ross-global.c.
|
extern |
Definition at line 28 of file ross-global.c.
|
extern |
Definition at line 26 of file ross-global.c.
|
extern |
Definition at line 106 of file ross-global.c.
|
extern |
Definition at line 105 of file ross-global.c.
|
extern |
Tunable LZ4 param. Higher = faster with less compression. 17 is a good value for speed with 1 being the default value.
Definition at line 45 of file ross-global.c.
|
extern |
Definition at line 22 of file ross-global.c.
|
extern |
Definition at line 93 of file ross-global.c.
|
extern |
Definition at line 68 of file ross-global.c.
|
extern |
Number of messages to process at once out of the PQ before returning back to handling things like GVT, message recption, etc. AKA the "batch" parameter to ROSS.
Definition at line 66 of file ross-global.c.
|
extern |
Definition at line 59 of file ross-global.c.
|
extern |
Definition at line 37 of file ross-global.c.
|
extern |
Definition at line 92 of file ross-global.c.
|
extern |
Definition at line 91 of file ross-global.c.
|
extern |
Definition at line 27 of file ross-global.c.
|
extern |
Definition at line 24 of file ross-global.c.
|
extern |
Definition at line 32 of file ross-global.c.
|
extern |
Definition at line 31 of file ross-global.c.
|
extern |
Definition at line 79 of file ross-global.c.
|
extern |
Definition at line 33 of file ross-global.c.
|
extern |
Definition at line 34 of file ross-global.c.
|
extern |
Definition at line 36 of file ross-global.c.
|
extern |
Definition at line 19 of file ross-global.c.
|
extern |
Definition at line 25 of file ross-global.c.
|
extern |
Definition at line 72 of file ross-global.c.