#!/bin/bash #PBS -l select=.... etc # Set up the required number of ssh-tunnels to the license server ports ssh -f jblogs@chpclic1 -L *:1234:mylicenseserver.myorganisation.co.za:1234 -N ssh -f jblogs@chpclic1 -L *:1235:mylicenseserver.myorganisation.co.za:1235 -N # Set the appropriate license server environment variable. # Please RTFM of the software that you are using export LM_LICENSE_FILE=1234@localhost # Now run your code with the normal command line mpirun -np $nproc ...... # Finally take down each of your ssh tunnels again kill -9 `ps ux | grep "ssh -f" | grep -o -E '[0-9]+' | head -1 | sed -e 's/^0\+//' ` kill -9 `ps ux | grep "ssh -f" | grep -o -E '[0-9]+' | head -1 | sed -e 's/^0\+//' `