ROSS
ross-extern.h File Reference
#include <stdio.h>
#include "buddy.h"
#include "ross-types.h"
#include "tw-opts.h"

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_optdeftw_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_lptw_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_kptw_kp_next_onpe (tw_kp *last, tw_pe *pe)
void tw_init_kps (tw_pe *me)
tw_outtw_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_kp_rollback_to_sig (tw_kp *kp, tw_event_sig const *to_sig)
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.

Variables

tw_synch g_tw_synchronization_protocol
map_local_f g_tw_custom_lp_global_to_local_map
map_custom_f g_tw_custom_initial_mapping
tw_lp_map g_tw_mapping
tw_lpid g_tw_nlp
tw_lpid g_tw_total_lps
tw_lpid g_tw_lp_offset
tw_kpid g_tw_nkp
tw_lp ** g_tw_lp
tw_kp ** g_tw_kp
int g_tw_fossil_attempts
unsigned int g_tw_nRNG_per_lp
unsigned int g_tw_nRNG_core_per_lp
tw_lpid g_tw_rng_default
tw_seed g_tw_rng_seed
tw_seed g_tw_core_rng_seed
unsigned int g_tw_mblock
unsigned int g_tw_gvt_interval
unsigned long long g_tw_max_opt_lookahead
unsigned long long g_tw_gvt_realtime_interval
unsigned long long g_tw_gvt_interval_start_cycles
double g_tw_ts_end
unsigned int g_tw_sim_started
size_t g_tw_msg_sz
size_t g_tw_event_msg_sz
size_t g_tw_delta_sz
uint32_t g_tw_buddy_alloc
buddy_list_bucket_tg_tw_buddy_master
uint32_t g_tw_avl_node_count
unsigned int g_tw_lz4_knob
double g_tw_lookahead
double g_tw_min_detected_offset
tw_peg_tw_pe
unsigned int g_tw_events_per_pe
unsigned int g_tw_events_per_pe_extra
unsigned int g_tw_gvt_threshold
unsigned int g_tw_gvt_done
unsigned int g_tw_net_device_size
tw_peid g_tw_mynode
tw_peid g_tw_masternode
FILE * g_tw_csv
tw_lptypeg_tw_lp_types
tw_typemap_f g_tw_lp_typemap
tw_clock g_tw_cycles_gvt
tw_clock g_tw_cycles_ev_abort
tw_clock g_tw_cycles_ev_proc
tw_clock g_tw_cycles_ev_queue
tw_clock g_tw_cycles_rbs
tw_clock g_tw_cycles_cancel
unsigned long long g_tw_clock_rate

Macro Definition Documentation

◆ TW_LOC

#define TW_LOC   __FILE__,__LINE__

Definition at line 178 of file ross-extern.h.

