/**
 * This is a testing configuration file for RPG.
 *
 * It should contain definitions of all available modules in rpg in order to test them,
 * preferably using inputs that result in low times spent by a module, for faster testing. 
 *
 */

#include "shared.conf"

// Override most of shared settings

// 100% reliability
default::fault-probability = parameter (classname = "boolean", value = 0)

//--------------------------------------------------------------------------
// Core benchmark framework configuration.

// Minimum number of cycles in a measurement.
core::min-cycles  				= 2
// Mimimum duration of a measurement.
core::min-time    				= 60
// Maximum duration of a measurement.
core::time-limit				= 600
// How many module invocations to perform before the standalone measurements. 
core::measure-warmup 			= 1
// How many module invocations to perform during the standalone measurements.
core::measure-count  			= 2
// How many threads to launch in the benchmark framework.
core::thread-count 				= 4
// How many clients to simulate in the benchmark framework.
core::client-count				= random-range(min=5, max=30)
// Mean client think time in exponential distribution (0.5s - 3s)
core::client-wait-time-usec-ex 	= random-range(min=500000, max=3000000)
// How many timestamps to collect during single run.
core::values-storage-max-size	= 10000

// Denotes testing architecture generation
core::architecture-generator		 = "testing"

core::testing-architecture-root 	 = "sequential"
core::testing-architecture-dummy	 = "dummy"
core::testing-architecture-instances = 2

// The list of modules to use depends on the threading model.
core::modules = list (

    // Architectural modules
    "branch",
    "loop",
    "sequential", 

    "waiter",
    "dummy",
    "thrasher",
    "interleave",
    "memspeedmp",
    "calculation",
    "fft-tiny",
    "fft-small",

    "lzw-small",
    "lzw-medium",

    "lbm-medium",
    
    "bzip2-small",
    "bzip2-medium",
     
    "sjeng-small",
    "sjeng-medium",
     
    "libquantum-small",
    "libquantum-medium",

    "mcf-small",

    "namd",
    "astar"
)


// The random generator is seeded by the current time.
// Alternatively, seeding the generator by constant is possible.

core::random-seed = start-time ()

// Probabilities are not really used in the testing architecture, but we have to define some
#define PROB_TEST	1

//--------------------------------------------------------------------------
// Architectural modules configurations.

MOD_ARCH(sequential ,sequential, PROB_TEST, 2)

MOD_ARCH(branch, branch, PROB_TEST, 2)

MOD_ARCH(loop, loop, PROB_TEST, 1)
loop::loopcount			= parameter (classname = "random-range", min = 3, max = 5)


//--------------------------------------------------------------------------
// Workload module configurations.

// 401.BZip2

MOD_WORK(bzip2-small, bzip2, PROB_TEST)
bzip2-small::filename       = rand-str-list ( values = list ("input/bzip2-text.html.input", "input/bzip2-dryer.jpg.input", "input/bzip2-lbm-test.input"))
bzip2-small::inputsize		= random-range ( min = 1, max = 2)

MOD_WORK(bzip2-medium, bzip2, PROB_TEST)
bzip2-medium::filename      = "input/bzip2-input.program.input"
bzip2-medium::inputsize		= random-range (min = 4, max = 32)

// 429.MCF


MOD_WORK(mcf-small, mcf, PROB_TEST)
mcf-small::filename       	= rand-str-list ( values = list ("input/mcf-small1.input", "input/mcf-small2.input", "input/mcf-small3.input", "input/mcf-small4.input"))


// 444.NAMD

MOD_WORK(namd, namd, PROB_TEST)
namd::filename       		= parameter (classname 	= "string", value 	= "input/namd.input")
namd::iterations			= parameter (classname 	= "integer", value 	= 1)

// 458.SJENG

MOD_WORK(sjeng-small, sjeng, PROB_TEST)
sjeng-small::filename      = rand-str-list ( values = list ("input/sjeng-small1.input", "input/sjeng-small2.input", "input/sjeng-small3.input"))


