#!/bin/bash #PBS -l nodes=1 #PBS -j oe #PBS -o My_Log_file.txt #PBS -l walltime=00:01:00 cd $PBS_O_WORKDIR
Your job is now waiting in the queue to run. You can follow its progress with the ‘qstat’ command.
saguaro2:~/ > qsub my_job_script.pbs 4213885.moab.local
If you login to a head node, you can save this in a file such as “my_job_script.pbs” and submit it to the queue with the ‘qsub’ command.
Generally, the most important thing will be the ‘S’ (Status) column. In this case the job we submitted has status ‘C’ (Completed). Other important states include ‘Q’ (Queued), ‘R’ (Running) and the dreaded ‘E’ (Error).
#!/bin/bash #PBS -l nodes=1:ppn=1 #PBS -N matlab #PBS -l walltime=1:00:00 #PBS -j oe cd $PBS_O_WORKDIR module load matlab/R2012b
Now we just need to create a set of unique subdirectories from which to run our matlab jobs. We write a short script (call this “job_launcher.sh”) that looks like this:
for f in 1 2 3 4 5 ; do mkdir $f cd $f cat ../scripttop > runjob echo “matlab -nodesktop -nodisplay -nojvm -r \”myprogram($f)\”” >> runjob qsub runjob cd .. done
and you can run this with:
saguaro2:~/ > chmod u+x job_launcher saguaro2:~/ > ./job_launcher