![]() |
fpmas 1.6
|
Namespaces | |
namespace | ghost |
namespace | hard |
Classes | |
class | AcquireGuard |
struct | DataUpdate |
struct | DataUpdate< api::model::AgentPtr > |
struct | DataUpdatePack |
class | Guard |
class | LockGuard |
struct | NodeUpdatePack |
class | ReadGuard |
class | SharedLockGuard |
Typedefs | |
template<typename T > | |
using | GhostMode = ghost::GhostMode< T, ghost::GhostMutex > |
template<typename T > | |
using | GlobalGhostMode = ghost::GhostMode< T, ghost::GlobalGhostMutex > |
template<typename T > | |
using | HardSyncMode = hard::hard_link::HardSyncMode< T > |
template<typename T > | |
using | HardSyncModeWithGhostLink = hard::ghost_link::HardSyncMode< T > |
fpmas::api::synchro implementations.
using fpmas::synchro::GhostMode = typedef ghost::GhostMode<T, ghost::GhostMutex> |
Regular GhostMode implementation, based on the GhostMutex.
Data synchronization can be described as follows:
In the Agent context, this means that modifications on LOCAL agents are immediately perceived by LOCAL agents, even if they are only exported at the end of the time step to distant processes.
Since modifications on DISTANT agents are erased at each synchronization, modifications between agents is likely to produce unexpected behaviors in this mode. However, each LOCAL agent is allowed to modify its own state.
In consequence, even in a read-only model, the state of perceived agents depends on the execution order and on the LOCAL or DISTANT state of each agent:
The results of a read-only model is hence reproducible only considering that the agents execution order and distribution are the same.
A more consistent and reproducible behavior can be obtained using the fpmas::synchro::GlobalGhostMode.
This synchronization policy is inspired from RepastHPC.
using fpmas::synchro::GlobalGhostMode = typedef ghost::GhostMode<T, ghost::GlobalGhostMutex> |
Strict GhostMode implementation, based on the GlobalGhostMutex.
read and acquire operations, on LOCAL or DISTANT nodes, are always performed on a temporary ghost copy. The copy is updated at each DataSync::synchronize() call from the state of the original data.
In the Agent context, this means that modifications on LOCAL agents are only perceived after the next synchronization.
Since modifications on DISTANT agents are erased at each synchronization, modifications between agents is likely to produce unexpected behaviors in this mode. However, each LOCAL agent is allowed to modify its own state.
In consequence, when an agent modifies its own state, modifications are not perceived yet by other LOCAL agent who still see the ghost copy.
This ensures that LOCAL agents always perceive the state of other LOCAL or DISTANT agents at the previous time step. In the case of a properly implemented read-only model, the execution does not depends on the order of execution of agents nor on their LOCAL or DISTANT state. In consequence, this mode implements the strongest reproducibility requirements.
This synchronization policy is inspired from D-MASON.
using fpmas::synchro::HardSyncMode = typedef hard::hard_link::HardSyncMode<T> |
Default HardSyncMode.
using fpmas::synchro::HardSyncModeWithGhostLink = typedef hard::ghost_link::HardSyncMode<T> |
HardSyncMode but link operations are managed as in GhostMode.