#!/bin/bash : The above line tells Linux to use the shell /bin/bash to execute : this script. That must be the first line in the script. : You must have no lines beginning with # before these : PBS lines other than the /bin/bash line: #PBS -N 'qsub-COMSOL' #PBS -o 'qsub-poisson2d_batch.log' #PBS -j oe #PBS -W umask=007 #PBS -q low_priority #PBS -l nodes=1:ppn=1 : Change our current working directory to the directory from which you ran qsub: cd $PBS_O_WORKDIR : Run COMSOL in parallel in batch mode comsol batch -input poisson2d_infile.mph -output poisson2d_outfile.mph