I am using the following bash file to submit matlab job to a cluster,
#!/bin/bash
#BSUB -L /bin/bash
#BSUB -J matlab.01
#BSUB -q long
#BSUB -n 32
#BSUB -R "span[hosts=1]"
#BSUB -W 20:00
#BSUB -R "rusage[mem=3072]"
#BSUB -o %J.out
#BSUB -e %J.err
# the working directory
work=/home/models
cd $work
# run matlab on the main function
matlab -logfile ./output.txt -nodisplay -r "foo('model', day);"
suppose the file name is mat.bash, then I use the command
bsub < mat.bash
to submit ONE job to the cluster. The last line in the bash file include a function
fool(model, day)
In this function, model will have four alternatives, and day will have 200 alternatives, which means I have 4 X 400 = 800 jobs to submit to the cluster, each job will run about 16 hours.
what is the most convenient way to submit the 800 jobs, not submit one by one?
The goal is to have multiple jobs can be running on the cluster at the same time, do not need to wait one job finished than start another one.
Thanks in advance!