[클러스터] Sample SGE Script
Sample SGE Script
From NBCR Public Wiki
Below are sample SGE submission scripts with basic options. SGE specific options are denoted by “#$”. Each submission script will vary slightly depending on the parallel environment. Three that are available are mpi, mpich, and lammpi (more information on compiling programs for these environments can be found here (https://nbcr.net/pub/wiki/index.php?title=MPI_Applications)).
If you have a problem with “libraries not found”, then check your LD_LIBRARY_PATH and use the “-V” option in the submission script to transfer your environmental variables.
MPI & MPICH
#!/bin/bash
#$ -N job_name
#MPI is also available. Simply substitute “mpi” for “mpich”
#$ -pe mpich 4
#$ -cwd
#$ -o job_name.out
#$ -e job_name.err
/opt/mpich/gnu/bin/mpirun -np $NSLOTS -machinefile $TMPDIR/machines $YOUR_PROG $ARGS
LAM/MPI
#!/bin/bash
#$ -N job_name
#$ -pe lammpi 4
#$ -cwd
#$ -o job_name.out
#$ -e job_name.err
/opt/lam/intel/bin/mpirun C $YOUR_PROG $ARGS
NOTE: mpi and mpich jobs must be compiled by a MPICH compiler, and lammpi by a LAM/MPI compiler. You must also use a mpirun from the same mpi installation you chose to compile with.
Single Processor Jobs
#!/bin/bash
#$ -N job_name
#$ -cwd
#$ -o job_name.out
#$ -e job_name.err
$YOUR_PROG $ARGS
Explanation of above submission options:
-N The name you want to give the job.
-pe The parallel environment of the job. This can be mpi, mpich, or lammpi.
You must also specify the number of processors. This can be 2 or more.
-cwd Runs the job from the directory of submission.
-o File to send standard output.
-e File to send standard error.
-V Transfer all your environment variables
-v Transfer specified environment variables
Finally, to submit your job to SGE do “qsub $SGE_SUBMISSION_SCRIPT”.
Retrieved from “https://nbcr.net:443/pub/wiki/index.php?title=Sample_SGE_Script”