summaryrefslogtreecommitdiff
path: root/examples/sge
diff options
context:
space:
mode:
Diffstat (limited to 'examples/sge')
-rw-r--r--examples/sge/Makefile25
-rwxr-xr-xexamples/sge/job1.sh14
-rwxr-xr-xexamples/sge/job2.sh15
-rwxr-xr-xexamples/sge/job3.sh15
-rw-r--r--examples/sge/submit.sh10
5 files changed, 79 insertions, 0 deletions
diff --git a/examples/sge/Makefile b/examples/sge/Makefile
new file mode 100644
index 0000000..e0baff6
--- /dev/null
+++ b/examples/sge/Makefile
@@ -0,0 +1,25 @@
+.PHONY: all
+SHELL := /bin/bash
+
+FILES := a.txt b.txt c.txt d.txt
+all: $(FILES) merged.txt 3.txt
+
+%.txt:
+ @echo "Generating: $@"
+ sleep 5
+ echo $(basename $@) > $@
+
+merged.txt: $(FILES)
+ cat $^ | sort > $@
+
+1.txt: job1.sh
+ qsub $<
+
+2.txt: job2.sh 1.txt
+ qsub -hold_jid job1 $<
+
+3.txt: job3.sh 2.txt
+ qsub -hold_jid job2 $<
+
+clean:
+ rm -rf *.txt *.log
diff --git a/examples/sge/job1.sh b/examples/sge/job1.sh
new file mode 100755
index 0000000..4c72eb2
--- /dev/null
+++ b/examples/sge/job1.sh
@@ -0,0 +1,14 @@
+#!/usr/bin/env bash
+#$ -S /bin/bash
+#$ -N job1
+#$ -q all.q
+#$ -cwd
+#$ -l h_rt=01:00:00
+#$ -l h_rss=30720M,mem_free=30720M
+#$ -j y
+#$ -o job1.log
+
+export LANGUAGE=en_AU.UTF-8
+
+sleep 10
+echo job1 > 1.txt
diff --git a/examples/sge/job2.sh b/examples/sge/job2.sh
new file mode 100755
index 0000000..fcd80d7
--- /dev/null
+++ b/examples/sge/job2.sh
@@ -0,0 +1,15 @@
+#!/usr/bin/env bash
+#$ -S /bin/bash
+#$ -N job2
+#$ -q all.q
+#$ -cwd
+#$ -l h_rt=01:00:00
+#$ -l h_rss=30720M,mem_free=30720M
+#$ -j y
+#$ -o job2.log
+
+export LANGUAGE=en_AU.UTF-8
+
+sleep 10
+cat 1.txt > 2.txt
+echo job2 >> 2.txt
diff --git a/examples/sge/job3.sh b/examples/sge/job3.sh
new file mode 100755
index 0000000..7243049
--- /dev/null
+++ b/examples/sge/job3.sh
@@ -0,0 +1,15 @@
+#!/usr/bin/env bash
+#$ -S /bin/bash
+#$ -N job3
+#$ -q all.q
+#$ -cwd
+#$ -l h_rt=01:00:00
+#$ -l h_rss=30720M,mem_free=30720M
+#$ -j y
+#$ -o job3.log
+
+export LANGUAGE=en_AU.UTF-8
+
+sleep 10
+cat 2.txt > 3.txt
+echo job3 >> 3.txt
diff --git a/examples/sge/submit.sh b/examples/sge/submit.sh
new file mode 100644
index 0000000..8adee71
--- /dev/null
+++ b/examples/sge/submit.sh
@@ -0,0 +1,10 @@
+#!/usr/bin/env bash
+#$ -S /bin/bash
+#$ -N make_job
+#$ -q all.q
+#$ -pe make 4
+#$ -cwd
+#$ -j y
+#$ -o make_job.log
+
+make -j $NSLOTS