Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-09 07:49:21

0001 #!/bin/bash 
0002 usage(){ cat << EOU
0003 sreport_ab.sh : comparison between two report folders 
0004 ========================================================
0005 
0006 ::
0007 
0008    ~/o/sreport_ab.sh
0009 
0010    A=N7 B=A7 ~/opticks/sysrap/tests/sreport_ab.sh
0011 
0012    A=N7 B=A7 PLOT=Substamp_ALL_Etime_vs_Photon ~/o/sreport_ab.sh
0013 
0014    A=N7 B=A7 PLOT=AB_Substamp_ALL_Etime_vs_Photon ~/o/sreport_ab.sh
0015        ## commandline that reproduces chep 2024 v0 fig 5 
0016        ## (XORWOW with 100M state loading)
0017 
0018    A=N8 B=A8 PLOT=AB_Substamp_ALL_Etime_vs_Photon ~/o/sreport_ab.sh
0019        ## commandline showing Philox scan
0020        ## (Philox with inline curand_init, no loading)
0021 
0022 
0023 Usage from laptop example
0024 --------------------------
0025 
0026 This performance plotting has traditionally been done on laptop, after rsync-ing the 
0027 small metadata only "_sreport" folders from REMOTE workstations which 
0028 are ssh tunnel connected to laptop, via eg::
0029 
0030    laptop> ## check the P and A tunnels are running 
0031    laptop> o ; git pull   ## update opticks source, for the scripts only 
0032 
0033    laptop> TMP=/data/blyth/opticks TEST=medium_scan REMOTE=P ~/o/cxs_min.sh info   ## check remote LOGDIR is  correct 
0034    laptop> TMP=/data/blyth/opticks TEST=medium_scan REMOTE=P ~/o/cxs_min.sh grep   ## rsync the report to laptop
0035 
0036    laptop> TMP=/data1/blyth/tmp TEST=medium_scan REMOTE=A ~/o/cxs_min.sh info   ## check remote LOGDIR is  correct 
0037    laptop> TMP=/data1/blyth/tmp TEST=medium_scan REMOTE=A ~/o/cxs_min.sh grep   ## rsync the report to laptop
0038 
0039 
0040 For reference the "grep" ~/o/cxs_min.sh grep subcommand::
0041 
0042     600 if [ "${arg/grep}" != "$arg" ]; then
0043     601     source $OPTICKS_HOME/bin/rsync.sh ${LOGDIR}_sreport
0044     602 fi
0045 
0046 NB the LOGDIR (aka the run dir) is one level above the event folders
0047 and the sreport folder is a sibling to that containing only metadata
0048 of small size.  
0049 
0050 
0051 
0052 
0053 
0054 EOU
0055 }
0056 
0057 cd $(dirname $(realpath $BASH_SOURCE))
0058 
0059 defarg="info_ana"
0060 arg=${1:-$defarg}
0061 
0062 name=sreport_ab
0063 script=$name.py
0064 
0065 source $HOME/.opticks/GEOM/GEOM.sh 
0066 
0067 a=N8   
0068 b=A8   
0069 
0070 export A=${A:-$a}
0071 export B=${B:-$b}
0072 
0073 resolve(){
0074     case $1 in 
0075       N7) echo /data/blyth/opticks/GEOM/J_2024aug27/CSGOptiXSMTest/ALL1 ;; 
0076       A7) echo /data1/blyth/tmp/GEOM/J_2024aug27/CSGOptiXSMTest/ALL1    ;;
0077       S7) echo /data/simon/opticks/GEOM/J_2024aug27/CSGOptiXSMTest/ALL1 ;; 
0078 
0079       N8) echo /data/blyth/opticks/GEOM/J_2024nov27/CSGOptiXSMTest/ALL1_Debug_Philox_medium_scan ;; 
0080       A8) echo /data1/blyth/tmp/GEOM/J_2024nov27/CSGOptiXSMTest/ALL1_Debug_Philox_medium_scan ;; 
0081     esac
0082 }
0083 
0084 plot=AB_Substamp_ALL_Etime_vs_Photon
0085 export PLOT=${PLOT:-$plot}
0086 
0087 export A_SREPORT_FOLD=$(resolve $A)_sreport  
0088 export B_SREPORT_FOLD=$(resolve $B)_sreport  
0089 export MODE=2                                 ## 2:matplotlib plotting 
0090 
0091 vars="0 BASH_SOURCE arg defarg A B A_SREPORT_FOLD B_SREPORT_FOLD MODE PLOT script"
0092 
0093 if [ "${arg/info}" != "$arg" ]; then
0094     for var in $vars ; do printf "%25s : %s \n" "$var" "${!var}" ; done 
0095 fi 
0096 
0097 if [ "${arg/ana}" != "$arg" ]; then 
0098     export COMMANDLINE="A=$A B=$B PLOT=$PLOT ~/o/sreport_ab.sh"
0099     ${IPYTHON:-ipython} --pdb -i $script
0100     [ $? -ne 0 ] && echo $BASH_SOURCE : ana error && exit 3
0101 fi
0102 
0103 if [ "$arg" == "mpcap" -o "$arg" == "mppub" ]; then
0104     export CAP_BASE=$A_SREPORT_FOLD/figs
0105     export CAP_REL=sreport_ab
0106     export CAP_STEM=$PLOT
0107     case $arg in  
0108        mpcap) source mpcap.sh cap  ;;  
0109        mppub) source mpcap.sh env  ;;  
0110     esac
0111     if [ "$arg" == "mppub" ]; then 
0112         source epub.sh 
0113     fi  
0114 fi 
0115 
0116 exit 0 
0117