Referenced by analysis_init(), apply_opt(), avl_alloc(), avlDelete(), avlInsert(), buddy_alloc(), buddy_free(), create_buddy_table(), crv_add_custom_state_checkpoint(), does_any_pe(), early_sanity_check(), event_cancel(), init_output_messages(), init_q(), io_event_deserialize(), io_load_events(), is_gvt_past_hook_threshold(), late_sanity_check(), main(), map_linear(), parse_args_file(), phold_event_handler(), phold_pre_run(), recv_begin(), recv_finish(), rng_core_init(), rng_gen_reverse_val(), rng_init(), send_begin(), send_finish(), setup_pes(), st_buffer_allocate(), st_buffer_init(), st_collect_engine_data_kps(), st_collect_engine_data_lps(), test_q(), tw_define_lps(), tw_delta_alloc(), tw_event_new_user_prio(), tw_event_send(), tw_eventq_alloc(), tw_eventq_debug(), tw_getkp(), tw_getlocal_lp(), tw_getlp(), tw_gvt_hook_step(), tw_gvt_hook_step_seq(), tw_gvt_step2(), tw_hash_create(), tw_hash_remove(), tw_init(), tw_init_kps(), tw_init_lps(), tw_kp_onpe(), tw_kp_rollback_event(), tw_lp_onkp(), tw_lp_onpe(), tw_lp_settype(), tw_lp_setup_types(), tw_lp_suspend(), tw_net_barrier(), tw_net_cancel(), tw_net_init(), tw_net_start(), tw_net_statistics(), tw_net_stop(), tw_opt_parse(), tw_output(), tw_pe_init(), tw_pe_settype(), tw_pq_compare_less_than(), tw_pq_create(), tw_pq_delete_any(), tw_pre_run_lps(), tw_rand_init_streams(), tw_rand_normal01(), tw_run(), tw_sched_batch(), tw_sched_batch_realtime(), tw_sched_cancel_q(), tw_sched_event_q(), tw_scheduler_conservative(), tw_scheduler_optimistic_debug(), tw_scheduler_sequential(), tw_scheduler_sequential_rollback_check(), tw_snapshot_delta(), tw_snapshot_restore(), tw_trigger_gvt_hook_at(), tw_trigger_gvt_hook_every(), tw_trigger_gvt_hook_now(), and tw_wall_now().

Function Documentation

◆ kp_fossil_remote()

void kp_fossil_remote ( tw_kp * kp)
extern

◆ map_onetype()

tw_lpid map_onetype ( tw_lpid gid)
extern

Definition at line 594 of file tw-setup.c.

◆ tw_all_lp_stats()

◆ tw_calloc()

◆ tw_calloc_stats()

void tw_calloc_stats ( size_t * alloc,
size_t * waste )
extern

◆ tw_clock_init()

void tw_clock_init ( tw_pe * me)
extern

Definition at line 28 of file aarch64.c.

References tw_pe::clock_offset, tw_pe::clock_time, and tw_clock_read().

Referenced by tw_sched_init().

◆ tw_clock_now()

tw_clock tw_clock_now ( tw_pe * me)
extern

Definition at line 35 of file aarch64.c.

References tw_pe::clock_offset, tw_pe::clock_time, and tw_clock_read().

◆ tw_clock_read()

tw_clock tw_clock_read ( )
extern

Definition at line 16 of file bgl.c.

◆ tw_clock_setup()

const tw_optdef * tw_clock_setup ( )
extern

Definition at line 20 of file aarch64.c.

References clock_opts.

Referenced by tw_init().

◆ tw_define_lps()

void tw_define_lps ( tw_lpid nlp,
size_t msg_sz )
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.

References CUSTOM, early_sanity_check(), g_st_analysis_nlp, g_tw_custom_initial_mapping, g_tw_kp, g_tw_lp, g_tw_mapping, g_tw_msg_sz, g_tw_nkp, g_tw_nlp, g_tw_nRNG_core_per_lp, g_tw_nRNG_per_lp, g_tw_rng_default, g_tw_synchronization_protocol, g_tw_total_lps, LINEAR, map_linear(), map_round_robin(), MPI_COMM_ROSS, nkp_per_pe, OPTIMISTIC_DEBUG, ROUND_ROBIN, specialized_lp_init_mapping(), specialized_lp_setup(), st_buffer_allocate(), tw_calloc(), tw_error(), TW_LOC, and tw_rand_init_streams().

Referenced by main().

◆ tw_end()

void tw_end ( void )
extern

Definition at line 476 of file tw-setup.c.

References g_tw_csv, tw_gvt_finish(), tw_ismaster(), and tw_net_stop().

Referenced by main().

◆ tw_error()

void tw_error ( const char * file,
int line,
const char * fmt,
... )
extern

Definition at line 77 of file tw-util.c.

References g_tw_mynode, and tw_net_abort().

