Skip to content

Commit 6aa1725

Browse files
committed
Fail when exceeding the maximum size of the tiebreaker signature when calling tw_trigger_gvt_hook_now
1 parent b8aa417 commit 6aa1725

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

core/gvt/mpi_allreduce.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,8 +539,12 @@ void tw_trigger_gvt_hook_now(tw_lp * lp) {
539539
if (g_tw_gvt_hook_trigger.status != GVT_HOOK_STATUS_model_call) {
540540
tw_error(TW_LOC, "`tw_trigger_gvt_hook_now` called but `g_tw_gvt_hook_trigger.status != GVT_HOOK_STATUS_model_call`. Either `tw_trigger_gvt_hook_when_model_calls` was not called or another trigger function has been");
541541
}
542+
if (g_tw_gvt_hook_trigger.sig_at.tie_lineage_length >= MAX_TIE_CHAIN) {
543+
tw_error(TW_LOC, "Maximum zero-offset tie chain reached (%d), increase #define in ross-types.h", MAX_TIE_CHAIN);
544+
}
542545
tw_event_sig * now = &lp->kp->last_sig; // tw_now_sig(lp);
543546
tw_copy_event_sig(&g_tw_gvt_hook_trigger.sig_at, now);
547+
// We store as the trigger time the next valid, larger tiebreaker signature. It is unlikely we will this will tie with any other signature
544548
g_tw_gvt_hook_trigger.sig_at.event_tiebreaker[g_tw_gvt_hook_trigger.sig_at.tie_lineage_length] = 0;
545549
g_tw_gvt_hook_trigger.sig_at.tie_lineage_length += 1;
546550

0 commit comments

Comments
 (0)