ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitProd/Processing/bin/input.py
(Generate patch)

Comparing UserCode/MitProd/Processing/bin/input.py (file contents):
Revision 1.5 by paus, Sat Oct 22 13:07:04 2011 UTC vs.
Revision 1.7 by paus, Fri Jul 26 14:53:30 2013 UTC

# Line 35 | Line 35 | db      = None
35   dbs     = None
36   dataset = None
37   option  = 'lfn'
38 + private = False
39  
40   # Read new values from the command line
41   for opt, arg in opts:
# Line 55 | Line 56 | if dataset == None:
56      cmd = "--dataset=  required parameter not provided."
57      raise RuntimeError, cmd
58  
59 + # is it a private production
60 + f = dataset.split('/')
61 + if f[1] == "mc":
62 +    private = True
63 +    #print ' Attention -- private dataset identified.'
64 +
65   #---------------------------------------------------------------------------------------------------
66   # main
67   #---------------------------------------------------------------------------------------------------
68 + if private:
69 +    lfn = '/store/user/paus' + dataset
70 +    dir = '/mnt/hadoop/cms/store/user/paus' + dataset
71 +    cmd = 'list ' + dir
72 +    for line in os.popen(cmd).readlines():
73 +        line = line[:-1]
74 +        f = line.split(' ')
75 +        size = int(f[0])
76 +        file = f[1]
77 +
78 +        cmdCount = 'catalogFile.sh /mnt/hadoop/cms' + lfn + \
79 +                   '/' + file + ' 2>/dev/null|tail -1|cut -d\' \' -f5'
80 +        #print ' COUNT: ' + cmdCount
81 +        nEvts = 0
82 +        for tmp in os.popen(cmdCount).readlines():
83 +            nEvts = tmp[:-1]
84 +
85 +        print '%s#00000000-0000-0000-0000-000000000000 %s/%s %s'%(dataset,lfn,file,nEvts)
86 +    sys.exit()
87 +
88   if not db:
89      # find relevant blocks
90      if   dbs == 'none':
91          cmd = 'dascli.py --query="block=' + dataset + '*" --limit=999999 --format=blocks'
92      elif dbs == '':
93 <        cmd = 'dbs search --query=\"find block where dataset=' + dataset + '\"'
93 >        cmd = 'dbs search --query=\"find block where dataset=*' + dataset + '\"'
94      elif re.search('http://',dbs):
95 <        cmd = 'dbs search --url=' + dbs + ' --query="find block where dataset=' + dataset + '"'
95 >        cmd = 'dbs search --url=' + dbs + ' --query="find block where dataset=*' + dataset + '"'
96      else:
97          cmd = 'echo ' + dataset + '#00000000-0000-0000-0000-000000000000'
98  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines