With FEP
every participant has a clock which determines the current simulation time of the participant. Initially the simulation times of different participants are completely independent.
That's why FEP
offers some mechanisms for synchronizing the different clocks of different participants to the time of one participant, which is the so called timing master.
In general there are two different timing modes.
Discrete With discrete timing the simulation time of the slaves will only progress if the master sends events to update the time. The master will wait until all slaves have processed the event. This mode is used if deterministic behavior is required. The simulation can run faster or slower than wall clock time.
Continuous With continuous timing each participant will run an independent clock. These clocks will cyclically be synchronized to the time of the timing master (e.g. using the Cristian's algorithm ). The mode is used within realtime environments like vehicle prototypes or other distributed systems.
Another component called the FEP Scheduler
will use the local time of a participant to trigger the execution unit of a participant, the so called FEP Job
.
To integrate ADTF with FEP timing
the ADTF component FEP Timing Service is used.
The service will connect ADTF and FEP
timing by providing and registering clocks at ADTF and FEP
, which are responsible for the synchronization.
To execute parts of an ADTF Graph as a FEP Job
the FEP Job Runner is used. The job will be triggered based on the synchronized time provided by the FEP Participant
.
The following sequence demonstrates how to operate the two example ADTF sessions fep_sink_playback
and fep_source
in a FEP System
using discrete synchronization with the Harddisk player providing the simulation time for the whole system.
The FEP System
will be launched, timing will be configured and the system will be started and stopped. During simulation the timing master fep_sink
will constantly send time update events to the slave fep_source
.
FEP Timing Service
, so there is no need to add it.
./adtf_launcher --session "../src/examples/projects/adtf_example_project/adtfsessions/demo_ipc_sessions/fep_sink_playback.adtfsession" --control-url "fep://default_adtf_system/fep_sink" --console
./adtf_launcher --session "../src/examples/projects/adtf_example_project/adtfsessions/demo_ipc_sessions/fep_source.adtfsession" --control-url "fep://default_adtf_system/fep_source" --console
// configuring discrete timing using ADTF Harddisk Player
./adtf_control -u fep://default_adtf_system -e fep_configuretimingplayer fep_sink
// start the system
./adtf_control -u fep://default_adtf_system -e fep_systemrunlevel 5
// connect to fep_sink, pause the player and get streamtime
connect fep://default_adtf_system/fep_sink
pause
streamtime
// connect to fep_source and get streamtime
connect fep://default_adtf_system/fep_source
streamtime
Similarly the two sessions fep_sink.adtfsession
and fep_source.adtfsession
can be operated with time synchronization.
The only difference is that the command fep_configuretimingcontinuous
or fep_configuretimingdiscrete
needs to be used to configure the FEP System
.
Depending on the nature of the timing master and the timing synchronization you want to use, the following adtf_control commands need to be used to configure the timing for a FEP System
.
Scenario | Command |
---|---|
ADTF session with Harddisk Player is timing master | fep_configuretimingplayer <master_participant_name> |
ADTF session without Harddisk Player is continuous timing master | fep_configuretimingcontinuous <master_participant_name> |
ADTF session without Harddisk Player is discrete timing master | fep_configuretimingdiscrete <master_participant_name> |
Non ADTF session is discrete timing master | fep_configuretimingdiscrete <master_participant_name> |
Non ADTF session is continuous timing master | fep_configuretimingcontinuous <master_participant_name> --master_clock local_system_realtime |