TWiki
>
Main Web
>
TWikiGroups
>
LHCbEdinburghGroup
>
LHCbEdinburghGroupAccessToGridStorage
(2008-07-18,
GreigCowan
)
(raw view)
E
dit
A
ttach
P
DF
The script you want to submit to SGE is the one below, called check_storage.sh. This sets up the appropriate environment variables and calls the python script check_storage.py which actually opens the files on the storage and reads the data from them (all done using ROOT). The scripts can be found in the group CVS under User/gcowan/storage/scripts . ---+ check_storage.sh <verbatim> #! /bin/bash PROTOCOL=dcap #PROTOCOL=rfio #PROTOCOL=xroot # LHCb software source /exports/work/ppe/lhcb/lhcb-soft/scripts/local-setup.sh # SetupProject unset CMTPROJECTPATH source /exports/work/physics_ifp_ppe/lhcb/lhcb-soft/scripts/SetupProject.sh DaVinci v19r14 # Grid UI export ECDF_UI=/exports/work/ppe/lhcb/lhcb-soft/lcg/external/Grid #export PATH=$PATH:$ECDF_UI/glite/bin:$ECDF_UI/lcg/bin:$ECDF_UI/lcg/bin/dpm:$ECDF_UI/globus/bin #export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ECDF_UI/glite/lib:$ECDF_UI/lcg/lib:$ECDF_UI/globus/lib:/Disk/lochnagar0/lhcb/lhcb-soft/lcg/external/castor/2.1.1-9/slc4_ia32_gcc34/usr/lib # dCache export DCACHE_CLIENT_ACTIVE=1 export DCACHE_REPLY="eddie`hostname|cut -d\"e\" -f2`.ecdf.ed.ac.uk" export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/exports/work/physics_ifp_ppe/lhcb/lhcb-soft/lcg/external/dcache_client/1.8.0/slc4_ia32_gcc34/dcap/lib/ # DPM # This picks up libshift.so (for the ROOT libRFIO.so lib). In fact, libshift.so is a copy of libdpm.so.1.6.7 export DPM_HOST=srm.glite.ecdf.ed.ac.uk export DPNS_HOST=srm.glite.ecdf.ed.ac.uk export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/exports/work/ppe/sw/builds # Run check python ~/test/check_storage.py ${PROTOCOL} </verbatim> ---+ check_storage.py <verbatim> #! /usr/bin/env python # $Id: $ __author__ = 'Greig A Cowan' __date__ = 'July 2008' __version = 0.1 ''' Do "SetupProject Davinci" before running this script. For rfio, make sure that DPM_HOST and DPNS_HOST are set appropriately. You will need to have a valid grid proxy (for the GSI) and your LD_LIBRARY_PATH set so that libRFIO can pick up the GSI libs. For dcap, make sure that DCACHE_CLIENT_ACTIVE=1 is you are having firewall troubles. For xroot, you probably do not need anything special. ''' import sys from optparse import OptionParser def main(): parser = OptionParser( usage = 'usage: %prog [options] protocol') parser.add_option('-v', '--verbose', dest='verbose', action='store_true', help='Use verbose flag only for testing') (options, args) = parser.parse_args() try: protocol = args[0] except: parser.print_help() if len( args) != 1: parser.print_help() if protocol == 'dcap': dst = 'dcap://pool1.epcc.ed.ac.uk:22125/pnfs/epcc.ed.ac.uk/data/lhcb/production/DC06/L0-v1-lumi2/00001959/DST/0000/00001959_00000840_1.dst?filetype=raw' elif protocol == 'rfio': dst = 'rfio:///dpm/ecdf.ed.ac.uk/home/lhcb/production/DC06/L0-v1-lumi2/00001959/DST/0000/00001959_00001641_1.dst?filetype=raw' elif protocol == 'xroot': dst = 'root://srm.glite.ecdf.ed.ac.uk//dpm/ecdf.ed.ac.uk/home/lhcb/production/DC06/L0-v1-lumi2/00001959/DST/0000/00001959_00001641_1.dst?filetype=raw' exit = False try: import ROOT f = ROOT.TFile.Open( dst) if f: print 'Successfully opened the RAW file: %s' % dst else: print '[ERROR]=3 Failed to open the RAW file: %s' % dst exit = True except Exception,x: print '[ERROR]=4 Exception while opening the RAW file: %s' % dst print str(x) exit = True if exit == True: sys.exit() fileSize = f.GetSize() bufferSize = 35*1024 buffer = '' for i in range( bufferSize): buffer += ' ' bytes = 0 event = 0 while( bytes < ( fileSize - bufferSize)): bytes += bufferSize event += 1 try: res = f.ReadBuffer( buffer, bufferSize) except Exception,x: print '[ERROR]=7 Failed to read event %s.' % event res = 'ERROR' f.Close() print '[SUCCESS]' if __name__ == '__main__': main() </verbatim> -- Main.GreigCowan - 18 Jul 2008
E
dit
|
A
ttach
|
Watch
|
P
rint version
|
H
istory
: r1
|
B
acklinks
|
V
iew topic
|
WYSIWYG
|
M
ore topic actions
Topic revision: r1 - 2008-07-18
-
GreigCowan
Log In
Main
Home
Index
Search
User Search
Changes
Notifications
RSS Feed
Documentation
Support
Webs
Main
Main Archive
Plugins
Sandbox for tests
Public webs
Public webs
ABATBEA
ACPP
ADCgroup
AEGIS
AfricaMap
AgileInfrastructure
ALICE
AliceEbyE
AliceSPD
AliceSSD
AliceTOF
AliFemto
ALPHA
ArdaGrid
ASACUSA
AthenaFCalTBAna
Atlas
AtlasLBNL
AXIALPET
CAE
CALICE
CDS
CENF
CERNSearch
CLIC
Cloud
CloudServices
CMS
Controls
CTA
CvmFS
DB
DefaultWeb
DESgroup
DPHEP
DM-LHC
DSSGroup
EGEE
EgeePtf
ELFms
EMI
ETICS
FIOgroup
FlukaTeam
Frontier
Gaudi
GeneratorServices
GuidesInfo
HardwareLabs
HCC
HEPIX
ILCBDSColl
ILCTPC
IMWG
Inspire
IPv6
IT
ItCommTeam
ITCoord
ITdeptTechForum
ITDRP
ITGT
ITSDC
LAr
LCG
LCGAAWorkbook
Leade
LHCAccess
LHCAtHome
LHCb
LHCgas
LHCONE
LHCOPN
LinuxSupport
Main
Medipix
Messaging
MPGD
NA49
NA61
NA62
NTOF
Openlab
PDBService
Persistency
PESgroup
Plugins
PSAccess
PSBUpgrade
R2Eproject
RCTF
RD42
RFCond12
RFLowLevel
ROXIE
Sandbox
SocialActivities
SPI
SRMDev
SSM
Student
SuperComputing
Support
SwfCatalogue
TMVA
TOTEM
TWiki
UNOSAT
Virtualization
VOBox
WITCH
XTCA
Welcome Guest
Login
or
Register
Cern Search
TWiki Search
Google Search
Main
All webs
Copyright &© 2008-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use
Discourse
or
Send feedback