ROSS
tw-sched.c File Reference
#include <ross.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>

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

Macro Definition Documentation

◆ CMP_GVT_HOOK_TO_NEXT_IN_QUEUE

#define CMP_GVT_HOOK_TO_NEXT_IN_QUEUE ( trigger,
pe )
Value:
(trigger.at - tw_pq_minimum(pe->pq))
tw_pe * pe
Definition avl_tree.c:10
tw_stime tw_pq_minimum(tw_pq *)
Definition splay.c:398

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().

◆ CMP_KP_TO_EVENT_TIME

#define CMP_KP_TO_EVENT_TIME ( kp,
e )
Value:
TW_STIME_CMP(kp->last_time, e->recv_ts)
#define TW_STIME_CMP(x, y)
Definition ross-base.h:43

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

Referenced by tw_sched_event_q(), and tw_scheduler_conservative().

◆ PQ_MINUMUM

◆ STIME_FROM_KP

#define STIME_FROM_KP ( kp)
Value:
TW_STIME_DBL(kp->last_time)
#define TW_STIME_DBL(x)
Definition ross-base.h:42

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

Referenced by tw_scheduler_conservative().

◆ STIME_FROM_PE

#define STIME_FROM_PE ( pe)

◆ TRIGGER_ROLLBACK_TO_EVENT_TIME

#define TRIGGER_ROLLBACK_TO_EVENT_TIME ( kp,
e )
Value:
tw_kp_rollback_to(kp, e->recv_ts);
void tw_kp_rollback_to(tw_kp *kp, tw_stime to)
Definition tw-kp.c:59

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

Referenced by tw_sched_event_q().

Function Documentation

◆ does_any_pe()

bool does_any_pe ( bool val)
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().

◆ is_gvt_past_hook_threshold()

bool is_gvt_past_hook_threshold ( tw_pe * me)
inlinestatic

◆ reset_bitfields()

◆ tw_gvt_hook_step()

◆ tw_gvt_hook_step_seq()

void tw_gvt_hook_step_seq ( tw_pe * me)
inlinestatic

◆ tw_sched_batch()

void tw_sched_batch ( tw_pe * me)
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().

◆ tw_sched_batch_realtime()

void tw_sched_batch_realtime ( tw_pe * me)
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().

◆ tw_sched_cancel_q()

◆ tw_sched_event_q()

◆ tw_sched_init()

◆ tw_scheduler_conservative()

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().

◆ 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)

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)

Variable Documentation

◆ g_tw_rollback_time

double g_tw_rollback_time = 0.000000001

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

Referenced by tw_scheduler_optimistic_debug().