User Tools

Site Tools


ganga:ganga

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
ganga:ganga [2012/08/01 17:04] – [Submitting a ROOT-job] decianmganga:ganga [2016/01/19 17:14] – [Bookkeeping information within Ganga] egraveri
Line 451: Line 451:
 </code> </code>
  
-  *Note: blabla+  *Note: Due to a weird bug (1.8.2012) 0 is not allowed as an argument... 
 +  *Note: When submitting a ROOT-job to the LSF, make sure the Ganga version in the shell you submit the ganga-job from and the one requested in ''j.application'' agree. You can set the ROOT version for Ganga in the shell with (for example): ''SetupProject Ganga v508r6 ROOT -v 5.34.00''
 ===== Forcing a job to run on a specific site ===== ===== Forcing a job to run on a specific site =====
 For this, do: For this, do:
Line 465: Line 466:
 dirac-proxy-init -g lhcb_user dirac-proxy-init -g lhcb_user
 </code> </code>
 +
 +===== Bookkeeping information within Ganga =====
 +A simple method that can be added to the ~/.ganga.py to access information directly from the BK can be seen below:
 +
 +<code python>
 +def getBKInfo ( evttype )  :
 +    from subprocess import Popen, PIPE
 +
 +    serr = open ( '/dev/null' )
 +    pipe = Popen ( [ 'get_bookkeeping_info'  , str(evttype) ] ,
 +                   env    = os.environ ,
 +                   stdout = PIPE       ,
 +                   stderr = serr       )
 +            
 +    stdout = pipe.stdout
 +    ts = {} 
 +    result = {} 
 +        
 +    for line in stdout :
 +    
 +        try :
 +            value = eval ( line )
 +        except :
 +            continue
 +            
 +        if not isinstance ( value    , tuple ) : continue
 +        if not isinstance ( value[0] , str   ) : continue
 +        if not isinstance ( value[1] , str   ) : continue
 +        if not isinstance ( value[2] , str   ) : continue
 +
 +        if result.has_key ( value[0] ) : continue
 +        result [ value[0] ] = value[1:]
 +
 +    return result
 +</code>
 +
 +In this case two additional files 'get_bookkeeping_info' and 'dirac-bookkeeping-get-prodinfo-eventtype.py' are required to be saved locally in your ~/bin/ directory. 
 +
 +More info can be found here: [[https://groups.cern.ch/group/lhcb-bender/Lists/Archive/DispForm.aspx?ID=551]]
  
 ===== Help ===== ===== Help =====
Line 478: Line 518:
 ===== Links ===== ===== Links =====
 Information for using ganga in LHCb (and where I stole most of the information from): [[http://ganga.web.cern.ch/ganga/user/html/LHCb/]] Information for using ganga in LHCb (and where I stole most of the information from): [[http://ganga.web.cern.ch/ganga/user/html/LHCb/]]
- 
ganga/ganga.txt · Last modified: 2017/01/12 12:31 by bernet