-
Notifications
You must be signed in to change notification settings - Fork 0
/
myargosbuzzjob.sh
executable file
·104 lines (76 loc) · 2.14 KB
/
myargosbuzzjob.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#!/usr/bin/env bash
#SBATCH -J jobname
# Stop execution after any error
set -e
# Cleanup function to be executed upon exit, for any reason
function cleanup() {
rm -rf $WORKDIR
}
########################################
#
# Useful variables
#
########################################
# Your user name
# (Don't change this)
MYUSER=$(whoami)
# Path of the local storage on a node
# Use this to avoid sending data streams over the network
# (Don't change this)
LOCALDIR=/local
# ARGoS environment variables
# (Don't change this)
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/argos3bundle/lib/argos3
export PATH=$PATH:$HOME/argos3bundle/bin
# Buzz environment variables
# (Don't change this)
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/buzzbundle/lib
export PATH=$PATH:$HOME/buzzbundle/bin
# Folder where you want your data to be stored
# (Adapt this to your needs)
DATADIR=~/data
# Path to the file template.argos
# (Adapt this to your needs)
TEMPLATE=~/experiments/myexperiment.argos
########################################
#
# Job-related variables
#
########################################
# Parameters related to this job
# (Use better names than these placeholders)
PARAM1=$1
PARAM2=$2
# Job id
# (Change this to reflect the above parameters)
THISJOB=${PARAM1}_${PARAM2}
# Job working directory
# (Don't change this)
WORKDIR=${LOCALDIR}/${MYUSER}/${THISJOB}
########################################
#
# Job directory
#
########################################
# Create work dir from scratch, enter it
# (Don't change this)
rm -rf $WORKDIR && mkdir -p $WORKDIR && cd $WORKDIR
# Make sure you cleanup upon exit
# (Don't change this)
trap cleanup EXIT SIGINT SIGTERM
########################################
#
# Actual job logic
#
########################################
# Create .argos file from template in home directory
# (Change this to reflect the job parameters)
sed -e "s|PARAM1|${PARAM1}|g" \
-e "s|PARAM2|${PARAM2}|g" \
$TEMPLATE > experiment.argos
# Run ARGoS
# (Usually there's no need to change this)
argos3 -c experiment.argos
# Transfer generated *.dat files into home directory
# (Adapt this to your data files)
cp -a *.dat $DATADIR