Referenced by analysis_init(), apply_opt(), avl_alloc(), avlDelete(), avlInsert(), buddy_alloc(), crv_add_custom_state_checkpoint(), does_any_pe(), early_sanity_check(), event_cancel(), io_event_deserialize(), io_load_events(), is_gvt_past_hook_threshold(), late_sanity_check(), main(), map_linear(), parse_args_file(), phold_event_handler(), phold_pre_run(), recv_begin(), recv_finish(), rng_gen_reverse_val(), send_begin(), send_finish(), setup_pes(), st_collect_engine_data_kps(), st_collect_engine_data_lps(), test_q(), tw_define_lps(), tw_event_new_user_prio(), tw_event_send(), tw_eventq_debug(), tw_getkp(), tw_getlocal_lp(), tw_getlp(), tw_gvt_hook_step(), tw_gvt_hook_step_seq(), tw_gvt_step2(), tw_hash_create(), tw_hash_remove(), tw_init(), tw_init_lps(), tw_kp_onpe(), tw_kp_rollback_event(), tw_lp_onkp(), tw_lp_onpe(), tw_lp_settype(), tw_lp_setup_types(), tw_lp_suspend(), tw_net_barrier(), tw_net_cancel(), tw_net_init(), tw_net_start(), tw_net_statistics(), tw_net_stop(), tw_opt_parse(), tw_pe_init(), tw_pe_settype(), tw_pq_compare_less_than(), tw_pq_delete_any(), tw_pre_run_lps(), tw_rand_init_streams(), tw_rand_normal01(), tw_run(), tw_sched_batch(), tw_sched_batch_realtime(), tw_sched_cancel_q(), tw_sched_event_q(), tw_scheduler_conservative(), tw_scheduler_optimistic_debug(), tw_scheduler_sequential(), tw_scheduler_sequential_rollback_check(), tw_snapshot_delta(), tw_snapshot_restore(), tw_trigger_gvt_hook_every(), tw_trigger_gvt_hook_now(), and tw_wall_now().

◆ tw_event_data()

◆ tw_event_free()

◆ tw_event_rollback()

◆ tw_event_send()

◆ tw_fprint_binary_array()

void tw_fprint_binary_array ( FILE * output,
char const * prefix,
void const * array,
size_t size )
extern

tw_fprint_binary_array

Printing the array "hello world! I'm happy to be here" would produce:

| 68 65 6c 6c 6f 20 77 6f 72 6c 64 21 20 49 27 6d | hello world! I'm | 20 68 61 70 70 79 20 74 6f 20 62 65 20 68 65 72 | happy to be her | 65 | e

Definition at line 261 of file tw-util.c.

Referenced by crv_check_lpstates(), and print_event().

◆ tw_free_output_messages()

void tw_free_output_messages ( tw_event * e,
int print_message )
inlinestatic

◆ tw_get_stats()

◆ tw_init()

◆ tw_init_kps()

◆ tw_init_lps()

◆ tw_kp_grab_output_buffer()

tw_out * tw_kp_grab_output_buffer ( tw_kp * kp)
extern

Definition at line 210 of file tw-kp.c.

References tw_out::next, and tw_kp::output.

Referenced by tw_output().

◆ tw_kp_next_onpe()

tw_kp * tw_kp_next_onpe ( tw_kp * last,
tw_pe * pe )
extern

References pe.

◆ tw_kp_onpe()

void tw_kp_onpe ( tw_kpid id,
tw_pe * pe )
extern

Definition at line 4 of file tw-kp.c.

References g_tw_kp, g_tw_nkp, pe, tw_calloc(), tw_error(), and TW_LOC.

Referenced by map_linear(), and map_round_robin().

◆ tw_kp_put_back_output_buffer()

void tw_kp_put_back_output_buffer ( tw_out * out)
extern

Definition at line 223 of file tw-kp.c.

References tw_out::next, tw_kp::output, and tw_out::owner.

Referenced by tw_free_output_messages().

◆ tw_kp_rollback_event()

◆ tw_kp_rollback_to()

