Skip to content

Submitting COMSOL Jobs With Torque

This script is an example of launching individual COMSOL jobs on the Kennesaw State HPC Cluster.

Torque Script

This script is adapted from the COMSOL Knowledge Blog post: How to Run Simulations in Batch Mode from the Command Line. This version will run across four nodes, with four processors per node; you can adjust those values as needed. Make sure to change netid@kennesaw.edu in the script to your correct email address.

run_comsol.pbs
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
#!/bin/bash

#PBS -V
#PBS -l nodes=4:ppn=4
#PBS -j oe
#PBS -N COMSOL_Job
#PBS -q batch
#PBS -l walltime="04:00:00"
#PBS -m abe
#PBS -M netid@kennesaw.edu (1)

module load COMSOL

cd ${PBS_O_WORKDIR}

comsol batch -mpirmk pbs -alivetime 15 -recover \
    -inputfile "${FILE}" -outputfile "${FILE}.out" \
    -batchlog  "${FILE}.log"
  1. 🙋‍♂️ Make sure to change netid@kennesaw.edu on this line to your KSU email address or you won't receive emails when the job starts and stops.

Usage

Assuming you saved the Torque script from above as run_comsol.pbs, and the name of your COMSOL file is my_comsol.mph, you can submit your COMSOL job with the following command:

[barney@hpc ~]$ qsub run_comsol.pbs -vFILE=${PWD}/my_comsol.mph