37 while (iter != NULL) {
55 size_t largest_lp_checkpoint = 0;
56 for (
size_t i = 0; i <
g_tw_nlp; i++) {
62 if (lp->
type == iter->val->lptype) {
63 state_checkpointer = iter->val;
70 if (state_checkpointer != NULL && state_checkpointer->
sz_storage > largest_lp_checkpoint) {
71 largest_lp_checkpoint = state_checkpointer->
sz_storage;
78 return largest_lp_checkpoint;
89 fprintf(stderr,
"\n Event:\n ---------\n");
90 fprintf(stderr,
" Bit field contents\n");
92 fprintf(stderr,
" c0 c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15\n");
93 fprintf(stderr,
" %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d \n", b.
c0, b.
c1, b.
c2, b.
c3, b.
c4, b.
c5, b.
c6, b.
c7, b.
c8, b.
c9, b.
c10, b.
c11, b.
c12, b.
c13, b.
c14, b.
c15);
94 fprintf(stderr,
" c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31\n");
95 fprintf(stderr,
" %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d \n", b.
c16, b.
c17, b.
c18, b.
c19, b.
c20, b.
c21, b.
c22, b.
c23, b.
c24, b.
c25, b.
c26, b.
c27, b.
c28, b.
c29, b.
c30, b.
c31);
96 fprintf(stderr,
" ---------\n Event contents\n");
99 fprintf(stderr,
"---------------------------------\n");
102 fprintf(stderr,
"---------------------------------\n");
109 char const * before_msg,
110 char const * after_msg
122 fprintf(stderr,
"Error found by a rollback of an event\n");
123 fprintf(stderr,
" The state of the LP is not consistent when rollbacking!\n");
124 fprintf(stderr,
" LPID = %lu\n", clp->
gid);
125 fprintf(stderr,
"\n LP contents (%s):\n", before_msg);
128 fprintf(stderr,
"---------------------------------\n");
130 fprintf(stderr,
"---------------------------------\n");
132 fprintf(stderr,
"\n LP contents (%s):\n", after_msg);
135 fprintf(stderr,
"---------------------------------\n");
137 fprintf(stderr,
"---------------------------------\n");
143 fprintf(stderr,
"Error found by rollback of an event\n");
144 fprintf(stderr,
" Random number generation `rng` did not rollback properly!\n");
145 fprintf(stderr,
" This often happens if the random number generation was not properly rollbacked by the reverse handler!\n");
146 fprintf(stderr,
" LPID = %lu\n", clp->
gid);
147 fprintf(stderr,
"\n rng contents (%s):\n", before_msg);
149 fprintf(stderr,
"\n rng contents (%s):\n", after_msg);
155 fprintf(stderr,
"Error found by rollback of an event\n");
156 fprintf(stderr,
" Random number generation `core_rng` did not rollback properly!\n");
157 fprintf(stderr,
" LPID = %lu\n", clp->
gid);
158 fprintf(stderr,
"\n core_rng contents (%s):\n", before_msg);
160 fprintf(stderr,
"\n core_rng contents (%s):\n", after_msg);
166 fprintf(stderr,
"Error found by rollback of an event\n");
167 fprintf(stderr,
" triggered_gvt_hook incogruent value, this is most likely the result of not calling tw_trigger_gvt_hook_now_rev when rollbacking tw_trigger_gvt_hook_now!\n");
168 fprintf(stderr,
" LPID = %lu\n", clp->
gid);
169 fprintf(stderr,
"\n lp->triggered_gvt_hook (%s) = %d\n", before_msg, before_state->
triggered_gvt_hook);
170 fprintf(stderr,
"\n lp->triggered_gvt_hook contents (%s) = %d\n", after_msg, clp->
triggered_gvt_hook);
179 if (chkptr && chkptr->
save_lp) {
static void * tw_event_data(tw_event *event)
void tw_fprint_binary_array(FILE *output, char const *prefix, void const *array, size_t size)
Prints content of memory into hexadecimal.
void tw_error(const char *file, int line, const char *fmt,...)
void crv_clean_lpstate(crv_lpstate_checkpoint_internal *state, tw_lp const *clp)
struct llist_chptr * head_linked_list
static crv_checkpointer * get_chkpntr(tw_lpid id)
static void crv_clean_linkedlist(void)
void crv_add_custom_state_checkpoint(crv_checkpointer *state_checkpoint)
void crv_copy_lpstate(crv_lpstate_checkpoint_internal *into, tw_lp const *clp)
static void print_event(crv_checkpointer const *chkptr, tw_lp *clp, tw_event *cev)
struct crv_checkpointer ** checkpointer_for_lps
void crv_check_lpstates(tw_lp *clp, tw_event *cev, crv_lpstate_checkpoint_internal const *before_state, char const *before_msg, char const *after_msg)
size_t crv_init_checkpoints(void)
struct llist_chptr * tail_linked_list
print_checkpoint_state_f print_checkpoint
print_event_f print_event
save_checkpoint_state_f save_lp
clean_checkpoint_state_f clean_lp
unsigned int triggered_gvt_hook
struct llist_chptr * next
Reverse Computation Bitfield.
tw_bf cv
Used by app during reverse computation.
tw_rng_stream * rng
RNG stream array for this LP.
tw_lptype * type
Type of this LP, including service callbacks.
tw_rng_stream * core_rng
RNG stream array for ROSS non-model operation - possible alternative to a model_rng pointer array.
unsigned int triggered_gvt_hook
void * cur_state
Current application LP data.
size_t state_sz
Number of bytes that SV is for the LP.