◆ tw_kp_rollback_to_sig()

void tw_kp_rollback_to_sig ( tw_kp * kp,
tw_event_sig const * to_sig )
extern

◆ tw_lp_next_onpe()

tw_lp * tw_lp_next_onpe ( tw_lp * last,
tw_pe * pe )
extern

References pe.

◆ tw_lp_onkp()

void tw_lp_onkp ( tw_lp * lp,
tw_kp * kp )
extern

Definition at line 73 of file tw-lp.c.

References tw_lp::kp, tw_kp::lp_count, tw_error(), and TW_LOC.

Referenced by map_linear(), map_round_robin(), and specialized_lp_init_mapping().

◆ tw_lp_onpe()

void tw_lp_onpe ( tw_lpid index,
tw_pe * pe,
tw_lpid id )
extern

◆ tw_lp_settype()

void tw_lp_settype ( tw_lpid id,
tw_lptype * type )
extern

IMPORTANT: This function should be called after tw_define_lps. It copies the function pointers which define the LP to the appropriate location for each LP, i.e. you probably want to call this more than once.

Definition at line 38 of file tw-lp.c.

References g_st_analysis_nlp, g_tw_delta_sz, g_tw_lp, g_tw_nlp, tw_lp::gid, tw_lp::pe, tw_lptype::state_sz, tw_error(), TW_LOC, and tw_lp::type.

Referenced by main(), and st_analysis_lp_settype().

◆ tw_lp_setup_types()

void tw_lp_setup_types ( )
extern

◆ tw_lp_suspend()

void tw_lp_suspend ( tw_lp * lp,
int do_orig_event_rc,
int error_num )
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.

Parameters
lpPointer to the LP we're suspending
do_orig_event_rcA bool indicating whether or not to skip the RC function
error_numUser-specified value for tracking purposes; ROSS ignores this

Definition at line 227 of file tw-lp.c.

References tw_pe::cur_event, tw_lp::pe, tw_lp::suspend_do_orig_event_rc, tw_lp::suspend_error_number, tw_lp::suspend_event, tw_lp::suspend_flag, tw_lp::suspend_sig, tw_lp::suspend_time, tw_error(), TW_LOC, tw_now(), and tw_now_sig().

◆ tw_output()

int tw_output ( tw_lp * lp,
const char * fmt,
... )
extern

Rollback-aware printf, i.e. if the event gets rolled back, undo the printf. We can'd do that of course so we store the message in a buffer until GVT.

Definition at line 10 of file tw-util.c.

References CONSERVATIVE, tw_pe::cur_event, g_tw_synchronization_protocol, tw_kp::id, tw_lp::kp, tw_out::message, tw_out::next, tw_event::out_msgs, tw_lp::pe, SEQUENTIAL, SEQUENTIAL_ROLLBACK_CHECK, tw_kp_grab_output_buffer(), TW_LOC, and tw_printf().

◆ tw_pe_fossil_collect()

void tw_pe_fossil_collect ( void )
extern

Definition at line 68 of file tw-pe.c.

References g_tw_fossil_attempts, g_tw_nkp, g_tw_pe, tw_kp::pevent_q, tw_eventq_fossil_collect(), and tw_getkp().

Referenced by tw_gvt_step2().

◆ tw_pe_init()

void tw_pe_init ( void )
extern

initialize individual PE structs

must be called after tw_nnodes / MPI world size is set.

Definition at line 32 of file tw-pe.c.

References g_tw_max_sig, g_tw_mynode, g_tw_pe, g_tw_synchronization_protocol, OPTIMISTIC, OPTIMISTIC_DEBUG, OPTIMISTIC_REALTIME, tw_calloc(), tw_copy_event_sig(), tw_error(), tw_hash_create(), TW_LOC, tw_pe_settype(), tw_rand_core_init(), tw_rand_init(), and TW_STIME_MAX.

Referenced by tw_net_start().

◆ tw_pe_settype()

