The ROme OpTimistic Simulator  2.0.0
A General-Purpose Multithreaded Parallel/Distributed Simulation Platform
state.h
Go to the documentation of this file.
1 
34 #pragma once
35 
36 #include <ROOT-Sim.h>
37 #include <core/core.h>
38 #include <lib/numerical.h>
39 #include <lib/abm_layer.h>
40 #include <lib/topology.h>
41 
42 enum {
46 };
47 
49 typedef struct _state_t {
50  // Pointers to chain this structure to the state queue
51  struct _state_t *next;
52  struct _state_t *prev;
53 
57  void *log;
60 
61  /* Per-LP fields which should be transparently rolled back */
62 
64  short unsigned int state;
66  void *base_pointer;
67 
68  /* Library state fields */
69  numerical_state_t numerical;
70 
71  topology_t *topology;
72 
73  void *region_data;
74 } state_t;
75 
76 struct lp_struct;
77 
78 extern bool LogState(struct lp_struct *);
79 extern void RestoreState(struct lp_struct *, state_t * restore_state);
80 extern void rollback(struct lp_struct *);
81 extern state_t *find_time_barrier(struct lp_struct *, simtime_t time);
82 extern void clean_queue_states(struct lp_struct *, simtime_t new_gvt);
83 extern void rebuild_state(struct lp_struct *, state_t * state_pointer, simtime_t time);
84 extern void set_checkpoint_period(struct lp_struct *, int period);
85 extern void force_LP_checkpoint(struct lp_struct *);
86 extern unsigned int silent_execution(struct lp_struct *, msg_t * evt, msg_t * final_evt);
Structure for LP&#39;s state.
Definition: state.h:49
bool LogState(struct lp_struct *)
Definition: state.c:55
simtime_t lvt
Simulation time associated with the state log.
Definition: state.h:55
Core ROOT-Sim functionalities.
ROOT-Sim header for model development.
void rollback(struct lp_struct *)
Definition: state.c:220
short unsigned int state
Execution state.
Definition: state.h:64
unsigned int silent_execution(struct lp_struct *, msg_t *evt, msg_t *final_evt)
Definition: state.c:173
Numerical Library.
double simtime_t
This defines the type with whom timestamps are represented.
Definition: ROOT-Sim.h:55
struct _state_t state_t
Structure for LP&#39;s state.
void * base_pointer
This is a pointer used to keep track of changes to simulation states via SetState() ...
Definition: state.h:66
Message Type definition.
Definition: core.h:164
msg_t * last_event
This log has been taken after the execution of this event.
Definition: state.h:59
void * log
A pointer to the actual log.
Definition: state.h:57
state_t * find_time_barrier(struct lp_struct *, simtime_t time)
Definition: state.c:282
void set_checkpoint_period(struct lp_struct *, int period)
Definition: state.c:349
void force_LP_checkpoint(struct lp_struct *)
Definition: state.c:364
the customised struct for TOPOLOGY_OBSTACLES representation
Definition: costs.c:22