$ vi jobarray_isbyeon.sh
#!/bin/bash
## Usage : qsub jobarray_isbyeon.sh
#$ -S /bin/bash ### [Shell path] 쉘 지정
#$ -V ### 작업 제출 노드의 쉘 환경변수를 컴퓨팅 노드에도 적용(default)
#$ -cwd ### 현재 디렉토리를 작업 디렉토리로 사용, .e, .o 파일 생성
#$ -q all.q ### (default)
#$ -M iksubyeon@gmail.com ## 작업 관련 메일을 받을 사용자 메일 주소
#$ -t 1-10
#$ -m e ### 작업 종료시 메일발송 -m b | e | a | s | n
### b : 작업 시작 시 메일 전송
### e : 작업 종료 시 메일 전송
### a : 작업 중단 또는 다시 예약 시 메일 전송
### s : 작업 일시 중단 시 메일 전송
### n : 메일 전송 하지 않음
##$ -j y ### Merge the standard out and standard error to one file("작업이름".o"작업번호")
##$ -wd /home/isbyeon/test ### 작업 디렉토리를 설정
##$ -N isbyeon_job1 ### 작업 이름, 명시하지 않으면 script 이름으로 대체
##$ -pe pe_slots 32 ### Parallel Environment
##$ -R yes ### Resource reservation
##$ -l h_rt=01:00:00 ### 작업 경과 시간(hh:mm:ss)(wall clock time), 누락 시 작업 강제 종료
##$ -l mem_10G ### sets the memory limit
### sets the limit of virtual memory required (for parallel jobs per processor).
##$ -l h_vmem=60G
### queue에 job실행 시 다른 queue보다 높은 priority를얻기 위해 반드시 명시, 누락 시 작업 강제 종료
##$ -l all.q
### Export some environment varaibles:
#$ -v MY_TEST=isbyeon,MY_PREFIX=jobarray_isbyeon.out
MY_HOST=`hostname`
MY_DATE=`date`
echo "================================================================"
echo JOB_NAME=$JOB_NAME
echo JOB_ID=$JOB_ID
echo NSLOTS=$NSLOTS
echo QUEUE=$QUEUE
echo SGE_TASK_ID=$SGE_TASK_ID
echo SGE_TASK_FIRST=$SGE_TASK_FIRST
echo SGE_TASK_LAST=$SGE_TASK_LAST
echo SGE_CWD_PATH=$SGE_CWD_PATH
echo PATH=$PATH
echo SGE_STDIN_PATH=$SGE_STDIN_PATH
echo SGE_STDOUT_PATH=$SGE_STDOUT_PATH
echo SGE_STDERR_PATH=$SGE_STDERR_PATH
echo SGE_O_HOST=$SGE_O_HOST
echo SGE_O_PATH=$SGE_O_PATH
echo MY_TEST=$MY_TEST
echo "Got $NSLOTS slots."
cat $TMPDIR/machines
echo "================================================================"
echo "Running job JOB_NAME=$JOB_NAME task SGE_TASK_ID=$SGE_TASK_ID on $MY_HOST at $MY_DATE"
echo "Running job JOB_NAME=$JOB_NAME task SGE_TASK_ID=$SGE_TASK_ID on $MY_HOST at $MY_DATE" > $MY_PREFIX.$SGE_TASK_ID
$ qsub jobarray_isbyeon.sh
Your job-array 138.1-10:1 ("jobarray_isbyeon.sh") has been submitted
$ qstat
job-ID prior name user state submit/start at queue slots ja-task-ID
-------------------------------------------------------------------------------------------------------------
138 0.31086 jobarray_i isbyeon r 01/30/2013 18:01:49 all.q@pgp-0-1.local 1 1
138 0.31086 jobarray_i isbyeon r 01/30/2013 18:01:49 all.q@pgp-0-2.local 1 2
138 0.31086 jobarray_i isbyeon r 01/30/2013 18:01:49 all.q@pgp-0-9.local 1 3
138 0.31086 jobarray_i isbyeon r 01/30/2013 18:01:49 all.q@pgp-0-0.local 1 4
138 0.31086 jobarray_i isbyeon r 01/30/2013 18:01:49 all.q@pgp-0-6.local 1 5
138 0.31086 jobarray_i isbyeon r 01/30/2013 18:01:49 all.q@pgp-0-8.local 1 6
138 0.31086 jobarray_i isbyeon r 01/30/2013 18:01:49 all.q@pgp-0-7.local 1 7
138 0.31086 jobarray_i isbyeon r 01/30/2013 18:01:49 all.q@pgp-0-4.local 1 8
138 0.31086 jobarray_i isbyeon r 01/30/2013 18:01:49 all.q@pgp-0-5.local 1 9
138 0.31086 jobarray_i isbyeon r 01/30/2013 18:01:49 all.q@pgp-0-11.local 1 10
$ cat jobarray_isbyeon.sh.o138.9
JOB_NAME=jobarray_isbyeon.sh
JOB_ID=138
NSLOTS=1
QUEUE=all.q
SGE_TASK_ID=9
SGE_TASK_FIRST=1
SGE_TASK_LAST=10
SGE_CWD_PATH=/home/isbyeon/sge_scripts
PATH=/tmp/138.9.all.q:/share/apps/openmpi/bin:/opt/openmpi/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/eclipse:/opt/ganglia/bin:/opt/ganglia/sbin:/usr/java/latest/bin:/opt/pdsh/bin:/opt/rocks/bin:/opt/rocks/sbin:/opt/gridengine/bin/linux-x64:/home/isbyeon/bin
SGE_STDIN_PATH=/dev/null
SGE_STDOUT_PATH=/home/isbyeon/sge_scripts/jobarray_isbyeon.sh.o138.9
SGE_STDERR_PATH=/home/isbyeon/sge_scripts/jobarray_isbyeon.sh.e138.9
SGE_O_HOST=pgplogin2
SGE_O_PATH=/share/apps/openmpi/bin:/opt/openmpi/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/eclipse:/opt/ganglia/bin:/opt/ganglia/sbin:/usr/java/latest/bin:/opt/pdsh/bin:/opt/rocks/bin:/opt/rocks/sbin:/opt/gridengine/bin/linux-x64:/home/isbyeon/bin
MY_TEST=isbyeon
Got 1 slots.
=============================================================================================================
Running job JOB_NAME=jobarray_isbyeon.sh task SGE_TASK_ID=9 on pgp-0-5.local at Wed Jan 30 10:01:39 KST 2013
$ cat jobarray_isbyeon.out.1
Running job JOB_NAME=jobarray_isbyeon.sh task SGE_TASK_ID=1 on pgp-0-1.local at Wed Jan 30 10:01:49 KST 2013
$ cat jobarray_isbyeon.out.2
Running job JOB_NAME=jobarray_isbyeon.sh task SGE_TASK_ID=2 on pgp-0-2.local at Wed Jan 30 10:01:40 KST 2013
$ cat jobarray_isbyeon.out.3
Running job JOB_NAME=jobarray_isbyeon.sh task SGE_TASK_ID=3 on pgp-0-9.local at Wed Jan 30 10:01:39 KST 2013
$ cat jobarray_isbyeon.out.4
Running job JOB_NAME=jobarray_isbyeon.sh task SGE_TASK_ID=4 on pgp-0-0.local at Wed Jan 30 10:01:34 KST 2013
$ cat jobarray_isbyeon.out.5
Running job JOB_NAME=jobarray_isbyeon.sh task SGE_TASK_ID=5 on pgp-0-6.local at Wed Jan 30 10:01:40 KST 2013
$ cat jobarray_isbyeon.out.6
Running job JOB_NAME=jobarray_isbyeon.sh task SGE_TASK_ID=6 on pgp-0-8.local at Wed Jan 30 10:01:38 KST 2013
$ cat jobarray_isbyeon.out.7
Running job JOB_NAME=jobarray_isbyeon.sh task SGE_TASK_ID=7 on pgp-0-7.local at Wed Jan 30 10:01:47 KST 2013
$ cat jobarray_isbyeon.out.8
Running job JOB_NAME=jobarray_isbyeon.sh task SGE_TASK_ID=8 on pgp-0-4.local at Wed Jan 30 10:01:40 KST 2013
$ cat jobarray_isbyeon.out.9
Running job JOB_NAME=jobarray_isbyeon.sh task SGE_TASK_ID=9 on pgp-0-5.local at Wed Jan 30 10:01:39 KST 2013
$ cat jobarray_isbyeon.out.10
Running job JOB_NAME=jobarray_isbyeon.sh task SGE_TASK_ID=10 on pgp-0-11.local at Wed Jan 30 18:01:36 KST 2013
'HPC > Sun Grid Engine' 카테고리의 다른 글
BIG Memory or Thread (0) | 2013.01.30 |
---|---|
Dependent Jobs (0) | 2013.01.30 |
Example(simple_isbyeon.sh) (0) | 2013.01.30 |
userstat 설치 - A Cluster Queue/Load Monitor (0) | 2013.01.29 |
[SGE] maximum open file limit (0) | 2012.10.19 |
최근댓글