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

Global Virtual Time. More...

#include <ROOT-Sim.h>
#include <mm/state.h>
+ Include dependency graph for gvt.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void gvt_init (void)
 
void gvt_fini (void)
 
simtime_t gvt_operations (void)
 
simtime_t get_last_gvt (void)
 
void adopt_new_gvt (simtime_t)
 
void ccgs_init (void)
 
void ccgs_fini (void)
 

Detailed Description

Global Virtual Time.

This module implements the GVT reduction. The current implementation is non blocking for observable simulation plaftorms.

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
Francesco Quaglia
Date
June 14, 2014

Definition in file gvt.h.

Function Documentation

void adopt_new_gvt ( simtime_t  new_gvt)

This function is used by Master and Slave Kernels to determine the time barrier and perform some housekeeping once the new GVT value has been computed.

Parameters
new_gvtThis is a new GVT value which has been computed and can be used to perform fossil collection and to activate CCGS

Definition at line 96 of file fossil.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

simtime_t get_last_gvt ( void  )
inline

This function returns the last computed GVT value at each thread. It can be safely used concurrently to keep track of the evolution of the committed trajectory. It's so far mainly used for termination detection based on passed simulation time.

Definition at line 179 of file gvt.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void gvt_fini ( void  )

Finalizer of the GVT subsystem.

Definition at line 156 of file gvt.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void gvt_init ( void  )

Initialization of the GVT subsystem.

Definition at line 132 of file gvt.c.

+ Here is the caller graph for this function:

simtime_t gvt_operations ( void  )

This is the entry point from the main simulation loop to the GVT subsystem. This function is not executed in case of a serial simulation, and is executed concurrently by different worker threads in case of a parallel one. All the operations here implemented must be re-entrant. Any state variable of the GVT implementation must be declared statically and globally (in case, on a per-thread basis). This function is called at every simulation loop, so at the beginning the code should check whether a GVT computation is occurring, or if a computation must be started.

Returns
The newly computed GVT value, or -1.0. Only a Master Thread should return a value different from -1.0, to avoid generating too much information. If every thread will return a value different from -1.0, nothing will be broken, but all the values will be shown associated with the same kernel id (no way to distinguish between different threads here).

Definition at line 300 of file gvt.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function: