Skip to content

Commit

Permalink
Merge pull request #228 from silkenelson/ENH/ued_takepeds
Browse files Browse the repository at this point in the history
Enh/ued takepeds
  • Loading branch information
silkenelson authored Dec 10, 2024
2 parents 8680f89 + 0a9a9bb commit f1b9cdc
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 15 deletions.
49 changes: 36 additions & 13 deletions scripts/takepeds
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,43 @@ if [[($1 == "--help") || ($1 == "-h")]]; then
exit 0
fi

DAQ_RELEASE=/cds/group/pcds/dist/pds/current
EXP=`get_curr_exp`
HUTCH=${EXP:0:3}

# -R: for norecord , -r forces recording
station=$(get_info --getstation)
$DAQ_RELEASE/tools/scanning/take_pedestals -p $station -r
#SIT_ENV_DIR="/sdf/group/lcls/ds/ana/sw"
SIT_ENV_DIR="/cds/group/psdm/sw"

LCLS2_HUTCHES="rix, tmo, ued"
HUTCH=$(get_info --gethutch)
if echo "$LCLS2_HUTCHES" | grep -iw "$HUTCH" > /dev/null; then
echo "This is a LCLS-II experiment"

SIT_ENV_DIR=$SIT_ENV_DIR'/conda2/'
LCLS2=1
if [[ ${HUTCH} =~ 'ued' ]]; then
source $SIT_ENV_DIR/manage/bin/psconda.sh
epixquad_pedestal_scan --record 1 --hutch ued
fi
else
echo "This is a LCLS-I experiment"
SIT_ENV_DIR=$SIT_ENV_DIR'/conda1/'
DAQ_RELEASE=/cds/group/pcds/dist/pds/current

# -R: for norecord , -r forces recording
station=$(get_info --getstation)
$DAQ_RELEASE/tools/scanning/take_pedestals -p $station -r
fi

elogMessage="DARK"
source pcds_conda
PYCMD=LogBookPost
if [ $? -eq 0 ]; then
elogMessage="DARK"
source pcds_conda
PYCMD=LogBookPost

EXP=`get_curr_exp`
RUN=`get_lastRun`
HUTCH=${EXP:0:3}
echo $PYCMD -i "${HUTCH^^}" -u `whoami` -e "$EXP" -t DARK -r $RUN -m "$elogMessage"
$PYCMD -i "${HUTCH^^}" -u `whoami` -p pcds -e "$EXP" -t DARK -r $RUN -m "$elogMessage"&
RUN=`get_lastRun`
echo $PYCMD -i "${HUTCH^^}" -u `whoami` -e "$EXP" -t DARK -r $RUN -m "$elogMessage"
$PYCMD -i "${HUTCH^^}" -u `whoami` -p pcds -e "$EXP" -t DARK -r $RUN -m "$elogMessage"&

echo 'Please call: makepeds -q milano -r '`get_lastRun`' -u <userID>'
echo 'Please call: makepeds -q milano -r '`get_lastRun`' -u <userID>'
else
echo 'takepeds failed, make sure the DAQ is setup appropriately!'
fi
67 changes: 65 additions & 2 deletions scripts/wherepsana
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ OPTIONS:
-h Show usage
-c Pick a specific DAQ config file rather than automatically selecting
current hutch's file
-d Also show information about dss node mapping
-d Also show information about dss node mapping for psana
-a also show nodes for ami1/ami2
-e show detailed information for psana and ami1/ami2
EOF
}

Expand All @@ -33,7 +35,7 @@ if [ -z $FOUNDHUTCH ]; then
fi
NOTRUNNING='Not running'

while getopts "c:d" OPTION
while getopts "c:dae" OPTION
do
case "$OPTION" in
c)
Expand All @@ -42,6 +44,13 @@ do
d)
DETAIL="1"
;;
a)
AMI="1"
;;
e)
DETAIL="1"
AMI="1"
;;
?)
usage
exit
Expand Down Expand Up @@ -73,6 +82,8 @@ fi
/reg/g/pcds/dist/pds/$HUTCH/current/tools/procmgr/procmgr status /reg/g/pcds/dist/pds/$HUTCH/scripts/$CONFIG > /tmp/procServStatus.$$

PSANA_NODES=(`grep monreqsrvpsana /tmp/procServStatus.$$ | awk {'print $1'}`)
AMI2_NODES=(`grep monreqsrvami2_ /tmp/procServStatus.$$ | awk {'print $1'}`)
AMI1_NODES=(`grep monreqsrvami1_ /tmp/procServStatus.$$ | awk {'print $1'}`)

if [[ -z $DETAIL ]]; then
NODESTR=''
Expand Down Expand Up @@ -103,4 +114,56 @@ else

fi

if [[ $AMI ]]; then
if [[ -z $DETAIL ]]; then
NODESTR='ami1: '
for ((idx=0; idx<${#AMI1_NODES[@]}; ++idx)); do
NODESTR=$NODESTR${AMI1_NODES[idx]}',';
done
echo ${NODESTR::-1}
echo
NODESTR='ami2: '
for ((idx=0; idx<${#AMI2_NODES[@]}; ++idx)); do
NODESTR=$NODESTR${AMI2_NODES[idx]}',';
done
echo ${NODESTR::-1}
else
AMI1_MASKS=(`grep monreqsrvami1_ /tmp/procServStatus.$$ | awk -F "-i " {'print $2'} | awk {'print $1'}`)
echo 'ami1 runs on the following nodes looking at event nodes out of '${#EVENT[@]}
NODESTR=''
for ((idx=0; idx<${#AMI1_NODES[@]}; ++idx)); do
echo -n ${AMI1_NODES[idx]}':'
MASKS=${AMI1_MASKS[idx]}
for ((m=0; m<${#EVENT[@]}; ++m)); do
if [ $((${MASKS}&${EVENT_MASKS[m]})) != 0 ]; then
echo -n ' '${EVENT[m]}
MASKS=$((${MASKS}&~${EVENT_MASKS[m]}))
fi
done
if [ ${MASKS} != '0' ]; then
echo " MISSING MON MASK: "$MASKS
fi
echo ""
done

AMI2_MASKS=(`grep monreqsrvami2_ /tmp/procServStatus.$$ | awk -F "-i " {'print $2'} | awk {'print $1'}`)
echo 'ami2 runs on the following nodes looking at event nodes out of '${#EVENT[@]}
NODESTR=''
for ((idx=0; idx<${#AMI2_NODES[@]}; ++idx)); do
echo -n ${AMI2_NODES[idx]}':'
MASKS=${AMI2_MASKS[idx]}
for ((m=0; m<${#EVENT[@]}; ++m)); do
if [ $((${MASKS}&${EVENT_MASKS[m]})) != 0 ]; then
echo -n ' '${EVENT[m]}
MASKS=$((${MASKS}&~${EVENT_MASKS[m]}))
fi
done
if [ ${MASKS} != '0' ]; then
echo " MISSING MON MASK: "$MASKS
fi
echo ""
done
fi
fi

rm /tmp/procServStatus.$$

0 comments on commit f1b9cdc

Please sign in to comment.