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

Consistent and Committed Global State. More...

#include <stdbool.h>
#include <core/core.h>
#include <core/init.h>
#include <mm/mm.h>
#include <mm/state.h>
#include <communication/communication.h>
#include <communication/mpi.h>
#include <gvt/ccgs.h>
#include <scheduler/scheduler.h>
#include <scheduler/process.h>
+ Include dependency graph for ccgs.c:

Go to the source code of this file.

Functions

bool ccgs_can_halt_simulation (void)
 
void ccgs_reduce_termination (void)
 
void ccgs_compute_snapshot (state_t *time_barrier_pointer[], simtime_t gvt)
 
void ccgs_init (void)
 
void ccgs_fini (void)
 

Variables

static bool ccgs_completed_simulation = false
 This variable is an aggregate result for the distributed termination detection.
 
static bool * lps_termination
 In case termination detection is incremental, this array keeps track of LPs that think the simulation can be halted already.
 

Detailed Description

Consistent and Committed Global State.

Consistent and Committed Global State (CCGS) is a subsystem that (poeriodically) recomputes a global state on which the LPs can inspect the simulation trajectory and determine whether the simulation can stop, by relying on the OnGVT() callback.

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
Francesco Quaglia
Paolo Romano
Alessandro Pellegrini
Diego Cucuzzo
Stefano D’Alessio
Date
2007

Definition in file ccgs.c.

Function Documentation

void ccgs_compute_snapshot ( state_t time_barrier_pointer[],
simtime_t  gvt 
)

This function rebuilds a simulation state aligned to the new GVT for every LP. In this way, each LP is asked (via the OnGVT() callback) to check whether the simulation can terminate. Two different execution modes are available for this function, depending on the CCGS level in rootsim_config: committed and consistent. The committed version passes to the simulation model for validation the first simulation state that is found committed before the GVT commitment horizon. Nevertheless, two states passed to two different LPs can be associated with different timestamps. Running this function in consistent state, realignes the state of all LPs to the same simulation time, namely the GVT. This allows all LPs to agree on a consistent simulation time for termination detection. This induces, of course, an additional overhead, because the runtime environment has to reprocess in silent execution multiple events.

Parameters
time_barrier_pointerAn array containing the time barrier states of the LPs as computed by the GVT subsystem
gvtThe Global Virtual Time value at which simulation states should be realigned to generate a snapshot inspection which is also consistent

Definition at line 107 of file ccgs.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function: