PEPS Project
 
Home
SAN
User's guide
Modules
Contact Us
 

User's Guide

Peps 2007 is composed by some modules. Each module implements a step to a model resolution. The modules are grouped in three phases: Description, Compiling, and Solution. Description phase is composed by the interface modules. The data structures modules compose the compiling phase and the solution phase concerns the solution modules.

A complet model solution in PEPS is composed of three phases:
Before solve a SAN model we must download and compile  PEPS.  The install procedures are described below.

Being a academic open-source software, the PEPS installation is quite simple and do not demand any special feature from your system. The Makefile do not perform any test to verify the availability of the GNU C++ compiler in the system. This compiler is needed to compile the PEPS software itself during the installation, but also during the execution. One of the new numerical improvements of the PEPS2007 version is the compilation of functional elements   just-in-time.
This procedure calls the  g++ compiler, so make sure this command is reachable from your environment (type which g++ at your prompt to verify it).

Getting the source

The file  Peps2007.tgz have the full PEPS2007 package or the compressed file for each individual modules. Use tar -xvzf file (e.g. tar -xvzf Peps2007.tgz for full PEPS2007 package) to uncompress this file and to generate the directory peps2007 and all the hierachy of files.

Compiling

If you want to compile all PEPS2007 modules, just type  make and the binary files of PEPS will be generated. You can compile just one individual module. In this case type make module_name (e.g.  make compile_san) or run make into module directory. You can change the compiling options to each module into module directory.

Binary files

In the directory ./bin/ in each module directory there is a file with the module name  (e.g.  compile_san)  which is the executable.
To run a Peps module just type the module name. If you compiled the full PEPS2007 package, all executable files generated by each module are copied to the directory  ./peps2007/bin/. The first time Peps is used in a given directory, it will initialize all auxiliary subdirectories.

Model Description

The model must be described in a simple text file and the file name must have .san as extention. You can use a simple text file editor like vi to create your file model.

The model description must respect the SAN interface.  An example of the SAN interface is shown below.

identifiers
   N       = [0..3];  // amount (and identifier) of processes
   R       = 2;       // amount of resources
   mu      = 6;       // rate for leaving a resource for all processes
   lambda  = 3;       // rate for requesting a resource for all processes
   i       = at;      // current automaton index
   f       = lambda * (nb using < R);

events
   loc Acq[N] (f)   // local events Acq have rate f
   loc Rel[N] (mu)  // local events Rel have rate mu

reachability = (nb using <= R);     // only the states where at the most R
                                    // resources are being used are reachable
network rs1 (continuous) 
  aut P[N]
    stt sleeping
      to(using)    Acq[i]
    stt using
      to(sleeping) Rel[i]

results
  full     = nb using == R;     // probability of all resources being used
  empty    = nb using == 0;     // probability of all resources being available
  use1     = st P[0] == using;  // probability that the first process uses the resource
  average  = nb using;          // average number of occupied resources

Compiling a model

The first step to solve a SAN model is to compile the .san model file to generate the Full Markovian Descriptor files.
To compile a  .san file, we use compile_san module as follow:

Command: compile_san file

Typical module output:

./compile_san rs
Start model compilation
First Passage
Compiling identfier block
Compiling event block
Compiling reachability function
Compiling network block
Compiling results block
Creating automata and states structures
Second Passage
Compiling identfier block
Compiling event block
Compiling reachability function
Writing events informations
Compiling network block
Compiling results block
Checking events integrity
Model compiled
Creating description files model
 :-) file 'des/rs.des' saved
 :-) file 'des/rs.dic' saved
 :-) file 'des/rs.fct' saved
 :-) file 'des/rs.tft' saved
 :-) file 'des/rs.res' saved
The description files to rs model were created in "des" directory.

The second step is to transform the Full Markovian Descriptor files in Sparse Markovian Descriptor. This step remove every zeros values of the descriptor matrices and run the aggregation procedures if choice. To perform this step, we use the compile_dsc module:

Command: compile_dsc [options] file

Typical using example with standard options:

./compile_dsc rs

Compilation of a SAN model (Internal Descriptor Generation)
Compile_Network
Compile_Function_Table
 :-) file 'des/rs.tft' read
 :-) file 'dsc/rs.ftb' saved
