Go to the source code of this file.
Macros | |
#define | PQ_MINUMUM(pe) |
#define | CMP_KP_TO_EVENT_TIME(kp, e) |
#define | CMP_GVT_HOOK_TO_NEXT_IN_QUEUE(trigger, pe) |
#define | TRIGGER_ROLLBACK_TO_EVENT_TIME(kp, e) |
#define | STIME_FROM_PE(pe) |
#define | STIME_FROM_KP(kp) |
Functions | |
static void | reset_bitfields (tw_event *revent) |
Reset the event bitfield prior to entering the event handler post-reverse - reset the bitfield so that a potential re-running of the event is presented with a consistent bitfield state NOTE: the size checks are to better support the experimental reverse computation compiler, which can use a larger bitfield. Courtesy of John P Jenkins. | |
static void | tw_sched_event_q (tw_pe *me) |
static void | tw_sched_cancel_q (tw_pe *me) |
static void | tw_sched_batch (tw_pe *me) |
static void | tw_sched_batch_realtime (tw_pe *me) |
void | tw_sched_init (tw_pe *me) |
static bool | does_any_pe (bool val) |
void | tw_scheduler_rollback_and_cancel_events_pe (tw_pe *pe) |
static bool | is_gvt_past_hook_threshold (tw_pe *me) |
static void | tw_gvt_hook_step (tw_pe *me) |
static void | tw_gvt_hook_step_seq (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_realtime (tw_pe *me) |
void | tw_scheduler_optimistic_debug (tw_pe *me) |
void | tw_scheduler_sequential_rollback_check (tw_pe *me) |
Variables | |
double | g_tw_rollback_time = 0.000000001 |
#define CMP_GVT_HOOK_TO_NEXT_IN_QUEUE | ( | trigger, | |
pe ) |
Definition at line 33 of file tw-sched.c.
Referenced by tw_gvt_hook_step_seq(), tw_sched_batch(), tw_sched_batch_realtime(), and tw_scheduler_conservative().
#define CMP_KP_TO_EVENT_TIME | ( | kp, | |
e ) |
Definition at line 32 of file tw-sched.c.
Referenced by tw_sched_event_q(), and tw_scheduler_conservative().
#define PQ_MINUMUM | ( | pe | ) |
Definition at line 31 of file tw-sched.c.
Referenced by tw_gvt_hook_step_seq(), tw_scheduler_conservative(), tw_scheduler_sequential(), and tw_scheduler_sequential_rollback_check().
#define STIME_FROM_KP | ( | kp | ) |
Definition at line 36 of file tw-sched.c.
Referenced by tw_scheduler_conservative().
#define STIME_FROM_PE | ( | pe | ) |
Definition at line 35 of file tw-sched.c.
Referenced by tw_scheduler_conservative(), tw_scheduler_optimistic(), and tw_scheduler_optimistic_realtime().
#define TRIGGER_ROLLBACK_TO_EVENT_TIME | ( | kp, | |
e ) |
Definition at line 34 of file tw-sched.c.
Referenced by tw_sched_event_q().
|
inlinestatic |
Definition at line 515 of file tw-sched.c.
References MPI_COMM_ROSS, tw_error(), and TW_LOC.
Referenced by tw_gvt_hook_step(), and tw_scheduler_rollback_and_cancel_events_pe().
|
inlinestatic |
Definition at line 567 of file tw-sched.c.
References g_tw_gvt_hook_trigger, tw_pe::GVT, tw_pe::GVT_sig, MPI_COMM_ROSS, tw_error(), tw_event_sig_compare_ptr(), and TW_LOC.
Referenced by tw_gvt_hook_step().
|
inlinestatic |
Definition at line 15 of file tw-sched.c.
References tw_event::cv.
Referenced by tw_sched_batch(), tw_sched_batch_realtime(), tw_scheduler_conservative(), tw_scheduler_optimistic_debug(), tw_scheduler_sequential(), and tw_scheduler_sequential_rollback_check().
|
inlinestatic |
This function will determine if the GVT hook should be called, and if it does, it calls the hook
Definition at line 584 of file tw-sched.c.
References does_any_pe(), g_tw_gvt_done, g_tw_gvt_hook, g_tw_gvt_hook_trigger, g_tw_max_sig, g_tw_ts_end, tw_pe::GVT, GVT_HOOK_STATUS_disabled, GVT_HOOK_STATUS_every_n_gvt, GVT_HOOK_STATUS_model_call, GVT_HOOK_STATUS_timestamp, tw_pe::GVT_sig, is_gvt_past_hook_threshold(), tw_pe::pq, tw_event_sig::recv_ts, tw_copy_event_sig(), tw_error(), tw_event_sig_compare_ptr(), TW_LOC, and tw_pq_minimum().
Referenced by tw_scheduler_conservative(), tw_scheduler_optimistic(), and tw_scheduler_optimistic_realtime().
|
inlinestatic |
This function will determine if the GVT hook should be called, and if it does, it calls the hook. Sequential version
Definition at line 638 of file tw-sched.c.
References CMP_GVT_HOOK_TO_NEXT_IN_QUEUE, g_tw_gvt_hook, g_tw_gvt_hook_trigger, g_tw_max_sig, g_tw_ts_end, tw_pe::GVT, GVT_HOOK_STATUS_disabled, GVT_HOOK_STATUS_model_call, GVT_HOOK_STATUS_timestamp, tw_pe::GVT_sig, tw_pe::pq, PQ_MINUMUM, tw_copy_event_sig(), tw_error(), tw_event_sig_compare_ptr(), TW_LOC, tw_pq_get_size(), tw_pq_minimum(), TW_STIME_CMP, and tw_warning().
Referenced by tw_scheduler_sequential(), and tw_scheduler_sequential_rollback_check().
|
static |
Definition at line 162 of file tw-sched.c.
References ALL_STATS, tw_pe::cev_abort, CMP_GVT_HOOK_TO_NEXT_IN_QUEUE, tw_event::critical_path, tw_lp::critical_path, tw_pe::cur_event, tw_lp::cur_state, tw_event::cv, tw_event::dest_lp, tw_lptype::event, 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_mblock, tw_pe::GVT, GVT_HOOK_STATUS_model_call, GVT_HOOK_STATUS_timestamp, tw_pe::GVT_sig, tw_lp::kp, tw_kp::kp_stats, tw_kp::last_sig, tw_kp::last_time, tw_lp::lp_stats, tw_event::owner, tw_kp::pevent_q, tw_pe::pq, tw_event::recv_ts, reset_bitfields(), tw_lptype::revent, ROSS_MAX, RT_COL, RT_STATS, tw_statistics::s_event_abort, tw_statistics::s_event_process, st_kp_stats::s_nevent_abort, st_lp_stats::s_nevent_abort, tw_statistics::s_nevent_abort, 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, st_lp_stats::s_process_event, tw_event::sig, tw_eventq::size, st_collect_engine_data(), st_collect_event_data(), st_collect_model_data(), tw_event::state, tw_pe::stats, tw_lp::suspend_flag, tw_clock_read(), tw_copy_event_sig(), tw_error(), tw_event_data(), tw_event_rollback(), tw_eventq_peek(), tw_eventq_unshift(), tw_gvt_force_update(), TW_kp_pevent_q, TW_LOC, tw_pq_dequeue(), tw_pq_enqueue(), tw_pq_minimum(), TW_STIME_CMP, and tw_lp::type.
Referenced by tw_scheduler_optimistic().
|
static |
Definition at line 322 of file tw-sched.c.
References ALL_STATS, tw_pe::cev_abort, CMP_GVT_HOOK_TO_NEXT_IN_QUEUE, tw_event::critical_path, tw_lp::critical_path, tw_pe::cur_event, tw_lp::cur_state, tw_event::cv, tw_event::dest_lp, tw_lptype::event, 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_interval_start_cycles, g_tw_gvt_realtime_interval, g_tw_gvt_threshold, g_tw_mblock, tw_pe::GVT, GVT_HOOK_STATUS_model_call, GVT_HOOK_STATUS_timestamp, tw_pe::GVT_sig, tw_lp::kp, tw_kp::kp_stats, tw_kp::last_sig, tw_kp::last_time, tw_lp::lp_stats, tw_event::owner, tw_kp::pevent_q, tw_pe::pq, tw_event::recv_ts, reset_bitfields(), tw_lptype::revent, ROSS_MAX, RT_COL, RT_STATS, tw_statistics::s_event_abort, tw_statistics::s_event_process, st_kp_stats::s_nevent_abort, st_lp_stats::s_nevent_abort, tw_statistics::s_nevent_abort, 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_event::sig, tw_eventq::size, st_collect_engine_data(), st_collect_event_data(), st_collect_model_data(), tw_event::state, tw_pe::stats, tw_lp::suspend_flag, tw_clock_read(), tw_copy_event_sig(), tw_error(), tw_event_data(), tw_event_rollback(), tw_eventq_peek(), tw_eventq_unshift(), tw_gvt_force_update_realtime(), TW_kp_pevent_q, TW_LOC, tw_pq_dequeue(), tw_pq_enqueue(), tw_pq_minimum(), TW_STIME_CMP, and tw_lp::type.
Referenced by tw_scheduler_optimistic_realtime().
|
static |
OPT: need to link events into canq in reverse order so that when we rollback the 1st event, we should not need to do any further rollbacks.
Definition at line 97 of file tw-sched.c.
References tw_event::cancel_next, tw_event::cancel_q, tw_pe::cancel_q, tw_pe::event_q, tw_event::owner, tw_pe::pq, tw_statistics::s_cancel_q, tw_statistics::s_pq, tw_event::state, tw_pe::stats, tw_clock_read(), tw_error(), tw_event_free(), tw_eventq_delete_any(), TW_kp_pevent_q, tw_kp_rollback_event(), TW_LOC, TW_pe_anti_msg, TW_pe_event_q, TW_pe_free_q, TW_pe_pq, and tw_pq_delete_any().
Referenced by tw_scheduler_optimistic(), tw_scheduler_optimistic_realtime(), and tw_scheduler_rollback_and_cancel_events_pe().
|
static |
Get all events out of my event queue and spin them out into the priority queue so they can be processed in time stamp order.
Definition at line 44 of file tw-sched.c.
References tw_event::cancel_q, CMP_KP_TO_EVENT_TIME, tw_event::dest_lp, tw_pe::event_q, g_st_ev_trace, g_tw_clock_rate, tw_lp::kp, tw_event::next, tw_event::owner, tw_pe::pq, tw_event::prev, RB_TRACE, tw_statistics::s_pq, tw_statistics::s_rollback, tw_eventq::size, st_collect_event_data(), tw_event::state, tw_pe::stats, TRIGGER_ROLLBACK_TO_EVENT_TIME, tw_clock_read(), tw_error(), tw_eventq_pop_list(), TW_LOC, TW_pe_anti_msg, TW_pe_event_q, TW_pe_free_q, and tw_pq_enqueue().
Referenced by tw_scheduler_conservative(), tw_scheduler_optimistic(), tw_scheduler_optimistic_realtime(), and tw_scheduler_rollback_and_cancel_events_pe().
void tw_sched_init | ( | tw_pe * | me | ) |
Definition at line 477 of file tw-sched.c.
References g_tw_sim_started, io_load_events(), tw_petype::post_lp_init, tw_petype::pre_lp_init, tw_pe::stats, tw_clock_init(), tw_clock_read(), tw_init_kps(), tw_init_lps(), tw_net_barrier(), tw_net_read(), tw_nnodes(), tw_pre_run_lps(), and tw_pe::type.
Referenced by tw_run().
void tw_scheduler_conservative | ( | tw_pe * | me | ) |
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().
void tw_scheduler_optimistic | ( | tw_pe * | me | ) |
Definition at line 922 of file tw-sched.c.
References tw_pe::end_time, tw_petype::final, g_tw_masternode, g_tw_mynode, g_tw_ts_end, tw_pe::gvt_status, tw_statistics::s_net_read, tw_statistics::s_total, st_inst_finalize(), tw_pe::start_time, tw_pe::stats, STIME_FROM_PE, tw_all_lp_stats(), tw_clock_read(), tw_gvt_hook_step(), tw_gvt_step1(), tw_gvt_step2(), tw_net_barrier(), tw_net_read(), tw_nnodes(), tw_sched_batch(), tw_sched_cancel_q(), tw_sched_event_q(), tw_stats(), tw_wall_now(), and tw_pe::type.
Referenced by tw_run().
void tw_scheduler_optimistic_debug | ( | tw_pe * | me | ) |
Definition at line 1028 of file tw-sched.c.
References 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, g_tw_gvt_hook, g_tw_gvt_hook_trigger, g_tw_kp, g_tw_nkp, g_tw_rollback_time, tw_lp::kp, tw_kp::last_sig, tw_kp::last_time, tw_event::owner, tw_kp::pevent_q, tw_pe::pq, tw_event::recv_ts, reset_bitfields(), ROSS_MAX, tw_kp::s_nevent_processed, tw_event::sig, tw_eventq::size, tw_pe::start_time, tw_event::state, tw_copy_event_sig(), tw_error(), tw_event_data(), tw_eventq_unshift(), TW_kp_pevent_q, tw_kp_rollback_to(), tw_kp_rollback_to_sig(), TW_LOC, tw_nnodes(), tw_pq_dequeue(), tw_stats(), TW_STIME_CRT, tw_wall_now(), tw_lp::type, and tw_pe::type.
Referenced by tw_run().
void tw_scheduler_optimistic_realtime | ( | tw_pe * | me | ) |
Definition at line 972 of file tw-sched.c.
References tw_pe::end_time, tw_petype::final, g_tw_clock_rate, g_tw_gvt_interval, g_tw_gvt_interval_start_cycles, g_tw_gvt_realtime_interval, g_tw_masternode, g_tw_mynode, g_tw_ts_end, tw_pe::gvt_status, tw_statistics::s_net_read, tw_statistics::s_total, st_inst_finalize(), tw_pe::start_time, tw_pe::stats, STIME_FROM_PE, tw_clock_read(), tw_gvt_hook_step(), tw_gvt_step1_realtime(), tw_gvt_step2(), tw_net_barrier(), tw_net_read(), tw_nnodes(), tw_sched_batch_realtime(), tw_sched_cancel_q(), tw_sched_event_q(), tw_stats(), tw_wall_now(), and tw_pe::type.
Referenced by tw_run().
void tw_scheduler_rollback_and_cancel_events_pe | ( | tw_pe * | pe | ) |
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().
void tw_scheduler_sequential | ( | tw_pe * | me | ) |
Definition at line 691 of file tw-sched.c.
References ALL_STATS, tw_pe::cev_abort, 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, FULL_TRACE, 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_masternode, g_tw_mynode, g_tw_ts_end, gvt_print(), tw_lp::kp, tw_kp::kp_stats, tw_kp::last_sig, tw_kp::last_time, tw_lp::lp_stats, percent_complete, tw_pe::pq, PQ_MINUMUM, tw_event::recv_ts, reset_bitfields(), ROSS_MAX, RT_STATS, tw_statistics::s_event_process, st_kp_stats::s_nevent_processed, st_lp_stats::s_nevent_processed, tw_kp::s_nevent_processed, tw_statistics::s_pe_event_ties, st_lp_stats::s_process_event, tw_statistics::s_total, tw_event::sig, st_collect_event_data(), st_collect_model_data(), tw_pe::start_time, tw_pe::stats, tw_all_lp_stats(), tw_clock_read(), tw_copy_event_sig(), tw_error(), tw_event_data(), tw_event_free(), tw_gvt_hook_step_seq(), TW_LOC, tw_nnodes(), tw_pq_dequeue(), tw_pq_minimum(), tw_stats(), TW_STIME_CMP, TW_STIME_CRT, TW_STIME_DBL, tw_wall_now(), tw_lp::type, and tw_pe::type.
Referenced by tw_run().
void tw_scheduler_sequential_rollback_check | ( | tw_pe * | me | ) |
Definition at line 1111 of file tw-sched.c.
References ALL_STATS, tw_pe::cev_abort, tw_lptype::commit, tw_event::critical_path, tw_lp::critical_path, crv_check_lpstates(), crv_clean_lpstate(), crv_copy_lpstate(), crv_init_checkpoints(), 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, FULL_TRACE, 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_lp, g_tw_masternode, g_tw_mynode, g_tw_nlp, g_tw_ts_end, gvt_print(), tw_lp::kp, tw_kp::kp_stats, tw_kp::last_sig, tw_kp::last_time, tw_lp::lp_stats, percent_complete, tw_pe::pq, PQ_MINUMUM, tw_event::recv_ts, reset_bitfields(), ROSS_MAX, RT_STATS, tw_statistics::s_event_process, st_kp_stats::s_nevent_processed, st_lp_stats::s_nevent_processed, tw_kp::s_nevent_processed, tw_statistics::s_pe_event_ties, st_lp_stats::s_process_event, st_kp_stats::s_rb_total, tw_kp::s_rb_total, tw_statistics::s_rollback, tw_statistics::s_total, tw_event::sig, st_collect_event_data(), st_collect_model_data(), tw_pe::start_time, crv_lpstate_checkpoint_internal::state, tw_pe::stats, tw_all_lp_stats(), tw_clock_read(), tw_copy_event_sig(), tw_error(), tw_event_data(), tw_event_free(), tw_event_rollback(), tw_gvt_hook_step_seq(), TW_LOC, tw_nnodes(), tw_pq_dequeue(), tw_pq_minimum(), tw_stats(), TW_STIME_CMP, TW_STIME_CRT, TW_STIME_DBL, tw_wall_now(), tw_lp::type, and tw_pe::type.
Referenced by tw_run().
double g_tw_rollback_time = 0.000000001 |
Definition at line 1026 of file tw-sched.c.
Referenced by tw_scheduler_optimistic_debug().