13 memset(&revent->
cv, 0,
sizeof(revent->
cv));
30 for (; cev; cev = nev) {
84 for (; cev; cev = nev) {
141 static int no_free_event_buffers = 0;
142 static int warned_no_free_event_buffers = 0;
143 const int max_alloc_fail_count = 20;
161 if (++no_free_event_buffers > 10) {
162 if (!warned_no_free_event_buffers) {
163 fprintf(stderr,
"WARNING: No free event buffers. Try increasing memory via the --extramem option.\n");
164 warned_no_free_event_buffers = 1;
166 if (no_free_event_buffers >= max_alloc_fail_count) {
167 tw_error(
TW_LOC,
"Event allocation failed %d consecutive times. Exiting.", max_alloc_fail_count);
173 no_free_event_buffers = 0;
256 if (g_st_damaris_enabled)
257 st_damaris_expose_data(me, me->
GVT,
RT_COL);
275 static int no_free_event_buffers = 0;
276 static int warned_no_free_event_buffers = 0;
277 const int max_alloc_fail_count = 20;
295 if (++no_free_event_buffers > 10) {
296 if (!warned_no_free_event_buffers) {
297 fprintf(stderr,
"WARNING: No free event buffers. Try increasing memory via the --extramem option.\n");
298 warned_no_free_event_buffers = 1;
300 if (no_free_event_buffers >= max_alloc_fail_count) {
301 tw_error(
TW_LOC,
"Event allocation failed %d consecutive times. Exiting.", max_alloc_fail_count);
307 no_free_event_buffers = 0;
449 tw_error(
TW_LOC,
"Sequential Scheduler used for world size greater than 1.");
454 printf(
"*** START SEQUENTIAL SIMULATION ***\n\n");
507 printf(
"*** END SIMULATION ***\n\n");
519 printf(
"*** START PARALLEL CONSERVATIVE SIMULATION ***\n\n");
574 tw_error(
TW_LOC,
"Found KP last time %lf > current event time %lf for LP %d, PE %lu"
575 "src LP %lu, src PE %lu",
621 printf(
"*** END SIMULATION ***\n\n");
638 printf(
"*** START PARALLEL OPTIMISTIC SIMULATION WITH SUSPEND LP FEATURE ***\n\n");
669 printf(
"*** END SIMULATION ***\n\n");
686 printf(
"*** START PARALLEL OPTIMISTIC SIMULATION WITH SUSPEND LP FEATURE AND REAL TIME GVT ***\n\n");
720 printf(
"*** END SIMULATION ***\n\n");
737 tw_error(
TW_LOC,
"Sequential Scheduler used for world size greater than 1.");
740 printf(
"/***************************************************************************/\n");
741 printf(
"/***** WARNING: Starting Optimistic Debug Scheduler!! **********************/\n");
742 printf(
"This schedule assumes the following: \n");
743 printf(
" 1) One 1 Processor/Core is used.\n");
744 printf(
" 2) One 1 KP is used.\n");
745 printf(
" NOTE: use the --nkp=1 argument to the simulation to ensure that\n");
746 printf(
" it only uses 1 KP.\n");
747 printf(
" 3) Events ARE NEVER RECLAIMED (LP Commit Functions are not called).\n");
748 printf(
" 4) Executes til out of memory (16 events left) and \n injects rollback to first before primodal init event.\n");
750 printf(
"/***************************************************************************/\n");
788 printf(
"/******************* Starting Rollback Phase ******************************/\n");
790 printf(
"/******************* Completed Rollback Phase ******************************/\n");
794 printf(
"*** END SIMULATION ***\n\n");
tw_clock g_st_rt_interval
unsigned long long g_tw_clock_rate
tw_lp * dest_lp
Destination LP ID.
static void reset_bitfields(tw_event *revent)
Reset the event bitfield prior to entering the event handler post-reverse - reset the bitfield so tha...
tw_eventq event_q
Linked list of events sent to this PE.
void tw_clock_init(tw_pe *me)
tw_stime tw_pq_minimum(splay_tree *pq)
revent_f revent
LP Reverse event handler routine.
void tw_init_kps(tw_pe *me)
struct st_lp_stats * lp_stats
unsigned int critical_path
Critical path value for this LP.
void tw_error(const char *file, int line, const char *fmt,...) NORETURN
tw_lptype * type
Type of this LP, including service callbacks.
struct st_kp_stats * kp_stats
tw_statistics stats
per PE counters
static tw_event * tw_eventq_peek(tw_eventq *q)
unsigned int g_tw_sim_started
pe_init_f pre_lp_init
PE initialization routine, before LP init.
unsigned int g_tw_gvt_threshold
pe_final_f final
PE finilization routine.
tw_stime recv_ts
Actual time to be received.
unsigned int s_nevent_abort
tw_clock g_st_rt_samp_start_cycles
static void tw_eventq_delete_any(tw_eventq *q, tw_event *e)
void tw_scheduler_sequential(tw_pe *me)
void tw_net_read(tw_pe *me)
starts service_queues() to poll network
tw_event * cancel_next
Next event in the cancel queue for the dest_pe.
static tw_clock tw_clock_read(void)
static void tw_event_free(tw_pe *, tw_event *)
void tw_gvt_force_update_realtime(void)
void st_collect_model_data(tw_pe *pe, double current_rt, int stats_type)
static void tw_sched_batch(tw_pe *me)
void tw_kp_rollback_to(tw_kp *kp, tw_stime to)
void st_collect_event_data(tw_event *cev, double recv_rt)
Holds the entire PE state.
unsigned int suspend_flag
unsigned int s_nevent_processed
tw_eventq pevent_q
Events processed by LPs bound to this KP.
tw_event * cancel_q
List of canceled events.
pe_init_f post_lp_init
PE initialization routine, after LP init.
tw_bf cv
Used by app during reverse computation.
unsigned int tw_nnodes(void)
void tw_net_barrier(void)
tw_petype type
Model defined PE type routines.
void tw_gvt_step1(tw_pe *me)
unsigned long long g_tw_gvt_realtime_interval
double g_tw_rollback_time
tw_eventq free_q
Linked list of free tw_events.
tw_kp * kp
kp – Kernel process that we belong to (must match pe).
void tw_pq_delete_any(splay_tree *st, tw_event *r)
tw_event * tw_pq_dequeue(splay_tree *st)
#define TW_STIME_CMP(x, y)
unsigned int g_tw_gvt_interval
unsigned int critical_path
Critical path of this event.
tw_event * cur_event
Current event being processed.
static tw_event * tw_eventq_pop_list(tw_eventq *q)
void tw_scheduler_optimistic(tw_pe *me)
void tw_pre_run_lps(tw_pe *me)
static void * tw_event_data(tw_event *event)
void tw_gvt_force_update(void)
void tw_pq_enqueue(splay_tree *st, tw_event *e)
void tw_sched_init(tw_pe *me)
unsigned int s_nevent_processed
tw_lpid send_lp
sending LP ID for data collection uses
tw_wtime start_time
When this PE first started execution.
void tw_wall_now(tw_wtime *t)
tw_pq * pq
Priority queue used to sort events.
void st_collect_engine_data(tw_pe *me, int col_type)
commit_f commit
LP Commit event routine.
void tw_scheduler_optimistic_realtime(tw_pe *me)
void tw_scheduler_optimistic_debug(tw_pe *me)
void tw_kp_rollback_event(tw_event *event)
void tw_init_lps(tw_pe *me)
struct tw_event::@0 state
tw_wtime end_time
When this PE finished its execution.
static void tw_eventq_unshift(tw_eventq *q, tw_event *e)
tw_stime GVT
Global Virtual Time.
static double percent_complete
void st_inst_finalize(tw_pe *me)
static void gvt_print(tw_stime gvt)
void tw_gvt_step1_realtime(tw_pe *me)
void * cur_state
Current application LP data.
event_f event
LP event handler routine.
void tw_scheduler_conservative(tw_pe *me)
void tw_event_rollback(tw_event *event)
void tw_gvt_step2(tw_pe *me)
static void tw_sched_batch_realtime(tw_pe *me)
static void tw_sched_cancel_q(tw_pe *me)
unsigned char cancel_q
Actively on a dest_lp->pe's cancel_q.
unsigned int s_nevent_abort
void io_load_events(tw_pe *me)
static void tw_sched_event_q(tw_pe *me)
tw_stime last_time
Time of the current event being processed.
unsigned char cev_abort
Current event being processed must be aborted.
tw_stat s_nevent_processed
Number of events processed.
unsigned long long g_tw_gvt_interval_start_cycles
unsigned char owner
Owner of the next/prev pointers; see tw_event_owner.