pipeflex (Version 1.0.0) 

A flexible benchmark for measuring the bandwidth of pipes
=-=======================================================

by Rajan Ravindran (rajancr@us.ibm.com)

Algorithm :
-----------

The program begins with the parent process cloning several threads 
(# should be even). Two threads are grouped into one "active set", 
and each "active set" will have one pipe (exactly "active set" number 
of pipes) to transfer data, one thread being the designated writer, the other
the designated reader.

For example, if application launches 6 threads (T1,...T6) then there will 
be 3 active sets and 3 pipes(P1,P2,P3). Thread T1 will read from Pipe P1 
and thread T2 will write into Pipe P1. 
Below is the picture for the above example.


        T1      T2      T3      T4      T5      T6
        |       |       |       |       |       |
        |   P1  |       |  P2   |       |  P3   |
        |-------|       |-------|       |-------|
        R       W       R       W       R       W 


where R/W is Read/Write

Instead of providing constant pressure on the pipe we are 
introducing interarrival rates with respect to read and write
requests. These are emulated by introducing 
a read_compute_time and write_compute_time parameters, which 
define a random compute delay interval [0.5x .. 1.5x] 
(x={read/write_compute_time}) before pipe read/write 
operations respectively.

The performance metric is the cummulative bandwidth of
all children, measured in MB/sec. Higher bandwidth is an 
indication for a more efficient pipe implementation.

Runtime parameters :
--------------------

-c <N>: N number of children/threads to be launched (should be even)

-t <N>: Time (in seconds) for which each run of the test should be performed

-x <N>: Random delay between [0.5N .. 1.5N] microseconds after each read 
        from pipe is performed.

-y <N>: Random delay between [0.5N .. 1.5N] microseconds before each write 
        into pipe is performed.

-r <N>: Transfer size over the pipe (during read) in KB.

-w <N>: Transfer size over the pipe (during write) in KB.

-o <N>: output format 
	2 is most suitable for running in scripts

-m <N>: set the status flag of the pipe's file descriptor      
	0 Read & Write blocking
        1 Read & Write Nonblocking
        2 Read blocking, Write Nonblocking
        3 Write blocking, Read Nonblocking

-v : verbose mode 

===============================================================================


Sample run :

        pipeflex -c 2 -t 40 -x 10 -y 90 -r 32 -w 1 -o 2 

output for this sample run, looks like

40 , 9.086 

where the first number identifies the time for which the
test was ran and the second number identifies the data transferred
in MB/sec.