Previous topic

Sweep Reference

Next topic

PSweep Reference

This Page


class puq.TestProgram(name='', exe='', newdir=False, infiles='', desc='', outfiles='')

Class implementing a TestProgram object representing the simulation to run.

  • name (string) – Name of the program. This is the executable if no exe is defined.
  • exe (string) – An executable command template to run. Strings of the form ‘$var’ are replaced with the value of var. See python template strings (
  • desc – Optional description of the test program.
  • newdir (boolean) – Run each job in its own directory. Necessary if the simulation generates output files. Default is False.
  • infiles (list) – If newdir is True, then this is an optional list of files that should be copied to each new directory.
  • outfiles (list) – An optional list of files that will be saved into the HDF5 file upon completion. The files will be in /output/jobs/n where ‘n’ is the job number.


p1 = UniformParameter('x', 'x', min=-2, max=2)
p2 = UniformParameter('y', 'y', min=-2, max=2)

prog = TestProgram('./', desc='Rosenbrock Function')

# or, the equivalent using template strings

prog = TestProgram(exe='./ --x=$x --y=$y',
  desc='Rosenbrock Function')


# Using newdir and infiles. Will run each job in a new directory
# with a copy of all the infiles.

prog = TestProgram('PM2', newdir=True, desc='MPM Scaling',
  infiles=['pm2geometry', 'pm2input', '',