void tw_pe_settype ( const tw_petype * type)
extern

Definition at line 9 of file tw-pe.c.

References copy_pef, dummy_pe_f(), g_tw_pe, tw_error(), and TW_LOC.

◆ tw_pre_run_lps()

◆ tw_printf()

void tw_printf ( const char * file,
int line,
const char * fmt,
... )
extern

Definition at line 64 of file tw-util.c.

Referenced by avlInsert(), buddy_free(), and early_sanity_check().

◆ tw_rand_init_streams()

void tw_rand_init_streams ( tw_lp * lp,
unsigned int nstreams,
unsigned int n_core_streams )
extern

◆ tw_run()

◆ tw_sched_init()

◆ tw_scheduler_conservative()

void tw_scheduler_conservative ( tw_pe * me)
extern

Definition at line 778 of file tw-sched.c.

References ALL_STATS, tw_pe::cev_abort, CMP_GVT_HOOK_TO_NEXT_IN_QUEUE, CMP_KP_TO_EVENT_TIME, tw_lptype::commit, tw_event::critical_path, tw_lp::critical_path, tw_pe::cur_event, tw_lp::cur_state, tw_event::cv, tw_event::dest_lp, tw_pe::end_time, tw_lptype::event, tw_petype::final, tw_pe::free_q, FULL_TRACE, g_st_engine_stats, g_st_ev_trace, g_st_model_stats, g_st_rt_interval, g_st_rt_samp_start_cycles, g_st_rt_sampling, g_tw_clock_rate, g_tw_gvt_hook, g_tw_gvt_hook_trigger, g_tw_gvt_threshold, g_tw_lookahead, g_tw_masternode, g_tw_mblock, g_tw_mynode, g_tw_ts_end, tw_lp::gid, GVT_HOOK_STATUS_model_call, GVT_HOOK_STATUS_timestamp, tw_pe::gvt_status, tw_pe::id, tw_lp::kp, tw_kp::kp_stats, tw_kp::last_sig, tw_kp::last_time, tw_lp::lp_stats, tw_lp::pe, tw_pe::pq, PQ_MINUMUM, tw_event::recv_ts, reset_bitfields(), ROSS_MAX, RT_COL, RT_STATS, tw_statistics::s_event_process, tw_statistics::s_net_read, st_kp_stats::s_nevent_processed, st_lp_stats::s_nevent_processed, tw_kp::s_nevent_processed, tw_statistics::s_pe_event_ties, tw_statistics::s_pq, tw_statistics::s_total, tw_event::send_lp, tw_event::send_pe, tw_event::sig, tw_eventq::size, st_collect_engine_data(), st_collect_event_data(), st_collect_model_data(), st_inst_finalize(), tw_pe::start_time, tw_pe::stats, STIME_FROM_KP, STIME_FROM_PE, tw_clock_read(), tw_copy_event_sig(), tw_error(), tw_event_data(), tw_event_free(), tw_gvt_force_update(), tw_gvt_hook_step(), tw_gvt_step1(), tw_gvt_step2(), TW_LOC, tw_net_barrier(), tw_net_read(), tw_nnodes(), tw_pq_dequeue(), tw_pq_minimum(), tw_sched_event_q(), tw_stats(), TW_STIME_CMP, TW_STIME_DBL, tw_wall_now(), tw_lp::type, and tw_pe::type.

Referenced by tw_run().

◆ tw_scheduler_optimistic()

◆ tw_scheduler_optimistic_debug()

◆ tw_scheduler_optimistic_realtime()

◆ tw_scheduler_rollback_and_cancel_events_pe()

void tw_scheduler_rollback_and_cancel_events_pe ( tw_pe * pe)
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.

References does_any_pe(), g_tw_kp, g_tw_nkp, pe, tw_clock_read(), tw_event_sig_compare_ptr(), tw_gvt_step2(), tw_kp_rollback_to(), tw_kp_rollback_to_sig(), tw_net_read(), tw_nnodes(), tw_sched_cancel_q(), and tw_sched_event_q().

