-
Notifications
You must be signed in to change notification settings - Fork 1
/
build_data_simple_area_2.sh
executable file
·81 lines (74 loc) · 1.73 KB
/
build_data_simple_area_2.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
#!/bin/bash
subset="yes"
outdir="data/IEEE39/converted_from_PowerFactory/all_stoch_loads/var_H_area_2_comp_grid/coarse"
confdir="area_2_config_grid_coarse/H_comp21_0.1"
ncores=36
i=0
for config in ${confdir}/training*.json ; do
logfile=`basename ${config%.json}.log`
if [ "$subset" = "yes" ] ; then
tmp=`basename $config`
num="${tmp:9:2}"
if [ "$num" = "01" ] || [ "$num" = "16" ] ; then
python3 build_data.py -s training_set -o $outdir $config > $logfile &
sleep 10
fi
else
python3 build_data.py -s training_set -o $outdir $config > $logfile &
sleep 10
fi
let i=i+1
if [ $i -eq $ncores ] ; then
i=0
wait
fi
done
if [ "$subset" = "no" ] ; then
echo "Waiting..."
wait
i=0
fi
for config in ${confdir}/test*.json ; do
logfile=`basename ${config%.json}.log`
if [ "$subset" = "yes" ] ; then
tmp=`basename $config`
num="${tmp:5:2}"
if [ "$num" = "01" ] || [ "$num" = "16" ] ; then
python3 build_data.py -s test_set -o $outdir $config > $logfile &
sleep 10
fi
else
python3 build_data.py -s test_set -o $outdir $config > $logfile &
sleep 10
fi
let i=i+1
if [ $i -eq $ncores ] ; then
i=0
wait
fi
done
if [ "$subset" = "no" ] ; then
echo "Waiting..."
wait
i=0
fi
for config in ${confdir}/validation*.json ; do
logfile=`basename ${config%.json}.log`
if [ "$subset" = "yes" ] ; then
tmp=`basename $config`
num="${tmp:11:2}"
if [ "$num" = "01" ] || [ "$num" = "16" ] ; then
python3 build_data.py -s validation_set -o $outdir $config > $logfile &
sleep 10
fi
else
python3 build_data.py -s validation_set -o $outdir $config > $logfile &
sleep 10
fi
let i=i+1
if [ $i -eq $ncores ] ; then
i=0
wait
fi
done
wait