![]() |
The ROme OpTimistic Simulator
2.0.0
A General-Purpose Multithreaded Parallel/Distributed Simulation Platform
|
LP state management. More...
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <core/core.h>
#include <core/init.h>
#include <core/timer.h>
#include <datatypes/list.h>
#include <scheduler/process.h>
#include <scheduler/scheduler.h>
#include <mm/state.h>
#include <communication/communication.h>
#include <mm/mm.h>
#include <statistics/statistics.h>
Go to the source code of this file.
Functions | |
bool | LogState (struct lp_struct *lp) |
void | RestoreState (struct lp_struct *lp, state_t *restore_state) |
unsigned int | silent_execution (struct lp_struct *lp, msg_t *evt, msg_t *final_evt) |
void | rollback (struct lp_struct *lp) |
state_t * | find_time_barrier (struct lp_struct *lp, simtime_t simtime) |
void | SetState (void *new_state) |
void | set_checkpoint_mode (int ckpt_mode) |
void | set_checkpoint_period (struct lp_struct *lp, int period) |
void | force_LP_checkpoint (struct lp_struct *lp) |
LP state management.
The state module is responsible for managing LPs' simulation states. In particular, it allows to take a snapshot, to restore a previous snapshot, and to silently re-execute a portion of simulation events to bring a LP to a partiuclar LVT value for which no simulation state is available in the log chain.
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
Definition in file state.c.
This function computes a time barrier, namely the first state snapshot which is associated with a simulation time <= than the simtime value passed as an argument. The time barrier, in the runtime environment, is used to safely install a new computed GVT.
lp | A pointer to the lp_struct of the LP for which we are looking for the current time barrier |
simtime | The simulation time to be associated with a state barrier |
Definition at line 282 of file state.c.
void force_LP_checkpoint | ( | struct lp_struct * | lp | ) |
This function tells the logging subsystem to take a LP state log upon the next invocation to LogState(), independently of the current checkpointing period
lp | A pointer to the lp_struct of the LP for which the checkpoint shold be forced after the next call to LogState() |
Definition at line 364 of file state.c.
bool LogState | ( | struct lp_struct * | lp | ) |
void rollback | ( | struct lp_struct * | lp | ) |
This function rolls back the execution of a certain LP. The point where the execution is rolled back is identified by the event pointed by the rollback_bound entry in the LP control block. For a rollback operation to take place, that pointer must be set before calling this function.
lp | A pointer to the lp_struct of the LP to rollback |
Definition at line 220 of file state.c.
void set_checkpoint_mode | ( | int | ckpt_mode | ) |
void set_checkpoint_period | ( | struct lp_struct * | lp, |
int | period | ||
) |
void SetState | ( | void * | new_state | ) |
This function bring the state pointed by "state" to "final time" by re-executing all the events without sending any messages
lp | A pointer to the LP's lp_struct for which we want to silently reprocess already-executed events |
evt | A pointer to the event from which start the re-execution |
final_evt | A pointer to the first event which should not be reprocessed in silent execution |
Definition at line 173 of file state.c.