-
Notifications
You must be signed in to change notification settings - Fork 2
/
tf_slurm_examine_tfrecords.sh
89 lines (70 loc) · 2.14 KB
/
tf_slurm_examine_tfrecords.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
#!/bin/bash
# We need the SCRIPTKEY to be set in the environment and expect to begin the
# job in the execution directory (the sbatch wrapper script should put us
# there).
if [[ ${SCRIPTKEY} == "" ]]; then
echo "Require the script key environment variable to run..."
exit 1
fi
JOBDIR=`pwd`
# file logistics
PLAYLIST="me1Pdata"
TFRECTYPE="mnvimgs"
PLAYLIST="me1Nmc_targetonly"
TFRECTYPE="hadmultkineimgs"
FILEPAT="${TFRECTYPE}_127x94_${PLAYLIST}"
# default is eventids
CHECKFIELD="--field n_hadmultmeas"
CHECKFIELD=""
# img pars
IMGWX=94
IMGWUV=47
NPLANECODES=174
PLANECODES="--n_planecodes $NPLANECODES"
IMGPAR="--imgw_x $IMGWX --imgw_uv $IMGWUV"
# more file logistics
PROCESSING="201804"
BASEP="/data/minerva/perdue/minerva/tensorflow"
DATADIR="${BASEP}/data/${PROCESSING}/${PLAYLIST}"
LOGFILE="log_examine_tfrec_127x${IMGWX}x${IMGWUV}_${PLAYLIST}_${SCRIPTKEY}.txt"
OUTPAT="results_examine_tfrec_127x${IMGWX}x${IMGWUV}_${PLAYLIST}_${SCRIPTKEY}"
# pick up singularity v2.2
export PATH=/usr/local/singularity/bin:$PATH
# which singularity image
SNGLRTY="/data/perdue/singularity/tf_1_4.simg"
CODEDIR="/home/perdue/ANNMINERvA"
echo "started "`date`" "`date +%s`""
nvidia-smi -L
function check_repo
{
GIT_VERSION=`git describe --abbrev=12 --dirty --always`
echo "Git repo version is $GIT_VERSION"
DIRTY=`echo $GIT_VERSION | perl -ne 'print if /dirty/'`
if [[ $DIRTY != "" ]]; then
echo "Git repo contains uncomitted changes!"
echo ""
echo "Changed files:"
git diff --name-only
echo ""
fi
}
# check repo status - execution code
cd $CODEDIR
echo "Code source is `pwd`"
check_repo
# check repo status - run script code
cd ${JOBDIR}
echo "Work is `pwd`"
check_repo
cp -rv ${CODEDIR}/mnvtf `pwd`
cp -v ${CODEDIR}/tfrec_examiner.py `pwd`
ARGS="--data_dir $DATADIR --file_root $FILEPAT --compression gz --log_name $LOGFILE --out_pattern $OUTPAT $PLANECODES $IMGPAR --tfrec_type $TFRECTYPE $CHECKFIELD"
# show what we will do...
cat << EOF
singularity exec $SNGLRTY python tfrec_examiner.py $ARGS
EOF
singularity exec $SNGLRTY python tfrec_examiner.py $ARGS
nvidia-smi -L >> $LOGFILE
nvidia-smi >> $LOGFILE
echo "finished "`date`" "`date +%s`""
exit 0