MOD_WORK(sjeng-medium, sjeng, PROB_TEST)
sjeng-medium::filename      = rand-str-list (values = list ("input/sjeng-medium1.input", "input/sjeng-medium2.input", "input/sjeng-medium3.input", "input/sjeng-medium4.input"))

// 462.LibQuantum

MOD_WORK(libquantum-small, libquantum, PROB_TEST)
libquantum-small::number1       = rand-int-list (values = list (33, 35, 39, 45, 51, 55))
libquantum-small::number2       = 5

MOD_WORK(libquantum-medium, libquantum, PROB_TEST)
libquantum-medium::number1      = rand-int-list ( values = list (75, 81, 95, 99, 105, 111, 115, 117, 123, 143))
libquantum-medium::number2      = 25

// 470.LBM

MOD_WORK(lbm-medium, lbm, PROB_TEST)
lbm-medium::filename       	= "input/lbm.input"
lbm-medium::steps			= parameter (classname = "random-range", min = 1, max = 3)

// 473.A*

MOD_WORK(astar, astar, PROB_TEST)
astar::filename       		= parameter (classname 	= "string", value 	= "input/astar-lake.cfg")

// RIB LZW

MOD_WORK(lzw-small, lzw, PROB_TEST)
lzw-small::filename   	 = rand-str-list ( values = list ("input/lzw-bzip2-text.html.input", "input/lzw-bzip2-dryer.jpg.input", "input/lzw-bzip2-byoudoin.jpg.input", "input/bzip2-lbm-test.input"))
lzw-small::maxbits 		 = parameter (classname = "integer", value 	= 16)

MOD_WORK(lzw-medium, lzw, PROB_TEST)
lzw-medium::filename   	 = "input/lzw-bzip2-input.program.input"
lzw-medium::maxbits 	 = parameter (classname = "random-range", min = 15, max = 16)

// RIP Calculation

MOD_WORK(calculation, calculation, PROB_TEST)

calculation::stepsize   	= 64
calculation::blocksize  	= 1048576
calculation::mem-cycles		= parameter (classname = "random-range", min = 10, max = 20)
calculation::comp-cycles	= parameter (classname = "random-range", min = 2000, max = 1000000)

// RIP FFT

MOD_WORK(fft-tiny, fft, PROB_TEST)
fft-tiny::method   			= "separate"
fft-tiny::bufsize 			= 1048576

MOD_WORK(fft-small, fft, PROB_TEST)
fft-small::method   		= "separate"
fft-small::bufsize 			= 4194304

// RIP Interleave

MOD_WORK(interleave, interleave, PROB_TEST)
interleave::stepsize		= 64
interleave::blocksize		= 1048576
interleave::pointers		= 128
interleave::hops			= 128

// RIP MemSpeedMP

MOD_WORK(memspeedmp, memspeedmp, PROB_TEST)
memspeedmp::access   		= rand-str-list (values = list ("linear", "random"))
memspeedmp::stepsize 		= 64
memspeedmp::memsize  		= 1048576
memspeedmp::nopcount 		= random-range (min = 2, max = 10)
memspeedmp::maxnopsinfunc 	= random-range (min = 2, max = 10)
memspeedmp::pointers 		= 16
memspeedmp::write    		= parameter (classname = "random-range", min = 0, max = 1)

// RIP Thrasher

MOD_WORK(thrasher, thrasher, PROB_TEST)
thrasher::access   			= rand-str-list (values = list ("linear", "random"))
thrasher::stepsize 			= 64
thrasher::memsize  			= 1048576
thrasher::nopcount 			= random-range (min = 2, max = 10)
thrasher::maxnopsinfunc 	= random-range (min = 2, max = 10)
thrasher::pointers 			= 16
thrasher::write    			= parameter (classname = "random-range", min = 0, max = 1)

// Waiter

MOD_WORK(waiter, waiter, PROB_TEST)
waiter::wait-ms    			= parameter (classname = "random-range", min=50, max=800)
