PGA - ProGram Algebra

Parallel Simulator

The parallel simulator is a controller that can start several simulators that work on one core of the basic instruction set, so that the programs can interact.

The following demonstrations give some insight in the use of the parallel simulator.

Interacting programs

We use three programs: We start our parallel simulation with the following command:
parsim -P PGLEc -B MPP -l makelist -l addfield -l delfield
It starts a simulator for each programs with PGLEc as instruction set and MPP for basic instructions, the parsim controller for starting more simulators, and a graphical view of the core of MPP.

After this, the following operations must be performed:

run makelist
stop makelist
run addfield
run delfield

Now play around with the stop and run buttons in the simulators for addfield and delfield.

Interacting programs with the use of semaphores

In the above demonstration, the programs addfield and delfield use a single instruction for adding and deleting fields. Because of this, these operations do not interfere with each other. If we apply operations that consists of more than one instructions, we should take care of preventing interference. In this demonstration we use semaphores to do this.

The basic instruction


semaphorex.+lock

adds a field lock to the focus semaphorex and returns the value true. If the field lock already exists, the value false is returned. So we can use this instruction as a semaphore.

We use three programs:

We start our parallel simulation with the following command:
parsim -P PGLEc -B MPP -l initlists -l addlists -l dellists
The following operations must be performed:
run initlists
run addlists
run dellists
Now play around with the stop and run buttons in the simulators for addlists and dellists.