#!/bin/bash ### The lines that started with #PBS will be ### considered as submission options. They are ### not comments. ### SEE "man qsub" for details about the default ### variables and #PBS directives ### Set the job name #PBS -N test ### Set the name of file to which stderr will be ### redirected #PBS -e test.err ### Set the name of file to which stdout will be ### redirected #PBS -o test.out ### Set the mail options to send mail when job is ### started execution("b") and terminated("e") or ### interrupted by the shell("a") #PBS -m aeb ### Set the mail receivers (change this to your own address) #PBS -M nobody@asma.cmpe.boun.edu.tr ### Set the queue to submit this job. There is only ### one queue on ASMA, namely "dque". Therefore, leave ### this directive unchanged. #PBS -q dque ### Set the number of nodes that will be used. Ensure ### that the number "nodes" matches with the need of your job ### Since our job requires only one node, we set nodes=1 #PBS -l nodes=1 ### The following lines are executed on the master node ### of the allocated nodes. That is, if the allocated nodes ### are u108,u103,u106 and u110, the master node will be the ### first of these nodes, namely u108. The stdout and stderr ### of u108 are redirected to .out and .err files (defined above) ### locally on u108. After the job finishes, these two will be ### rcopied back to the front end (u0 or asma) ### The allocated nodes are listed in a file. The name of the ### node file is stored in the variable $PBS_NODEFILE ### The following echo lines are just for informational purposes ### --------------------------------------- ### BEGINNING OF EXECUTION ### --------------------------------------- echo The master node of this job is `hostname` ### Actually there is no other node since we want only one node echo The working directory is `echo $PBS_O_WORKDIR` echo This job runs on the following nodes: echo `cat $PBS_NODEFILE` ### end of information preample ### EXEPATH is the directory where your executable resides EXEPATH="/home/loginname/pathtoexe" ### EXE is the name of your executable (compiled mpi program) EXE="myexe" ### ARGS is optional. If you don't need it simply leave it empty ARGS="" ### INFILE is a file that is needed by the master process. Again, it's optional. ### It's put here just to be an example INFILE="mydata.dat" ### Set the execution directory. This directory MUST exist on each node. ### This can be simply your home dir. WORKDIR="/home/loginname" ### Send the necessary files(executable, input file(s)) from the front end(u0) ### to the master node of the allocated nodes. rcp u0:$EXEPATH/$EXE $WORKDIR rcp u0:$EXEPATH/$INFILE $WORKDIR ### Now, we are ready... Simply discard $ARGS and $INFILE if you don't need them. $WORKDIR/$EXE $ARGS $INFILE