![]() |
The ROme OpTimistic Simulator
2.0.0
A General-Purpose Multithreaded Parallel/Distributed Simulation Platform
|
LP state management. More...
#include <ROOT-Sim.h>
#include <core/core.h>
#include <lib/numerical.h>
#include <lib/abm_layer.h>
#include <lib/topology.h>
Go to the source code of this file.
Data Structures | |
struct | _state_t |
Structure for LP's state. More... | |
Typedefs | |
typedef struct _state_t | state_t |
Structure for LP's state. | |
Enumerations | |
enum | { STATE_SAVING_INVALID = 0, STATE_SAVING_COPY, STATE_SAVING_PERIODIC } |
Functions | |
bool | LogState (struct lp_struct *) |
void | RestoreState (struct lp_struct *, state_t *restore_state) |
void | rollback (struct lp_struct *) |
state_t * | find_time_barrier (struct lp_struct *, simtime_t time) |
void | clean_queue_states (struct lp_struct *, simtime_t new_gvt) |
void | rebuild_state (struct lp_struct *, state_t *state_pointer, simtime_t time) |
void | set_checkpoint_period (struct lp_struct *, int period) |
void | force_LP_checkpoint (struct lp_struct *) |
unsigned int | silent_execution (struct lp_struct *, msg_t *evt, msg_t *final_evt) |
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.h.
anonymous enum |
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_period | ( | struct lp_struct * | lp, |
int | period | ||
) |
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.