Compile_Descriptor
 :-) file 'des/rs.des' read
 :-) file 'dsc/rs.dsc' saved
Compile_Reacheable_SS
 :-) file 'dsc/rs.rss' saved
 :-) file 'des/rs.fct' read
Compile_Dictionary
 :-) file 'dsc/rs.dct' saved
 :-) file 'des/rs.dic' read
Compile_Integration_Function
 :-) file 'des/rs.res' read
 :-) file 'dsc/rs.inf' saved

Translation performed:  compilation of a SAN model
 - user time spent:     4.0000000000000001e-03 seconds
 - system time spent:   0.0000000000000000e+00 seconds
 - real time spent:     2.7468191855587065e-01 seconds

Thanks for using PEPS!


The last step of the compile phase is the model normalization. This step normalizes the Sparse Markovian Descriptor files to Continuous Normalized Descriptor.  Two modules can be used in this step. The norm_dsc_ex module uses an extended vector representation and norm_dsc_sp module uses a sparse vector representation.

Command: norm_dsc_ex file  or norm_dsc_sp file

Typical using example output message:

./norm_dsc_ex rs

Normalization of a SAN Descriptor
 :-) file 'dsc/rs.rss' read
 :-) file 'dsc/rs.ftb' read
 :-) file 'dsc/rs.dsc' read
 :-) file 'dsc/rs.dct' read
 :-) file 'cnd/rs.cnd' saved
 :-) file 'cnd/rs.ftb' saved
 :-) file 'cnd/rs.rss' saved
 :-) file 'peps/peps2006/bin/jit/peps_jit.C' saved

Translation performed:  normalization of a SAN descriptor
  (largest element in reachable states: 1.5000000000000000e+01)
 - user time spent:     4.0000000000000001e-03 seconds
 - system time spent:   4.0000000000000001e-03 seconds
 - real time spent:     8.9477301982697099e-01 seconds

Thanks for using PEPS!

Solving a model

After the three compilation steps, the model can be solved. The solution methods are implemented in two modules. As the last compile step, solv_cnd_ex module uses an extended vector representation and solv_cnd_sp module uses a sparse vector representation. If you compile your model using the extended vector, we must use the extended vector representation also to solve its.

Command: solve_cnd_ex  [options] file  or  solve_cnd_sp  [options] file

Typical using example output message:

./solve_cnd_ex rs
 :-) file 'cnd/rs.rss' read
 :-) file 'cnd/rs.ftb' read
 :-) file 'peps/peps2006/bin/jit/peps_jit.C' saved
 :-) file 'cnd/rs.cnd' read
 :-) file 'dsc/rs.dct' read

Solution of the model 'cnd/rs.cnd' (4 automata - 11/16 states)

Enter vector file name: v
Iteration 0: largest: 1.6363636363636364e-01 (0) smallest: 5.4545454545454550e-02 (3)
Iteration 10: largest: 2.1944567435636364e-01 (0) smallest: 5.4861419985454539e-02 (3)
Iteration 20: largest: 2.2192409302507105e-01 (0) smallest: 5.5481023256267900e-02 (3)
Iteration 30: largest: 2.2219021084342858e-01 (0) smallest: 5.5547552710857144e-02 (3)
Iteration 40: largest: 2.2221878502659678e-01 (0) smallest: 5.5554696256649189e-02 (3)
Iteration 50: largest: 2.2222185315615217e-01 (0) smallest: 5.5555463289038043e-02 (3)
Iteration 60: largest: 2.2222218259405468e-01 (0) smallest: 5.5555545648513671e-02 (3)
Iteration 70: largest: 2.2222221796718014e-01 (0) smallest: 5.5555554491795035e-02 (3)
Iteration 80: largest: 2.2222222176534054e-01 (0) smallest: 5.5555555441335135e-02 (3)
Iteration 90: largest: 2.2222222217316495e-01 (0) smallest: 5.5555555543291231e-02 (3)
Iteration 91:
Power solution
Number of iterations:   92
 - user time spent:     -8.3432745304548583e-20 seconds
 - system time spent:   -2.4987471944001860e-19 seconds
 - real time spent:     3.4348982153460383e-03 seconds
Residual Error: 7.0642436345025317e-11 - The method converged (solution found)!
 :-) file 'v.vct' saved
 :-) file 'rs.tim' saved

Thanks for using PEPS!