-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.sh
executable file
·48 lines (43 loc) · 1.6 KB
/
build.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
iprint "Building directory structure ..."
#-----------------------------------------------------------------------
# Create tag directory
#-----------------------------------------------------------------------
mkdir -p $NB_BENCH_DIR/$nb_tag 2> /dev/null
cd $NB_BENCH_DIR/$nb_tag
#-----------------------------------------------------------------------
# See if the directory for the machine exist
#-----------------------------------------------------------------------
if [ -d $nb_machine ]; then
iprint "Directory for the given machine already exist. Exitting ..."
$NB_EXIT_CMD
fi
mkdir $nb_machine
cd $nb_machine
#-----------------------------------------------------------------------
# Create the rest of directory hierarchy
#-----------------------------------------------------------------------
for lelt in ${nb_lelt_list[@]}; do
mkdir lelt_"${lelt}" 2>/dev/null
cd lelt_"${lelt}"
for lx1 in ${nb_lx1_list[@]}; do
mkdir lx_"${lx1}" 2>/dev/null
cd lx_"${lx1}"
cp -r "${nb_case}" .
cd $nb_case_basename
lxd=$(( 3*lx1/2 ))
if [ ${nb_even_lxd} = true ]; then
lxd=$(( $lxd - ($lxd % 2) ))
fi
perl -pe "s/lx1=.*?(?=(,|\)))/lx1=${lx1}/" SIZE | \
perl -pe "s/lxd=.*?(?=(,|\)))/lxd=${lxd}/" | \
perl -pe "s/lelt=.*?(?=(,|\)))/lelt=${lelt}/" | \
perl -pe "s/lpmin=.*?(?=(,|\)))/lpmin=${nb_lp_min}/" | \
perl -pe "s/lpmax=.*?(?=(,|\)))/lpmax=${nb_lp_max}/" | \
perl -pe "s/lp=.*?(?=(,|\)))/lp=${nb_lp_max}/" > nb.SIZE
mv nb.SIZE SIZE
cd ..
cd ..
done
cd ..
done
cd $NB_BASE_DIR