[ Home | What's New | Contents | Overview | Contributors | Distribution | Examples | Documentation | Manual | Publications | Mailing List Archive | Problems ] This page was last updated by Axel Belinfante on 2006-06-30
TorX Test Tool Information
Prev   Next

partitioner(1) - weight-based test primitive selection for primer

Table of Contents


partitioner - weight-based test primitive selection for primer


partitioner [ options ... ] configuration-file ...


partitioner is an experimental program to partition input test primitives (stimuli), associate weights with the partitions, and to use those weights when a stimulus has to be randomly chosen. In the TorX tool architecture it is placed between the Driver and the Primer. partitioner ``speaks'' the torx-primer(5) interface on its standard input and output, and it starts its Primer sub-program (process). It is possible to have multiple partitioners, one after the other.

partitioner partitions the input actions (stimuli) that it gets from the Primer based on information that it reads from a configuration file. It then adds weight information to the partitions, and uses this information when the Driver asks it for a random input.

partitioner takes the command line options as given in torx-primer(5). Most of these it just passes on to the Primer that it invokes. On start-up, the partitioner reads its configuration-file which is similar to the torx-config(4) configuration file, and the configuration file of the intersector(1). partitioner looks for the entries PARTFILE (which contains the name of the file containing the weights-patterns combination), SPEC, SPECFLAGS, RUNDIR and SEED.


partitioner supports the following commandline options, which are all just passed to the torx-primer(5) that it invokes.
-s number
the seed for the random number generator
-i gates1,gate2,gate3,...
the list of input gates. Note there are no spaces between the gates!
-o gates1,gate2,gate3,...
the list of output gates. Note there are no spaces between the gates!
-S algorithm
the algorithm which can be ioco, traces or simulation.
-d delta-event-tag
the delta-event-tag is used for quiescense in the interface.

Configuration File

The configuration file consists of a number of single-line entries as in torx-config(4). Several entries have a field id. An id is just an arbitrary name, that is intended to group together entries that describe information about the same Primer: these entries should contain the same value for id.
PARTFILE filename
the name of the file that contains the association between actions (action patterns) and the weights. The format of this file is described in the section PARTITION FILE below.
SPEC id filename
The filename of explorer/primer program id. The explorer/primer program will be started from the directory given with the RUNDIR entry for id. Note that the default value for RUNDIR is not the current working directory!
SPECFLAGS id arguments
(Additional) arguments that will be given as arguments to the explorer/primer program of id when it is started. Default value: unset
RUNDIR id directory
The directory from which the explorer/primer program of id will be started. Default value: the directory containing the explorer/primer program as specified in the SPEC entry for id.
SEED number
specifies the seed for the random number generator, and is also passed down the the invoked Primer. Note: it is better to not specify this in the configuration file, but to just use the value given with the --seed flag.

Partition File

The partition file format is experimental. Currently, it just contains Tcl commands to associate names and weights to patterns. The command to make the association is
em_add_pattern pattern [list name weight]
(where the square brackets [ and ] are part of the Tcl command). The name gives the partition name, and weight gives the weight for that partition. The weight can be the empty string () which is interpreted as ``1 diveded by the number of partitions''. The weight of an individual input action is then computed as ``1 divided by the number of elements in its partition''. The Tcl variable PARCOUNT is set to the number of partititions.

Primer-driver Interface Extension

The partition names and the weights of the individual actions is shown in the output of the C_INPUTS torx-primer(5) command. The partitioner extends the output that it gets from its Primer with two additional fields:
where name is the name of the partition to which the event belongs. If there are more partitioners between Primer and Driver, then each partitioner adds its own partition name (preceded by a comma) to the right of the partition name(s) already put their by its subprocess (Primer). Rephrased: the partition names from partitioners from Primer to Driver appear in order, from left to right, separated by commas.
the weight of the individual action. The weights are normalised: the sum of all weights of the input actions should be 1.


We give here as example the configuration files and partition files for a two-level partition scheme, i.e. we have a ``top-level'' partitioner and a ``level-1'' partititoner. The ``top-level'' partitioner is supposed to be invoked by the Driver, and the ``level-1'' partititoner invokes the Primer.


SPEC s ./partitioner    
SPECFLAGS s lvl1.cfg
PARTFILE top.part


# initialise patterns
set user 1
while {$user < 20} {
#    em_add_pattern "*!*!user$user" [list user$user {1.0 / $PARCOUNT}]
    em_add_pattern "*!*!user$user" [list user$user "1.0 / $user"]
    incr purid


SPEC s dir/sub/spec/SUT.expr8    
PARTFILE lvl1.part


em_add_pattern "*!A!*" [list a "0.1"]
em_add_pattern "*!B!*" [list b "0.1"]
em_add_pattern "*!C!*" [list c "0.8"]
em_add_pattern "*!D!*" [list d ""]
em_add_pattern "*!E!*" [list e ""]
em_add_pattern "*!F!*" [list f ""]
em_add_pattern "*!error!*"   [list err "0.1"]

Partitioner Primer-driver Interface Output

Below follows an example of output of the C_INPUTS torx-primer(5) command using the configuration and partition files shown above.

A_EVENT event=cin!A!user13  channel=in  partition=a,user13  weight=0.00268762549161
A_EVENT event=cin!C!user13  channel=in  partition=c,user13  weight=0.0215010039329
A_EVENT event=cin!A!user12  channel=in  partition=a,user12  weight=0.00291159428257
A_EVENT event=cin!C!user12  channel=in  partition=c,user12  weight=0.0232927542606

See Also

torx-intro(1), torx-primer(5), intersector(1)


Th implementation is built reusing parts of already existing programs, and thus contains quite some ``dead'' code, even in the configuration file format (the id parameter was introduced in the intersector(1) but is not used here).

There should be a simpler format for the partition file. On the other hand, the full expressivity of Tcl may have advantages too, as demonstrated with the while construct in the example ``top.part'' partition file.


By Email: <torx_support@cs.utwente.nl>


This manual page documents version 3.9.0 of torx.

Table of Contents

Prev Table of Contents Next
Appendix D: TorX Manual Pages: mscviewer(1) - view a Message Sequence Chart Valid HTML 4.01! Appendix D: TorX Manual Pages: preprocmkprimer(1) - preprocess input before invoking mkprimer