44 #include <lib/abm_layer.h> 45 #include <lib/topology.h> 49 #define LP_STACK_SIZE 4194304 // 4 MB 51 #define LP_STATE_READY 0x00001 52 #define LP_STATE_RUNNING 0x00002 53 #define LP_STATE_RUNNING_ECS 0x00004 54 #define LP_STATE_ROLLBACK 0x00008 55 #define LP_STATE_SILENT_EXEC 0x00010 56 #define LP_STATE_SUSPENDED 0x01010 57 #define LP_STATE_READY_FOR_SYNCH 0x00011 // This should be a blocked state! Check schedule() and stf() 58 #define LP_STATE_WAIT_FOR_SYNCH 0x01001 59 #define LP_STATE_WAIT_FOR_UNBLOCK 0x01002 60 #define LP_STATE_WAIT_FOR_DATA 0x01004 62 #define BLOCKED_STATE 0x01000 63 #define is_blocked_state(state) (bool)(state & BLOCKED_STATE) 130 bool (*
OnGVT)(
unsigned int me,
void *snapshot);
137 void *event_content,
unsigned int size,
140 #ifdef HAVE_CROSS_STATE 141 GID_t ECS_synch_table[MAX_CROSS_STATE_DEPENDENCIES];
142 unsigned int ECS_index;
145 unsigned long long wait_on_rendezvous;
146 unsigned int wait_on_object;
168 #define lvt(lp) (lp->bound != NULL ? lp->bound->timestamp : 0.0) 171 extern __thread
unsigned int __lp_counter;
172 extern __thread
unsigned int __lp_bound_counter;
174 #define foreach_lp(lp) __lp_counter = 0;\ 175 for(struct lp_struct *(lp) = lps_blocks[__lp_counter]; __lp_counter < n_prc && ((lp) = lps_blocks[__lp_counter]); ++__lp_counter) 177 #define foreach_bound_lp(lp) __lp_bound_counter = 0;\ 178 for(struct lp_struct *(lp) = lps_bound_blocks[__lp_bound_counter]; __lp_bound_counter < n_prc_per_thread && ((lp) = lps_bound_blocks[__lp_bound_counter]); ++__lp_bound_counter) 180 #define LPS_bound_set(entry, lp) lps_bound_blocks[(entry)] = (lp); 182 extern void initialize_binding_blocks(
void);
183 extern void initialize_lps(
void);
msg_t * bound
Pointer to the last correctly processed event.
Structure for LP's state.
User-Level Threads Headers.
A (M, 1) channel for messages.
msg_channel * bottom_halves
Bottom halves.
void * stack
Process' stack.
bool state_log_forced
If this variable is set, the next invocation to LogState() takes a new state log, independently of th...
struct memory_map * mm
Memory map of the LP.
double simtime_t
This defines the type with whom timestamps are represented.
unsigned int from_last_ckpt
Counts how many events executed from the last checkpoint (to support PSS)
Memory Manager main header.
topology_t * topology
pointer to the topology struct
unsigned long long mark
Unique identifier within the LP.
bool(* OnGVT)(unsigned int me, void *snapshot)
list(msg_t) queue_in
Input messages queue.
outgoing_t outgoing_buffer
Buffer used by KLTs for buffering outgoing messages during the execution of an event.
region_abm_t * region
pointer to the region struct
GID_t gid
Global ID of the LP.
short unsigned int state
Current execution state of the LP.
LP_context_t context
LP execution state.
struct lp_struct ** lps_blocks
Maintain LPs' simulation and execution states.
__thread struct lp_struct ** lps_bound_blocks
LP_context_t default_context
LP execution state when blocked during the execution of an event.
void(* ProcessEvent)(unsigned int me, simtime_t now, int event_type, void *event_content, unsigned int size, void *state)
LID_t lid
Local ID of the LP.
Message envelope definition. This is used to handle the output queue and stores information needed to...
Per-LP buffer of newly-generated events.
Event & Cross State Synchornization.
unsigned int ckpt_period
This variable mainains the current checkpointing interval for the LP.
void * current_base_pointer
The current state base pointer (updated by SetState())
unsigned int worker_thread
ID of the worker thread towards which the LP is bound.
the customised struct for TOPOLOGY_OBSTACLES representation
This structure describes the CPU context of a User-Level Thread.