The ROme OpTimistic Simulator  2.0.0
A General-Purpose Multithreaded Parallel/Distributed Simulation Platform
process.h File Reference

LP control blocks. More...

#include <stdbool.h>
#include <mm/state.h>
#include <mm/mm.h>
#include <mm/ecs.h>
#include <datatypes/list.h>
#include <datatypes/msgchannel.h>
#include <arch/ult.h>
#include <lib/numerical.h>
#include <lib/abm_layer.h>
#include <lib/topology.h>
#include <communication/communication.h>
#include <arch/x86/linux/cross_state_manager/cross_state_manager.h>
+ Include dependency graph for process.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  lp_struct
 

Macros

#define LP_STACK_SIZE   4194304
 
#define LP_STATE_READY   0x00001
 
#define LP_STATE_RUNNING   0x00002
 
#define LP_STATE_RUNNING_ECS   0x00004
 
#define LP_STATE_ROLLBACK   0x00008
 
#define LP_STATE_SILENT_EXEC   0x00010
 
#define LP_STATE_SUSPENDED   0x01010
 
#define LP_STATE_READY_FOR_SYNCH   0x00011
 
#define LP_STATE_WAIT_FOR_SYNCH   0x01001
 
#define LP_STATE_WAIT_FOR_UNBLOCK   0x01002
 
#define LP_STATE_WAIT_FOR_DATA   0x01004
 
#define BLOCKED_STATE   0x01000
 
#define is_blocked_state(state)   (bool)(state & BLOCKED_STATE)
 
#define lvt(lp)   (lp->bound != NULL ? lp->bound->timestamp : 0.0)
 
#define foreach_lp(lp)
 
#define foreach_bound_lp(lp)
 
#define LPS_bound_set(entry, lp)   lps_bound_blocks[(entry)] = (lp);
 

Functions

void initialize_binding_blocks (void)
 
void initialize_lps (void)
 
struct lp_structfind_lp_by_gid (GID_t)
 

Variables

struct lp_struct ** lps_blocks
 Maintain LPs' simulation and execution states.
 
__thread struct lp_struct ** lps_bound_blocks
 
__thread unsigned int __lp_counter
 
__thread unsigned int __lp_bound_counter
 

Detailed Description

LP control blocks.

This header defines a LP control block, keeping information about both simulation state and execution state as a user thread.

This file is part of ROOT-Sim (ROme OpTimistic Simulator).

ROOT-Sim is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; only version 3 of the License applies.

ROOT-Sim is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with ROOT-Sim; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

Author
Alessandro Pellegrini
Roberto Vitali
Date
November 5, 2013

Definition in file process.h.

Macro Definition Documentation

#define foreach_bound_lp (   lp)
Value:
__lp_bound_counter = 0;\
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)
__thread struct lp_struct ** lps_bound_blocks
Definition: process.c:49
__thread unsigned int n_prc_per_thread
This is used to keep track of how many LPs were bound to the current KLT.
Definition: scheduler.c:69

Definition at line 177 of file process.h.

#define foreach_lp (   lp)
Value:
__lp_counter = 0;\
for(struct lp_struct *(lp) = lps_blocks[__lp_counter]; __lp_counter < n_prc && ((lp) = lps_blocks[__lp_counter]); ++__lp_counter)
unsigned int n_prc
Number of logical processes hosted by the current kernel instance.
Definition: core.c:67
struct lp_struct ** lps_blocks
Maintain LPs&#39; simulation and execution states.
Definition: process.c:44

Definition at line 174 of file process.h.

#define lvt (   lp)    (lp->bound != NULL ? lp->bound->timestamp : 0.0)

This macro retrieves the LVT for the current LP. There is a small interval window where the value returned is the one of the next event to be processed. In particular, this happens in the scheduling function, when the bound is advanced to the next event to be processed, just before its actual execution.

Definition at line 168 of file process.h.

Variable Documentation

__thread struct lp_struct** lps_bound_blocks

Each KLT has a binding towards some LPs. This is the structure used to keep track of LPs currently being handled

Definition at line 49 of file process.c.