Creates separate directories for an array of separate jobs with different parameters and submits those jobs.
More in-depth explanation in one of my blog posts.
1. Create input file template:
bcp.input with variable
NRLENGTH (can use multiple variables):
1000 # Number of iterations 60 # Polymer length 1 # Nanorod radius NRLENGTH # Nanorod length
2. Create submission script template:
sub.sh with variable
#!/bin/sh #PBS -N TRIALNAME #PBS -l nodes=1:ppn=12 #PBS -l walltime=01:00:00,mem=2gb cd $PBS_O_WORKDIR # Run code that happens to look for bcp.input in the current directory mpirun $HOME/code/awesome_code.exe
3. Create trials file:
name i:NRLENGTH s:TRIALNAME length1 4.0 length1-trial length2 5.0 length2-trial length3 6.0 length3-trial
name column means "make directories with the names below".
i:NRLENGTH means "look for
NRLENGTH in the
input file and replace each one with the values below".
s:TRIALNAME column means "look for
TRIALNAME in the
submit file and replace each one with the values below".
4. Run command:
$ param-sweep.sh -i bcp.input -s sub.sh -t trials.txt
trials.txt are what I have hardcoded into the script, I can just use
This creates directories
sub.sh into each directory, and makes the variable replacements in the copied files as specified in the
trials.txt file, then submits all the jobs using
squeue, depending on what is available on your system.
To create the directories but not submit, use the
-n flag (think "no submit"):
$ param-sweep.sh -i bcp.input -s sub.sh -t trials.txt -n