fpmas 1.6
Namespaces | Classes | Typedefs
fpmas::synchro Namespace Reference

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 >
 

Detailed Description

fpmas::api::synchro implementations.

Typedef Documentation

◆ GhostMode

template<typename T >
using fpmas::synchro::GhostMode = typedef ghost::GhostMode<T, ghost::GhostMutex>

Regular GhostMode implementation, based on the GhostMutex.

Data synchronization can be described as follows:

  • LOCAL nodes: read and acquires are performed directly on the local data
  • DISTANT nodes: read and acquires are performed on a local copy, imported from the origin process at each DataSync::synchronize() call. Local modifications are overridden at each synchronization.

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 state of a LOCAL agent not executed yet corresponds to its state at the previous time step
  • the state of an already executed LOCAL agent corresponds to its state at the current time step
  • the state of a DISTANT agent always corresponds to its state at the previous time step

The results of a read-only model is hence reproducible only considering that the agents execution order and distribution are the same.

Note
The fpmas::seed() method can be used to enforce those constraints.

A more consistent and reproducible behavior can be obtained using the fpmas::synchro::GlobalGhostMode.

This synchronization policy is inspired from RepastHPC.

See also
fpmas::synchro::GlobalGhostMode
fpmas::synchro::HardSyncMode

◆ GlobalGhostMode

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.

See also
fpmas::synchro::GhostMode
fpmas::synchro::HardSyncMode

◆ HardSyncMode

template<typename T >
using fpmas::synchro::HardSyncMode = typedef hard::hard_link::HardSyncMode<T>

Default HardSyncMode.

◆ HardSyncModeWithGhostLink

HardSyncMode but link operations are managed as in GhostMode.