DOWNLOAD

File iconvaryParams2.pl (8.50 KiB)


NAME

varyParams2.pl – Varying parameters in ini-style config files


SYNOPSIS

varyParams2.pl [options]

  Options: 
    -f | --file configfile        load this configuration file
    -l | --log  logfile           log everything to this file
    -v | --verbose                increase verbosity
    -h | --help                   this message
    -m | --man                    man page


DESCRIPTION

This script helps you if you have a program for which many parameters and their combinations have to be tested.

To use it, make sure your program reads the parameters from INI-style config files.

The next step is to create yet another .ini file, which controls which parameters vary and what is executed when.

The following example shall hopefully give you an idea on what to do:

Write a config file, which contains any or all of the following:

 1 # Sample config file for varyParams.pl
 2 [Global]
 3 # this is the program to start
 4 run              = ./my_program
 5
 6 # executed once
 7 at_start         = echo start of block {block} at time {time}
 8 at_end           = echo end of block {block} at time {time}
 9
10 # executed once per run
11 pre_run          = 
12 post_run         = 
13
14 # if not specified otherwise, use this file
15 default_cfg_file = conf/default.cfg
16
17 # run the following blocks:
18 run_blocks       = Exp1,Exp2
19
20 # apply these settings for all blocks
21 settings         = General::interactive=false
22
23
24 [Exp1]
25 # apply these settings for all runs
26 settings = General::interactive=false
27
28 # overwrites global default_cfg_file
29 default_cfg_file = conf/default.cfg
30
31 # executed after global at_start.
32 # Similar: at_end, pre_run, post_run
33 at_start = echo Starting Block {block} at {time}
34
35 # the parameters to vary. Values are separated by ",".
36 vary = Blubber::blo=1,2,3 \
37         Blubber::bla=x,y,z
38
39 [Exp2]
40 # vary parameters in another config file
41 vary = conf/other.cfg::Blubber::blo=true,false
42
43 [Exp3]
44 # iterate over all jpg files in a folder
45 vary = Blubber::image=images/*.jpg
46
47 [Exp4]
48 # vary two variables, but make sure they have the same value
49 # at all times
50 vary    = Blubber::var_a,Bibber::var_b=1,2,3
51
52 # print the value of a variable
53 pre_run = echo Starting run with var_a={var_a}


CAVEATS

– You must make sure that there are at least two variables to vary. If you want to vary just one variable, add a second one with just one value.

Hannes...
  • ...

Menu

Links