◆ tw_scheduler_sequential()

◆ tw_scheduler_sequential_rollback_check()

void tw_scheduler_sequential_rollback_check ( tw_pe * me)
extern

◆ tw_snapshot()

void tw_snapshot ( tw_lp * lp,
size_t state_sz )
extern

Make a snapshot of the LP state and store it into the delta buffer

Definition at line 9 of file tw-state.c.

References tw_lp::cur_state, tw_pe::delta_buffer, and tw_lp::pe.

◆ tw_snapshot_delta()

long tw_snapshot_delta ( tw_lp * lp,
size_t state_sz )
extern

Create the delta from the current state and the snapshot. Compress it.

Returns
The size of the compressed data placed in delta_buffer[1].

Definition at line 21 of file tw-state.c.

References buddy_alloc(), tw_pe::cur_event, tw_lp::cur_state, tw_event::delta_buddy, tw_pe::delta_buffer, tw_event::delta_size, g_tw_delta_sz, g_tw_lz4_knob, g_tw_pe, LZ4_compress_fast_extState(), tw_lp::pe, tw_clock_read(), tw_error(), and TW_LOC.

◆ tw_snapshot_restore()

void tw_snapshot_restore ( tw_lp * lp,
size_t state_sz )
extern

Restore the state of lp to the (decompressed) data held in buffer

Definition at line 55 of file tw-state.c.

References tw_pe::cur_event, tw_lp::cur_state, tw_event::delta_buddy, tw_pe::delta_buffer, g_tw_pe, LZ4_decompress_fast(), tw_lp::pe, tw_clock_read(), tw_error(), and TW_LOC.

◆ tw_stats()

void tw_stats ( tw_pe * me)
extern

Definition at line 126 of file tw-stats.c.

References CONSERVATIVE, tw_lp::cur_state, tw_lptype::final, g_st_analysis_nlp, g_st_use_analysis_lps, g_tw_clock_rate, g_tw_csv, g_tw_events_per_pe, g_tw_events_per_pe_extra, g_tw_gvt_done, g_tw_msg_sz, g_tw_nlp, g_tw_synchronization_protocol, tw_lp::rng, tw_statistics::s_avl, tw_statistics::s_buddy, tw_statistics::s_cancel_q, tw_statistics::s_e_rbs, tw_statistics::s_event_abort, tw_statistics::s_event_process, tw_statistics::s_events_past_end, tw_statistics::s_fc_attempts, tw_statistics::s_fossil_collect, tw_statistics::s_gvt, tw_statistics::s_init, tw_statistics::s_lz4, tw_statistics::s_max_run_time, tw_statistics::s_min_detected_offset, tw_statistics::s_net_events, tw_statistics::s_net_other, tw_statistics::s_net_read, tw_statistics::s_nevent_abort, tw_statistics::s_nevent_processed, tw_statistics::s_nread_network, tw_statistics::s_nsend_loc_remote, tw_statistics::s_nsend_net_remote, tw_statistics::s_nsend_network, tw_statistics::s_pe_event_ties, tw_statistics::s_pq, tw_statistics::s_rb_primary, tw_statistics::s_rb_secondary, tw_statistics::s_rb_total, tw_statistics::s_rollback, tw_statistics::s_stat_comp, tw_statistics::s_stat_write, tw_statistics::s_total, show_1f(), show_2f(), show_4f(), show_lld(), st_print_analysis_LP_stats(), tw_lptype::state_sz, tw_calloc_stats(), tw_get_stats(), tw_getlp(), tw_gvt_stats(), tw_ismaster(), tw_net_statistics(), tw_nnodes(), and tw_lp::type.

