-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathsubmit-actor-job-to-scheduler.sh
72 lines (50 loc) · 1.22 KB
/
submit-actor-job-to-scheduler.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/bash
repository=git://github.com/sebhtml/biosal.git
branch=master
app_path=biosal/$app_path
job_template=biosal/$job_template
app=$(basename $app_path)
sample=$(basename $dataset)
job=$app-$sample-$center-$system-$nodes-$threads-$(date +%Y-%m-%d-%H-%M-%S)
if ! test -e $root
then
mkdir -p $root
fi
cd $root
if ! test -e $sample
then
ln -s $dataset $sample
fi
if ! test -e biosal
then
git clone $repository
fi
cd biosal
git checkout $branch
git pull origin $branch
commit=$(git log | head -n1 | awk '{print $2}')
$build_script
cd ..
cp $app_path $job.$app
cp $job_template $job.sh
template="s/__JOB__/$job/g"
sed -i "$template" $job.sh
template="s/__APP__/$app/g"
sed -i "$template" $job.sh
template="s/__SAMPLE__/$sample/g"
sed -i "$template" $job.sh
template="s/__COMMIT__/$commit/g"
sed -i "$template" $job.sh
template="s/__WALLTIME__/$walltime/g"
sed -i "$template" $job.sh
template="s/__NODES__/$nodes/g"
sed -i "$template" $job.sh
template="s/__THREADS__/$threads/g"
sed -i "$template" $job.sh
template="s/__ALLOCATION__/$allocation/g"
sed -i "$template" $job.sh
template="s/__QUEUE__/$queue/g"
sed -i "$template" $job.sh
$submit_command $job.sh > $job.job
echo "Submitted build $job ($commit)"
cat $job.job