#!/bin/tcsh ########################################### # Output goes to file BATCH_OUTPUT. # Error output goes to file BATCH_ERRORS. # If you want the output to go to another file, change BATCH_OUTPUT # or BATCH_ERRORS in the following lines to the full path of that file. #PBS -o BATCH_OUTPUT #PBS -e BATCH_ERRORS # Reserve full nodes so we don't get repeats. #PBS -lvmem=4GB,pmem=4Gb,mem=4Gb,nodes=4:ppn=4,cput=2:00:00,walltime=1:00:00 # Change to directory from which qsub command was issued cd $PBS_O_WORKDIR /bin/rm -f shortfile sort -u ${PBS_NODEFILE} > shortfile echo 'This will give 4 copies for the first host' time mpirun -np 4 ./mpi_hello_hostname echo 'Now just one per host by using shortfile which has unique machine names' time mpirun -np 4 -machinefile shortfile ./mpi_hello_hostname