# Sample PBS submit script # Name my job #PBS -N HariSubmission # Request 0 hours, 5 minutes, 0 seconds. #PBS -l walltime=00:05:00 # The output of stdout is sent to outputFile #PBS -o outputFile # The output of stderr is sent to errorFile #PBS -e errorFile # If the job fails, DO NOT rerun it #PBS -r n # Request 4 nodes, and 2 processors (out of available 4) in each node. #PBS -l nodes=4:ppn=2 ## Each comment starts with 2 of '#' and each directive to PBS starts with '#PBS' ## Immediately after the lines containing the PBS directives, you will have to enter the commands you want executed. ## Type in here the same statements that you would type as if you were executing them at the command line ## Let's have some sample commands ls hostname ## The output of the above commands would have been redirected to outputFile ## When your programs are executing, they will have access to certain environment variables that you will need ## to reference to. ## The most important of all of them, and the only one we will need is PBS_NODEFILE ## Let's list the contents of that file cat $PBS_NODEFILE # If we are running an MPI program compiled with mpicc, execute the following # mpirun -np Q -machinefile $PBS_NODEFILE name_of_executable # The np argument mentions the number of processes to spawn, and this is generally the product of number of # nodes you request and the processors per node you requester earlier. # The machinefile argument, $PBS_NODEFILE comes from the PBS environment, and it lists the machines that the PBS scheduler # has assigned for your code. ## Just to give the impression that we are ''computing'' for a while, let's ask the program to sleep for a short while sleep 20 ## This will give us time to test MAUI commands while our program is ''executing''