#!/usr/bin/env python # Copyright (c) 2010- The University of Notre Dame. # This software is distributed under the GNU General Public License. # See the file COPYING for details. import os, sys, random, time from prune import client from os.path import expanduser HOME = expanduser("~") prune = client.Connect(base_dir=HOME + '/.prune') #Prune data is stored in base_dir years = [3000, 3010] ############################### ########## STAGE 0 ########## ############################### print 'Stage 0' folder = './simulated_data/' f = [] for (dirpath, dirnames, filenames) in os.walk(folder): f.extend(filenames) break f.sort() normalized_data_keys = {} for year in years: normalized_data_keys[year] = []
#!/usr/bin/env cctools_python # CCTOOLS_PYTHON_VERSION 2.7 2.6 # Copyright (c) 2010- The University of Notre Dame. # This software is distributed under the GNU General Public License. # See the file COPYING for details. import os, sys, random, time from prune import client prune = client.Connect() years = [3000, 3010] ############################### ########## STAGE 0 ########## ############################### print 'Stage 0' folder = './simulated_data/' f = [] for (dirpath, dirnames, filenames) in os.walk(folder): f.extend(filenames) break f.sort() normalized_data_keys = {} for year in years: normalized_data_keys[year] = [] for fname in f: year = int(fname[0:4])
#!/usr/bin/env cctools_python # CCTOOLS_PYTHON_VERSION 2.7 2.6 # Copyright (c) 2010- The University of Notre Dame. # This software is distributed under the GNU General Public License. # See the file COPYING for details. from prune import client prune = client.Connect() #Connect to SQLite3 ###### Create common HEP environment ###### E1 = prune.envi_add(engine='umbrella', spec='cms.umbrella', cvmfs_http_proxy='http://cache01.hep.wisc.edu:3128', sandbox_mode='parrot', log='umbrella.log') #The value http://cache01.hep.wisc.edu:3128 is hard coded as the HTTP_PROXY #In future versions of Prune, this value will be configurable. event_count = 10 ###### Simulation stage ###### D1 = prune.file_add('simulate.sh') D2, = prune.task_add(returns=['SinglePi0E10_cfi_GEN_SIM.root'], env=E1, cmd='simulate.sh %i' % (event_count), args=[D1], params=['simulate.sh']) ###### Digitization stage ###### D3 = prune.file_add('digitize.sh')
#!/usr/bin/env python # Copyright (c) 2010- The University of Notre Dame. # This software is distributed under the GNU General Public License. # See the file COPYING for details. from prune import client import os prune = client.Connect(base_dir=os.environ["HOME"] + '/.prune') #Prune data is stored in base_dir ###### Create common HEP environment ###### E1 = prune.envi_add(engine='umbrella', spec='cms.umbrella', sandbox_mode='parrot', log='umbrella.log', cms_siteconf='SITECONF.tar.gz', cvmfs_http_proxy='http://eddie.crc.nd.edu:3128', http_proxy='http://eddie.crc.nd.edu:3128') event_count = 10 ###### Simulation stage ###### D1 = prune.file_add('simulate.sh') D2, = prune.task_add(returns=['SinglePi0E10_cfi_GEN_SIM.root'], env=E1, cmd='chmod 755 simulate.sh; ./simulate.sh %i ' % (event_count), args=[D1], params=['simulate.sh'])
#!/usr/bin/env python # Copyright (c) 2010- The University of Notre Dame. # This software is distributed under the GNU General Public License. # See the file COPYING for details. from prune import client import os #Prune data is stored in base_dir prune = client.Connect(base_dir=os.environ["HOME"] + '/.prune') ###### Import sources stage ###### # D1 and D2 are handlers for our input files D1 = prune.file_add('nouns.txt') D2 = prune.file_add('verbs.txt') # E1 is a handler for an environment specification. We will deal with # environments in a further example, and for now we simply use prune's nil E1 = prune.nil ###### Sort stage ###### # We define the first task, which sorts the file D1 (that is, nouns.txt) # In the command line, D1 is mapped to the parameter 'input.txt'. # The return value D3 represents the output file 'output.txt' D3, = prune.task_add(returns=['output.txt'], env=E1, cmd='/bin/sort input.txt > output.txt', args=[D1], params=['input.txt'])