From d09b37df0b6166b190aae11c5bd4d27fd2232544 Mon Sep 17 00:00:00 2001 From: Christian Ohm <christian.ohm@cern.ch> Date: Wed, 13 Sep 2017 16:36:42 +0200 Subject: [PATCH] Adding a little simple script that helps check the event counts and sizes of the derived formats produced at Tier-0 Former-commit-id: c4008c133fe4cdf15b4ad3dd5d06e295845c4015 --- .../scripts/rateandsizechecker.sh | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 PhysicsAnalysis/PrimaryDPDMaker/scripts/rateandsizechecker.sh diff --git a/PhysicsAnalysis/PrimaryDPDMaker/scripts/rateandsizechecker.sh b/PhysicsAnalysis/PrimaryDPDMaker/scripts/rateandsizechecker.sh new file mode 100755 index 00000000000..1edcf981192 --- /dev/null +++ b/PhysicsAnalysis/PrimaryDPDMaker/scripts/rateandsizechecker.sh @@ -0,0 +1,36 @@ +### Simple script for checking rates and sizes for DRAW and DESD(M) formats made at Tier-0 +# +# Author: Christian Ohm (Sep 2017) +# +# Before running this, make sure to set up rucio and have a valid grid proxy: +# setupATLAS +# lsetup rucio +# voms-proxy-init + + +# find a good run, e.g. through a query like this: +# https://docs.google.com/spreadsheets/d/1Ctyt6CQeBejdvBN_w2Y4QttXgD5-p92R6vlmsM4S2ic/edit?usp=sharing + +#runnumber=334960 # hard-coded + +# take the run number from the CL argument +if [ "$#" -ne 1 ]; then + echo "Please provide a run number as argument, i.e. 'rateandsizechecker.sh 334960'" + exit 1 +fi + +runnumber=$1 + +echo "Will look up event counts and dataset sizes for run $runnumber" + +# now get the datasets and save them to ds.txt +rucio ls --short --filter type=dataset "data17_13TeV.00${runnumber}.physics_Main.merge.AOD.*" | sort > ds.txt +rucio ls --short --filter type=dataset "data17_13TeV.00${runnumber}.physics_Main.*.D*.*" | grep -v DAOD | sort >> ds.txt + +# now get the metadata for each of the samples and print the table +for format in `cat ds.txt | cut -d . -f5`; do ds=`cat ds.txt | grep $format`; events=`rucio get-metadata $ds | grep events | cut -d ':' -f2 | xargs`; size=`rucio get-metadata $ds | grep bytes | cut -d ':' -f2 | xargs`; echo "$format,$events,$size"; done 2>&1 | tee table.txt + +# finally, paste the results into a spreadsheet like this: +# https://docs.google.com/spreadsheets/d/1Ctyt6CQeBejdvBN_w2Y4QttXgD5-p92R6vlmsM4S2ic/edit?usp=sharing + +# Enjoy! /CO -- GitLab