#Originally taken from https://twiki.cern.ch/twiki/bin/view/Atlas/GangaTutorial427
#New page now at: https://twiki.cern.ch/twiki/bin/view/Atlas/GangaTutorial43
# In cambridge, just alias ganga to /usera/brochu/Ganga/install/4.3.1/bin/ganga and set minimal ~/.gangarc file
# Start ganga with "ganga --gui" or just plain "ganga" depending on what you want.
lesterDataset="csc11.005186.PythiaZmumu_pt100.recon.AOD.v11004103"
lesterDataset="csc11.005186.PythiaZmumu_pt100.evgen.EVNT.v11004103"
lesterDataset="mc12.005144.PythiaZee.evgen.EVNT.v12000604"
# optionally to see where the files are:
d=DQ2Dataset(dataset=lesterDataset)
d.list_locations_num_files()
j = Job()
j.name='ForFrostJobOptions-Job'
j.application=Athena()
j.application.prepare(athena_compile=False) # False means COMPILE LOCALLY, True means COMPILE REMOTELY
j.application.option_file='/atlas/lester/12.0.4/hack/ForFrostJobOptions.py'
j.application.max_events='12'
j.splitter=AthenaSplitterJob()
j.splitter.numsubjobs=3
j.merger=AthenaOutputMerger()
j.inputdata=DQ2Dataset()
# j.inputdata.dataset="csc11.006355.AcerMCttZnunu.evgen.EVNT.v12000502" # FAILED
# j.inputdata.dataset="csc11.005403.SU3_jimmy_susy.evgen.EVNT.v11000401" # FAILED
#j.inputdata.dataset="trig1_misal1_csc11.005403.SU3_jimmy_susy.recon.AOD.v12000503" # Not EVGEN but least job is sent to (useless) data
j.inputdata.dataset=lesterDataset
j.inputdata.type='DQ2_LOCAL'
j.outputdata=ATLASOutputDataset()
j.outputdata.outputdata=['AnalysisSkeleton.aan.root']
j.backend=LCG()
# j.backend.CE='ce102.cern.ch:2119/jobmanager-lcglsf-grid_2nh_atlas'
#Lyon and FZK are using dCache
# j.inputsandbox=['/afs/cern.ch/sw/lcg/external/root/5.10.00d/slc3_ia32_gcc323/root/lib/libDCache.so']
# j.backend.CE='ce-fzk.gridka.de:2119/jobmanager-pbspro-atlasS' # NOT Job2Data !!
# j.backend.CE='cclcgceli02.in2p3.fr:2119/jobmanager-bqs-short' # NOT Job2Data !!
#j.inputdata.match_ce=True # Used to do JOB TO DATA .. seems tono longer be there .. trying the suggestion below instead
#j.inputdata.match_ce_all=True # Does JOB TO DATA
# Job to complete datasets is now default
#j.inputdata.min_num_files=1 # Says "run even if there is only 1 file out of the desired number of files in the dataset sitting at the remote location. Useful if datasets are incomplete.
# TO search for data and compute elements:
j.inputdata.list_locations()
j.inputdata.list_locations_ce()
j.submit()
- The name of the AOD dataset must be supplied. You can search for datasets using the dq2_ls command-line tool or the web page.
- If you don't know which specific CE you want the job to run on, you must set
j.inputdata.match_ce_all=True
- If the AOD dataset is not registered as COMPLETE somewhere on DQ2, set
j.inputdata.min_num_files=0
so that the Resource Broker will also consider sites where the dataset is registered INCOMPLETE (and where it is quite likely that the whole dataset is actually present, just not yet registered as COMPLETE)
----------------------------
In [26]:print(j)
Job (
status = 'new' ,
name = 'ForFrostJobOptions-Job' ,
inputdir = '/usera/lester/gangadir/workspace/Local/20/input/' ,
outputdir = '/usera/lester/gangadir/workspace/Local/20/output/' ,
outputsandbox = [] ,
id = 20 ,
inputdata = DQ2Dataset (
tagdataset = '' ,
type = 'DQ2_LOCAL' ,
names = [] ,
match_ce = True ,
dataset = 'csc11.006368.ZAAnunu_madgraph.evgen.log.v12000502'
) ,
merger = AthenaOutputMerger (
subjobs = [] ,
sum_outputdir = ''
) ,
inputsandbox = [ ] ,
application = Athena (
atlas_release = '12.0.4' ,
max_events = '12' ,
options = None ,
user_setupfile = File (
name = '' ,
subdir = '.'
) ,
option_file = File (
name = '/atlas/lester/12.0.4/hack/ForFrostJobOptions.py' ,
subdir = '.'
) ,
user_area = File (
name = '/usera/lester/gangadir/workspace/Local/cmt_standalone-00001.tar.gz' ,
subdir = '.'
)
) ,
outputdata = ATLASOutputDataset (
output = [] ,
local_location = '' ,
outputdata = ['AnalysisSkeleton.aan.root'] ,
location = ''
) ,
splitter = AthenaSplitterJob (
numsubjobs = 3
) ,
subjobs = [ ] ,
backend = LCG (
status = None ,
actualCE = None ,
middleware = 'EDG' ,
CE = None ,
reason = None ,
id = None ,
jobtype = 'Normal' ,
exitcode = None ,
requirements = LCGRequirements (
nodenumber = 1 ,
ipconnectivity = False ,
cputime = None ,
other = [] ,
memory = None ,
software = [] ,
walltime = None
)
)
)
--------------------------------------------------
In [28]:j.submit()
Ganga.GPIDev.Lib.Job : INFO submitting job 20
GangaAtlas.Lib.ATLASDataset : ERROR 512, curl: unknown option --get.
curl: try 'curl --help' for more information
GangaAtlas.Lib.ATLASDataset : ERROR Could not retrieve datasets csc11.006368.ZAAnunu_madgraph.evgen.log.v12000502
GangaAtlas.Lib.ATLASDataset : WARNING Dataset csc11.006368.ZAAnunu_madgraph.evgen.log.v12000502 not found
GangaAtlas.Lib.ATLASDataset : ERROR 512, curl: unknown option --get.
curl: try 'curl --help' for more information
GangaAtlas.Lib.ATLASDataset : ERROR Could not retrieve datasets csc11.006368.ZAAnunu_madgraph.evgen.log.v12000502
GangaAtlas.Lib.ATLASDataset : ERROR No datasets found.
GangaAtlas.Lib.ATLASDataset : ERROR 512, curl: unknown option --get.
curl: try 'curl --help' for more information
GangaAtlas.Lib.ATLASDataset : ERROR Could not retrieve datasets csc11.006368.ZAAnunu_madgraph.evgen.log.v12000502
GangaAtlas.Lib.ATLASDataset : ERROR No datasets found.
512 curl: unknown option --get.
curl: try 'curl --help' for more information
Ganga.Utility.logging : WARNING ---------- error in user/extension code ----------
Ganga.Utility.logging : WARNING Traceback (most recent call last):
Ganga.Utility.logging : WARNING File "/afs/cern.ch/sw/ganga/install/slc3_gcc323/4.2.11/python/Ganga/Core/JobManager/JobManager.py", line 80, in submit
Ganga.Utility.logging : WARNING jobmasterconfig = rtHandler.master_prepare(masterjob.application,appmasterconfig)
Ganga.Utility.logging : WARNING File "/afs/cern.ch/sw/ganga/install/slc3_gcc323/4.2.11/python/GangaAtlas/Lib/Athena/AthenaLCGRTHandler.py", line 297, in master_prepare
Ganga.Utility.logging : WARNING ces = job.inputdata.list_locations_ce(datasetname,quiet=True)
Ganga.Utility.logging : WARNING File "/afs/cern.ch/sw/ganga/install/slc3_gcc323/4.2.11/python/GangaAtlas/Lib/ATLASDataset/DQ2Dataset.py", line 368, in list_locations_c
e
Ganga.Utility.logging : WARNING tiersofatlas = getTiersOfATLASCache()
Ganga.Utility.logging : WARNING File "/afs/cern.ch/sw/ganga/install/slc3_gcc323/4.2.11/python/GangaAtlas/Lib/ATLASDataset/DQ2Dataset.py", line 245, in getTiersOfATLASC
ache
Ganga.Utility.logging : WARNING raise Exception('Failed to download TiersOfATLASCache.py')
Ganga.Utility.logging : WARNING Exception: Failed to download TiersOfATLASCache.py
Ganga.Utility.logging : WARNING --------------------------------------------------
Ganga.GPIDev.Lib.Job : WARNING Failed to submit job, Failed to download TiersOfATLASCache.py
Ganga.GPIDev.Lib.Job : WARNING got exception while trying to submit [ Failed to download TiersOfATLASCache.py ]...reverting to the new status
Ganga.Utility.logging : WARNING ---------- error in user/extension code ----------
Ganga.Utility.logging : WARNING Traceback (most recent call last):
Ganga.Utility.logging : WARNING File "/afs/cern.ch/sw/ganga/install/slc3_gcc323/4.2.11/python/Ganga/GPIDev/Lib/Job/Job.py", line 561, in submit
Ganga.Utility.logging : WARNING self.status = jobmgr.submit(self,rjobs,appconfig)
Ganga.Utility.logging : WARNING File "/afs/cern.ch/sw/ganga/install/slc3_gcc323/4.2.11/python/Ganga/Core/JobManager/JobManager.py", line 105, in submit
Ganga.Utility.logging : WARNING raise JobManagerError(x)
Ganga.Utility.logging : WARNING JobManagerError: Failed to download TiersOfATLASCache.py
Ganga.Utility.logging : WARNING --------------------------------------------------
Ganga.GPIDev.Lib.Job : INFO job 20 status changed to "new"
Out[28]: 0
In [29]:
----------------------------------------------
removed local curl installation and replaced with default /usr/bin/curl
--------------------------------------
In [31]:j.submit()
Ganga.GPIDev.Lib.Job : INFO submitting job 20
Ganga.Utility.logging : WARNING ---------- error in user/extension code ----------
Ganga.Utility.logging : WARNING Traceback (most recent call last):
Ganga.Utility.logging : WARNING File "/afs/cern.ch/sw/ganga/install/slc3_gcc323/4.2.11/python/Ganga/Core/JobManager/JobManager.py", line 80, in submit
Ganga.Utility.logging : WARNING jobmasterconfig = rtHandler.master_prepare(masterjob.application,appmasterconfig)
Ganga.Utility.logging : WARNING File "/afs/cern.ch/sw/ganga/install/slc3_gcc323/4.2.11/python/GangaAtlas/Lib/Athena/AthenaLCGRTHandler.py", line 299, in master_prepare
Ganga.Utility.logging : WARNING raise ConfigError("DQ2 returned no dataset location - unable to submit the job to a appropriate CE.")
Ganga.Utility.logging : WARNING ConfigError: DQ2 returned no dataset location - unable to submit the job to a appropriate CE.
Ganga.Utility.logging : WARNING --------------------------------------------------
Ganga.GPIDev.Lib.Job : WARNING Failed to submit job, DQ2 returned no dataset location - unable to submit the job to a appropriate CE.
Ganga.GPIDev.Lib.Job : WARNING got exception while trying to submit [ DQ2 returned no dataset location - unable to submit the job to a appropriate CE. ]...reverting to the new status
Ganga.Utility.logging : WARNING ---------- error in user/extension code ----------
Ganga.Utility.logging : WARNING Traceback (most recent call last):
Ganga.Utility.logging : WARNING File "/afs/cern.ch/sw/ganga/install/slc3_gcc323/4.2.11/python/Ganga/GPIDev/Lib/Job/Job.py", line 561, in submit
Ganga.Utility.logging : WARNING self.status = jobmgr.submit(self,rjobs,appconfig)
Ganga.Utility.logging : WARNING File "/afs/cern.ch/sw/ganga/install/slc3_gcc323/4.2.11/python/Ganga/Core/JobManager/JobManager.py", line 105, in submit
Ganga.Utility.logging : WARNING raise JobManagerError(x)
Ganga.Utility.logging : WARNING JobManagerError: DQ2 returned no dataset location - unable to submit the job to a appropriate CE.
Ganga.Utility.logging : WARNING --------------------------------------------------
Ganga.GPIDev.Lib.Job : INFO job 20 status changed to "new"
Out[31]: 0
In [32]:
-----------------------------------------------------------------
In [57]:j.inputdata.dataset="trig1_misal1_csc11.005403.SU3_jimmy_susy.recon.AOD.v12000503"
In [58]:j.inputdata.list_locations()
Out[58]: ['ASGCDISK', 'BNLPANDA', 'CERNCAF', 'CNAFDISK', 'FZKDISK', 'FZKTAPE', 'LYONDISK', 'NDGFDISK', 'NIKHEF', 'PICDISK', 'RALDISK', 'TRIUMFDISK']
In [59]:j.inputdata.list_locations_ce()
Out[59]: ['lcgce01.triumf.ca', 'ce03-lcg.cr.cnaf.infn.it', 'ce01-lcg.cr.cnaf.infn.it', 'cclcgceli02.in2p3.fr', 'cclcgceli02.in2p3.fr', 'ce101.cern.ch', 'ce102.cern.ch', 'ce105.cern.ch', 'ce106.cern.ch', 'tbn20.nikhef.nl', 'lcg00125.grid.sinica.edu.tw', 'lcgce01.gridpp.rl.ac.uk', 'ce-fzk.gridka.de', 'ce04.pic.es', 'ce04.pic.es']
In [60]:
In [60]:j.submit()
Ganga.GPIDev.Lib.Job : INFO submitting job 20
Ganga.GPIDev.Adapters : INFO submitting job 20.0 to LCG backend
Ganga.GPIDev.Lib.Job : INFO job 20.0 status changed to "submitted"
Ganga.GPIDev.Adapters : INFO submitting job 20.1 to LCG backend
Ganga.GPIDev.Lib.Job : INFO job 20.1 status changed to "submitted"
Ganga.GPIDev.Adapters : INFO submitting job 20.2 to LCG backend
Ganga.GPIDev.Lib.Job : INFO job 20.2 status changed to "submitted"
Out[60]: 1
In [61]:
Ganga.GPIDev.Lib.Job : INFO job 20.0 status changed to "running"
Ganga.GPIDev.Lib.Job : INFO job 20.2 status changed to "running"
Ganga.GPIDev.Lib.Job : INFO job 20.0 status changed to "completing"
Ganga.GPIDev.Lib.Job : INFO job 20.0 status changed to "completed"
Ganga.GPIDev.Lib.Job : INFO job 20.2 status changed to "completing"
Ganga.GPIDev.Lib.Job : INFO job 20.2 status changed to "completed"
Ganga.GPIDev.Lib.Job : INFO job 20.1 status changed to "running"
Ganga.GPIDev.Lib.Job : INFO job 20 status changed to "running"
In [61]:
In [61]:jobs
Out[61]: Statistics: 9 jobs
--------------
# id status name subjobs application backend backend.actualCE
# 1 failed Executable LCG serv03.hep.phy.cam.ac.uk:2119/jobmanager-lcgc
# 5 completed Test Template Executable LCG serv03.hep.phy.cam.ac.uk:2119/jobmanager-lcgc
# 7 failed Test Template Executable LCG serv03.hep.phy.cam.ac.uk:2119/jobmanager-lcgc
# 10 failed Test Template Executable LCG serv03.hep.phy.cam.ac.uk:2119/jobmanager-lcgc
# 11 completed Test Template Executable LCG serv03.hep.phy.cam.ac.uk:2119/jobmanager-lcgc
# 16 failed Test Template Executable LCG serv03.hep.phy.cam.ac.uk:2119/jobmanager-lcgc
# 18 completed Executable LCG ce06.pic.es:2119/jobmanager-lcgpbs-atlas
# 19 new Executable LCG
# 20 running ForFrostJobOptions-Job 3 Athena LCG
----------------------------------------------------------------