Referenced by tw_scheduler_conservative(), tw_scheduler_optimistic(), tw_scheduler_optimistic_debug(), tw_scheduler_optimistic_realtime(), tw_scheduler_sequential(), and tw_scheduler_sequential_rollback_check().

◆ tw_wall_now()

◆ tw_wall_sub()

void tw_wall_sub ( tw_wtime * r,
tw_wtime * a,
tw_wtime * b )
extern

Definition at line 14 of file tw-timing.c.

Referenced by tw_get_stats().

◆ tw_wall_to_double()

double tw_wall_to_double ( tw_wtime * t)
extern

Definition at line 27 of file tw-timing.c.

Referenced by tw_get_stats().

◆ tw_warning()

void tw_warning ( const char * file,
int line,
const char * fmt,
... )
extern

Definition at line 93 of file tw-util.c.

References g_tw_mynode.

Referenced by apply_opt(), tw_gvt_hook_step_seq(), and tw_trigger_gvt_hook_at().

Variable Documentation

◆ g_tw_avl_node_count

uint32_t g_tw_avl_node_count
extern

Definition at line 41 of file ross-global.c.

Referenced by avl_alloc(), avlInsert(), and tw_hash_create().

◆ g_tw_buddy_alloc

uint32_t g_tw_buddy_alloc
extern

Allocation for buddy system

Definition at line 39 of file ross-global.c.

Referenced by setup_pes().

◆ g_tw_buddy_master

buddy_list_bucket_t* g_tw_buddy_master
extern

Definition at line 40 of file ross-global.c.

Referenced by buddy_alloc(), buddy_free(), buddy_try_merge(), and setup_pes().

◆ g_tw_clock_rate

◆ g_tw_core_rng_seed

tw_seed g_tw_core_rng_seed
extern

Definition at line 35 of file ross-global.c.

Referenced by rng_core_init(), and tw_init().

◆ g_tw_csv

FILE* g_tw_csv
extern

◆ g_tw_custom_initial_mapping

map_custom_f g_tw_custom_initial_mapping
extern

Definition at line 21 of file ross-global.c.

Referenced by tw_define_lps().

◆ g_tw_custom_lp_global_to_local_map

map_local_f g_tw_custom_lp_global_to_local_map
extern

Definition at line 20 of file ross-global.c.

Referenced by io_event_deserialize(), and tw_getlocal_lp().

◆ g_tw_cycles_cancel

tw_clock g_tw_cycles_cancel
extern

◆ g_tw_cycles_ev_abort

tw_clock g_tw_cycles_ev_abort
extern

◆ g_tw_cycles_ev_proc

tw_clock g_tw_cycles_ev_proc
extern

◆ g_tw_cycles_ev_queue

tw_clock g_tw_cycles_ev_queue
extern

◆ g_tw_cycles_gvt

tw_clock g_tw_cycles_gvt
extern

◆ g_tw_cycles_rbs

tw_clock g_tw_cycles_rbs
extern

◆ g_tw_delta_sz

size_t g_tw_delta_sz
extern

Definition at line 38 of file ross-global.c.

Referenced by tw_delta_alloc(), tw_lp_settype(), and tw_snapshot_delta().

◆ g_tw_event_msg_sz

size_t g_tw_event_msg_sz
extern

Definition at line 47 of file ross-global.c.

Referenced by tw_eventq_alloc().

◆ g_tw_events_per_pe

unsigned int g_tw_events_per_pe
extern

Definition at line 80 of file ross-global.c.

Referenced by main(), setup_pes(), tw_eventq_alloc(), and tw_stats().

◆ g_tw_events_per_pe_extra

unsigned int g_tw_events_per_pe_extra
extern

Number of extra events allocated per PE. Command-line customizable.

Definition at line 82 of file ross-global.c.

Referenced by setup_pes(), and tw_stats().

◆ g_tw_fossil_attempts

int g_tw_fossil_attempts
extern

Definition at line 30 of file ross-global.c.

Referenced by tw_get_stats(), and tw_pe_fossil_collect().

