-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjob.sh
43 lines (36 loc) · 798 Bytes
/
job.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
#!/bin/bash -i
#$ -S /bin/bash
#$ -cwd
#$ -N isg
#$ -j y
set -x # echo commands
hostname
# Copy files to /scratch
scratch="$scratch_root/$$"
rm -rf $scratch
mkdir -p $scratch
num_temps=$(wc -l < $tempset)
cp $tempset "$scratch/temps.txt"
# Get source and compile
cd $scratch
git init
git remote add origin $root
git fetch origin
git checkout $commit
NUM_REPLICAS=$num_temps ./setup.sh
make
if [ "$GENERATE_SAMPLE" -eq 0 ]; then
seeds=$(python bonds.py $((2**LOG_N)) -z $Z --sigma $sigma --ns $num_cores)
else
seeds=$(python seeds.py $num_cores)
fi
# Run
# Don't read or write to /home from here
time mpirun ./isg $seeds
# Move output to home directory, clean up
[ "$KEEP_SAMPLES" -eq 1 ] || rm -f samp_*.txt
bzip2 -9 *.txt
mv *.bz2 $output_dir
mv *.h $output_dir
cd
rm -rf $scratch