pwtools.batch.ParameterStudy.write_input

ParameterStudy.write_input(mode='a', backup=True, sleep=0, excl=True)[source]

Create calculation dir(s) for each parameter set and write input files based on templates. Write sqlite database storing all relevant parameters. Write (bash) shell script to start all calculations (run locally or submitt batch job file, depending on machine.subcmd).

Parameters:
  • mode (str, optional) –

    Fine tune how to write input files (based on templates) to calc dirs calc_foo/0/, calc_foo/1/, … . Note that this doesn’t change the base dir calc_foo at all, only the subdirs for each calc. {‘a’, ‘w’}

    ’a’: Append mode (default). If a previous database is found, then
    subsequent calculations are numbered based on the last ‘idx’.
    calc_foo/0 # old
    calc_foo/1 # old
    calc_foo/2 # new
    calc_foo/3 # new
    ’w’: Write mode. The target dirs are purged and overwritten. Also,
    the database (self.dbfn) is overwritten. Use this to
    iteratively tune your inputs, NOT for working on already
    present results!
    calc_foo/0 # new
    calc_foo/1 # new

  • backup (bool, optional) – Before writing anything, do a backup of self.calc_dir if it already exists.

  • sleep (int, optional) – For the script to start (submitt) all jobs: time in seconds for the shell sleep(1) commmand.

  • excl (bool) – If in append mode, a file <calc_root>/excl_push with all indices of calculations from old revisions is written. Can be used with rsync --exclude-from=excl_push when pushing appended new calculations to a cluster.