◆ g_tw_gvt_done

unsigned int g_tw_gvt_done
extern

◆ g_tw_gvt_interval

unsigned int g_tw_gvt_interval
extern

◆ g_tw_gvt_interval_start_cycles

unsigned long long g_tw_gvt_interval_start_cycles
extern

◆ g_tw_gvt_realtime_interval

unsigned long long g_tw_gvt_realtime_interval
extern

◆ g_tw_gvt_threshold

unsigned int g_tw_gvt_threshold
extern

◆ g_tw_kp

◆ g_tw_lookahead

double g_tw_lookahead
extern

Definition at line 53 of file ross-global.c.

Referenced by io_load_events(), main(), tw_event_send(), and tw_scheduler_conservative().

◆ g_tw_lp

◆ g_tw_lp_offset

tw_lpid g_tw_lp_offset
extern

Definition at line 26 of file ross-global.c.

Referenced by io_event_deserialize(), map_linear(), and tw_getlocal_lp().

◆ g_tw_lp_typemap

tw_typemap_f g_tw_lp_typemap
extern

Definition at line 106 of file ross-global.c.

Referenced by io_store_checkpoint(), st_model_setup_types(), and tw_lp_setup_types().

◆ g_tw_lp_types

tw_lptype* g_tw_lp_types
extern

Definition at line 105 of file ross-global.c.

Referenced by tw_lp_setup_types().

◆ g_tw_lz4_knob

unsigned int g_tw_lz4_knob
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.

Referenced by tw_snapshot_delta().

◆ g_tw_mapping

tw_lp_map g_tw_mapping
extern

Definition at line 22 of file ross-global.c.

Referenced by io_event_deserialize(), setup_pes(), tw_define_lps(), and tw_getlocal_lp().

◆ g_tw_masternode

◆ g_tw_max_opt_lookahead

unsigned long long g_tw_max_opt_lookahead
extern

Definition at line 68 of file ross-global.c.

◆ g_tw_mblock

unsigned int g_tw_mblock
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.

Referenced by tw_gvt_stats(), tw_sched_batch(), tw_sched_batch_realtime(), and tw_scheduler_conservative().

◆ g_tw_min_detected_offset

double g_tw_min_detected_offset
extern

Definition at line 59 of file ross-global.c.

Referenced by tw_event_new_user_prio(), and tw_get_stats().

◆ g_tw_msg_sz

size_t g_tw_msg_sz
extern

◆ g_tw_mynode

◆ g_tw_net_device_size

unsigned int g_tw_net_device_size
extern

Definition at line 91 of file ross-global.c.

Referenced by tw_eventq_alloc(), and tw_net_start().

◆ g_tw_nkp

◆ g_tw_nlp

◆ g_tw_nRNG_core_per_lp

unsigned int g_tw_nRNG_core_per_lp
extern

Definition at line 32 of file ross-global.c.

Referenced by tw_define_lps(), and tw_rand_init_streams().

◆ g_tw_nRNG_per_lp

unsigned int g_tw_nRNG_per_lp
extern

◆ g_tw_pe

◆ g_tw_rng_default

tw_lpid g_tw_rng_default
extern

Definition at line 33 of file ross-global.c.

Referenced by tw_define_lps().

◆ g_tw_rng_seed

tw_seed g_tw_rng_seed
extern

Definition at line 34 of file ross-global.c.

Referenced by rng_init(), and tw_init().

◆ g_tw_sim_started

unsigned int g_tw_sim_started
extern

Definition at line 36 of file ross-global.c.

Referenced by tw_get_stats(), and tw_sched_init().

◆ g_tw_synchronization_protocol

◆ g_tw_total_lps

tw_lpid g_tw_total_lps
extern

Definition at line 25 of file ross-global.c.

Referenced by setup_pes(), tw_define_lps(), and tw_rand_init_streams().

◆ g_tw_ts_end