-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate.sh
More file actions
executable file
·123 lines (97 loc) · 3.1 KB
/
update.sh
File metadata and controls
executable file
·123 lines (97 loc) · 3.1 KB
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#!/bin/bash
. ./scripts/util.sh
NPROC=4
NE_FILE="./scripts/ne_list.dat"
if [ $# -gt 0 ]; then
NPROC=$1
fi
if [ $# -gt 1 ]; then
BDIR=$2
else
BDIR="./data"
fi
DIRS=($BDIR/*/*/);
UPD_DIRS=();
NUPD=0
MERGE_FILES=("cmsdif.dat" "emdif.dat" "mmdif.dat" "smdif.dat" )
LONG_FILES=("slrat.dat" "rgyr.dat" "genom.dat" "ucor.dat" "ucor_avg.dat" "simulation_settings.txt" "pc_avg.dat" "rouse_stat.dat" "rgyr_time.dat" "pc_avg_ss.dat" "magdip.dat" "magdip_time.dat" "magdip_hist.dat" "magdip_hist_time.dat" "cms_dir_mag.dat" "g2dif.dat")
ROUSE_FILES=("ree.dat" "rouse_dyn.dat")
ALL_FILES=(${MERGE_FILES[*]} ${LONG_FILES[*]} ${ROUSE_FILES[*]})
for DIR in ${DIRS[*]}; do
if [ ! -f "$DIR/t=0_dev=0.res" ]; then
continue;
fi
for FILE in ${ALL_FILES[*]}; do
if needs_update $DIR/simulation_settings.txt $DIR/$FILE; then
if needs_update $DIR/simulation_settings.txt $DIR/pol_0/$FILE; then
UPD_DIRS[NUPD]=$DIR
let "NUPD++"
echo "$DIR $FILE"
break
fi
fi
done
done
# exit 0
for DIR in ${UPD_DIRS[*]}; do
./bin/create_ptl $DIR || exit $?
done
I=0
# echo ${DIRS[*]}
# exit 0
for DIR in ${UPD_DIRS[*]}; do
ARGS[2*I]=$DIR
ARGS[2*I+1]=$NE_FILE
let "I++"
done
# echo ${ARGS[*]} | xargs -n 2 -P $NPROC ./bin/lowm_modes
# echo ${ARGS[*]} | xargs -n 2 -P 1 ./bin/lowm_modes
#wait
# exit 0
parallel -j $NPROC ./bin/lowm_modes ::: ${UPD_DIRS[*]} ::: $NE_FILE
# parallel -j 1 ./bin/lowm_modes ::: ${UPD_DIRS[*]} ::: $NE_FILE
for DIR in ${UPD_DIRS[*]}; do
if needs_update $DIR/shearmod.dat $DIR/shearmod_avg.dat; then
./bin/avg_data $DIR/shearmod.dat > $DIR/shearmod_avg.dat || echo "Failed: $DIR"
fi
if needs_update $DIR/ucor.dat $DIR/ucor_avg.dat; then
./bin/avg_data $DIR/ucor.dat 0 > $DIR/ucor_avg.dat || echo "Failed: $DIR"
fi
# if [ -f $DIR/pc.dat -a ! $DIR/pc_point.dat -nt $DIR/pc.dat ]; then
# ./scripts/plot_2d_pc.sh $DIR/pc.dat || echo "Failed: $DIR"
# fi
# if [ -f $DIR/pc_point.dat -a ! $DIR/dr.dat -nt $DIR/pc_point.dat ]; then
# echo "./bin/localization $DIR/pc_point.dat > $DIR/dr.dat"
# ./bin/localization $DIR/pc_point.dat > $DIR/dr.dat || echo "Failed: $DIR"
# fi
# if [ -f $DIR/pc_point.dat -a ! $DIR/pc_avg.dat -nt $DIR/pc_point.dat ]; then
# ./scripts/get_pc_avg.sh $DIR/pc_point.dat > $DIR/pc_avg.dat || echo "Failed: $DIR, pc avging"
# fi
done
# for DIR in ${UPD_DIRS[*]}; do
# ./bin/create_cms $DIR || exit $?
# done
# if [ "${UPD_DIRS[*]}" != "" ]; then
# parallel -j $NPROC ./bin/cms_cor ::: ${UPD_DIRS[*]}
# fi
BASE_DIRS=(`echo $BDIR/*{gpupol,denspol}*`);
for DIR in ${BASE_DIRS[*]}; do
for FILE in ${ALL_FILES[*]}; do
if [ -d $DIR/long -a -f $DIR/long/$FILE ]; then
cp $DIR/long/$FILE $DIR
fi
done
done
for DIR in ${BASE_DIRS[*]}; do
SH_DIR=($DIR/short*)
LN_DIR=($DIR/long*)
# echo $SH_DIR $LN_DIR
if [ ! -d $SH_DIR -o ! -d $LN_DIR ]; then continue; fi
if [ ! -f $LN_DIR/simulation_settings.txt ]; then continue; fi
for FILE in ${MERGE_FILES[*]}; do
./bin/merge_tseries {$SH_DIR,$LN_DIR}/$FILE > $DIR/$FILE || echo "Failed $FILE"
done
for FILE in ${ROUSE_FILES[*]}; do
./bin/merge_tseries {$SH_DIR,$LN_DIR}/$FILE 1 > $DIR/$FILE || echo "Failed $FILE"
done
done