I am trying to run my analysis code in batch mode. I can run it fine locally, but when I try it with condor, I get this error:
Warning in <TInterpreter::ReadRootmapFile>: class edm4hep::ObjectID found in libedm4hepDict.so is already in libedm4drDict.so
Error in <TUnixSystem::FindDynamicLibrary>: libFCCAnalysesFlavour[.so | .dll | .dylib | .sl | .dl | .a] does not exist in /afs/cern.ch/user/h/helsens/FCCsoft/HEP-FCC/FCCeePhysicsPerformance/case-
studies/flavour/dataframe/install/lib:/cvmfs/sw.hsf.org/spackages5/py-awkward/1.4.0/x86_64-centos7-gcc11.2.0-opt/ee337/lib/python3.9/site-packages/awkward:/afs/cern.ch/user/h/helsens/FCCsoft/HEP-
FCC/FCCAnalyses/install/lib:/cvmfs/sw.hsf.org/spackages5/key4hep-stack/2022-03-30/x86_64-centos7-gcc11.2.0-opt/mrwoj/lib64:/cvmfs/sw.hsf.org/spackages5/key4hep-stack/2022-03-30/x86_64-centos7-gcc
11.2.0-opt/mrwoj/lib:/cvmfs/sw.hsf.org/spackages5/xgboost/1.5.2/x86_64-centos7-gcc11.2.0-opt/6ptqk/lib64:
...
#not copying the whole path, but let me know if you need it
Traceback (most recent call last):
File "/afs/cern.ch/work/j/jalimena/FCCeeLLP/FCCeePhysicsPerformance/case-studies/BSM/LLP/DisplacedHNL/analysis_general.py", line 21, in <module>
_HNL = ROOT.dummyLoaderFlavour #### Needed to fix undeclared selMC_leg()
File "/cvmfs/sw.hsf.org/spackages5/root/6.26.00/x86_64-centos7-gcc11.2.0-opt/jx56q/lib/ROOT/_facade.py", line 195, in _fallback_getattr
raise AttributeError("Failed to get attribute {} from ROOT".format(name))
AttributeError: Failed to get attribute dummyLoaderFlavour from ROOT
It seems to me that condor can’t find the libFCCAnalysesFlavour package, but when I run locally, it can find it just fine. How do I tell condor to load this package? Is there something I can do in my batch submission script?
this is very timely as I have just re-written all the procedure. For this you will have to use my branch and this will help me if you can give it a try:
Please note that the preSel.py has gone and things have been re-arranged for ease of use (at least I believe that is the case )
I have started to change the instructions, but they are not yet finalised, but they should help you getting started.
Please try to run locally some test samples before going on batch. In principle the ENV is sent to batch, thus if the PATH are locally working fine, they should also with batch (I tested this with my local FCCAnalyses, but not including an extra package as you do, thus I would be interested to see if it works out of the box)
Clement
yes, this is correct.
Please let me know (maybe on mattermost as it has nothing to do with this post) if instructions are understandable
EDIT:
I replied too quickly, what you should do in addition to compile FCCeePP linking the new FCCAnalyses is to make sure you have the ENV var well setup like here:
$ cd FCCAnalyses/examples/FCCee/higgs/mH-recoil/mumu
$ python /afs/cern.ch/work/j/jalimena/FCCeeLLP/FCCAnalyses/config/FCCAnalysisRun.py analysis_stage1_batch.py
Warning in <TInterpreter::ReadRootmapFile>: class edm4hep::ObjectID found in libedm4hepDict.so is already in libedm4drDict.so
----> Load cxx analyzers from libFCCAnalyses...
----> yaml file /afs/cern.ch/work/h/helsens/public/FCCDicts/yaml/FCCee/spring2021/IDEA/p8_ee_ZZ_ecm240/merge.yaml succesfully opened
----> Running process p8_ee_ZZ_ecm240 with fraction=1, output=p8_ee_ZZ_ecm240, chunks=20
----> Running on Batch
Traceback (most recent call last):
File "/afs/cern.ch/work/j/jalimena/FCCeeLLP/FCCAnalyses/config/FCCAnalysisRun.py", line 463, in <module>
sendToBatch(foo, chunkList, process, analysisFile)
File "/afs/cern.ch/work/j/jalimena/FCCeeLLP/FCCAnalyses/config/FCCAnalysisRun.py", line 230, in sendToBatch
localDir = os.environ["LOCAL_DIR"]
File "/cvmfs/sw.hsf.org/spackages5/python/3.9.10/x86_64-centos7-gcc11.2.0-opt/7j5vq/lib/python3.9/os.py", line 679, in __getitem__
raise KeyError(key) from None
KeyError: 'LOCAL_DIR'
I guess you meant to define a localDir instead of an outputDir in this file?
whoops yes i just saw this, my bad. your instructions are clear, I was just going too fast and missed this…
I was able to successfully convert my analysis.py into the new RDFanalysis version, ran it locally, and submitted it to batch. Batch jobs are idle now, I’ll let you know how it goes!
yeah, getting there. for some reason it didn’t quite work out of the box on my script, but it works when I explicitly set more of the event variables in the .sh scripts it generates. but I’ve got it a bit hard-coded now, I’m currently working on making it not hardcoded.
Please let me know what is needed in addition as I was able to run just fine yesterday.
thanks, this was a leftover from my tests such that files are properly copied back from batch to home dir when the output path is not absolute. Will remove them.
Thanks @clement.helsens . I’ve now tried everything I can think of in order to simply and generically modify your FCCAnalysisRun.py such that it works with my local versions of the necessary packages, but I can’t get it to work. Here is how I needed to hard-code it so that it works for me:
With this, I can successfully run batch jobs, submitting like this:
$ cd /afs/cern.ch/work/j/jalimena/FCCeeLLP/FCCAnalyses
$ source ./setup.sh
$ python config/FCCAnalysisRun.py ../FCCeePhysicsPerformance/case-studies/BSM/LLP/DisplacedHNL/rdfanalysis_general.py
My rdfanalysis_general.py is here:
Any ideas on how to make it work in a generic way? Let me know if I can provide you with anything else. If we can’t figure out how to make it work in a generic, then I guess maybe the best thing is to push your changes as you have them to the main branch, and I make these modifications locally for myself - better than nothing.
Thanks @jalimena , I think the only option we have is to have a set of base common commands in a config file and the possibility for users to pass a custom config file, such that the FCCAnalysisRun remains untouched by users.