Want to execute multiple calculations at once in a batch job

If you want to multiple calculations in one job by executing batch, for example executing the four commands exec1, exec2, exec3, exec4 at onece, write the batch script as follows.

#!/bin/sh
#$ -cwd
#$ -l f_node=1
#$ -l h_rt=1:00:00
. /etc/profile.d/modules.sh
module load cuda/8.0.61
module load intel/17.0.4.196

exec1 &
exec2 &
exec3 &
exec4 &
wait

The above is only an example.

If you want to execute programs located in different directories at onece, you need to write the executable file from the path. For example, if you want to directly execute  a.out in folder1 of the home directory, you specify as below.

~/folder1/a.out &

If you need to the directory of the executable file and execute it.

cd ~/folder1
./a.out &

Or,

cd ~/folder1 ; ./a.out &

If the last  line of the script file ends with "&", the job wil not run.

Do not forget to write the last wait command of the script.