File indexing completed on 2026-04-09 07:49:21
0001
0002 usage(){ cat << EOU
0003 sseq_index_test.sh
0004 ======================
0005
0006 NB the sseq_index_test executable is both installed
0007 and can also be locally built with this script
0008 during development
0009
0010
0011 ::
0012
0013 ~/opticks/sysrap/tests/sseq_index_test.sh info
0014
0015 VERSION=99 C2CUT=200 ~/opticks/sysrap/tests/sseq_index_test.sh
0016 VERSION=98 C2CUT=200 ~/opticks/sysrap/tests/sseq_index_test.sh
0017
0018
0019 Commands
0020 ----------
0021
0022 info
0023 dump vars
0024 build
0025 compile sseq_index_test.cc into executable
0026 run
0027
0028 pdb
0029
0030 ana
0031
0032
0033
0034 EOU
0035 }
0036
0037 SDIR=$(dirname $(realpath $BASH_SOURCE))
0038 CUDA_PREFIX=${CUDA_PREFIX:-/usr/local/cuda}
0039
0040 if [ -n "$GEOM" ]; then
0041 echo $BASH_SOURCE - using externally configured GEOM $GEOM
0042 else
0043 source $HOME/.opticks/GEOM/GEOM.sh
0044 fi
0045
0046 TMP=${TMP:-/tmp/$USER/opticks}
0047
0048 name=sseq_index_test
0049 export FOLD=$TMP/$name
0050 mkdir -p $FOLD
0051
0052
0053 if [ -n "$NUM_MAX" ]; then
0054 unset sseq_index_ab__desc_NUM_MAX
0055 export sseq_index_ab__desc_NUM_MAX=$NUM_MAX
0056 fi
0057
0058 if [ -n "$HISWID" ]; then
0059 unset sseq_index_ab__desc_HISWID
0060 export sseq_index_ab__desc_HISWID=$HISWID
0061 fi
0062
0063 if [ -n "$DEV" ]; then
0064 bin=$FOLD/$name
0065 bin_note="using dev binary - built by this script"
0066 defarg="info_build_run_ana"
0067 else
0068 bin=$name
0069 bin_note="using installed binary - built by om/CMake - use DEV=1 to use dev binary"
0070 defarg="info_run_ana"
0071 fi
0072
0073 arg=${1:-$defarg}
0074
0075 vars=""
0076 vars="$vars BASH_SOURCE SDIR FOLD name bin DEV bin_note sseq_index_ab__desc_NUM_MAX sseq_index_ab__desc_HISWID"
0077
0078
0079 script=$SDIR/sseq_index_test.py
0080
0081
0082 c2cut=40
0083 export C2CUT=${C2CUT:-$c2cut}
0084 export sseq_index_ab_chi2_ABSUM_MIN=$C2CUT
0085 export sseq_index_ab__desc_STYLE=html
0086
0087 vars="$vars BASH_SOURCE SDIR name C2CUT"
0088
0089
0090 if [ -n "$AFOLD" -a -n "$BFOLD" ]; then
0091 MSG="Using EXTERNALLY configured AFOLD BFOLD"
0092 vars="$vars MSG AFOLD BFOLD"
0093 else
0094 MSG="Using INTERNALLY configured AFOLD BFOLD"
0095
0096 executable=G4CXTest
0097
0098 export EXECUTABLE=${EXECUTABLE:-$executable}
0099
0100 version=98
0101 export VERSION=${VERSION:-$version}
0102 export BASE=$TMP/GEOM/$GEOM
0103 export CONTEXT=Debug_Philox
0104 export LOGDIR=$BASE/$EXECUTABLE/ALL${VERSION}_${CONTEXT}
0105 export AFOLD=$LOGDIR/A000
0106 export BFOLD=$LOGDIR/B000
0107
0108 vars="$vars MSG TMP EXECUTABLE VERSION BASE GEOM LOGDIR AFOLD BFOLD"
0109 fi
0110
0111
0112
0113
0114 if [ "${arg/info}" != "$arg" ]; then
0115 for var in $vars ; do printf "%30s : %s \n" "$var" "${!var}" ; done
0116 fi
0117
0118 if [ "${arg/build}" != "$arg" ]; then
0119 if [ -n "$DEV" ]; then
0120 gcc $SDIR/$name.cc -std=c++11 -lstdc++ -I$SDIR/.. -I$CUDA_PREFIX/include -o $bin
0121 [ $? -ne 0 ] && echo $BASH_SOURCE : build error && exit 1
0122 else
0123 echo $BASH_SOURCE : WARNING - skipping build as missing DEV=1
0124 fi
0125 fi
0126
0127 if [ "${arg/run}" != "$arg" ]; then
0128 : needs AFOLD and BFOLD to configure where to load seq.npy from
0129 : needs FOLD to config where to write chi2 info
0130 $bin
0131 [ $? -ne 0 ] && echo $BASH_SOURCE : run error && exit 2
0132 fi
0133
0134 if [ "${arg/pdb}" != "$arg" ]; then
0135 ${IPYTHON:-ipython} --pdb $script
0136 [ $? -ne 0 ] && echo $BASH_SOURCE : pdb error && exit 3
0137 fi
0138
0139 if [ "${arg/ana}" != "$arg" ]; then
0140 ${PYTHON:-python} $script
0141 [ $? -ne 0 ] && echo $BASH_SOURCE : ana error && exit 4
0142 fi
0143
0144 exit 0
0145
0146