Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-19 08:00:05

0001 import sys
0002 import time
0003 
0004 from pandaharvester.harvestercore.job_spec import JobSpec
0005 from pandaharvester.harvestercore.plugin_factory import PluginFactory
0006 from pandaharvester.harvestercore.queue_config_mapper import QueueConfigMapper
0007 
0008 queueName = sys.argv[1]
0009 
0010 queueConfigMapper = QueueConfigMapper()
0011 
0012 queueConfig = queueConfigMapper.get_queue(queueName)
0013 
0014 jobSpec = JobSpec()
0015 jobSpec.jobParams = {
0016     "inFiles": "DAOD_STDM4.09596175._000008.pool.root.1",
0017     "scopeIn": "mc15_13TeV",
0018     "fsize": "658906675",
0019     "GUID": "7e3776f9bb0af341b03e59d3de895a13",
0020     "checksum": "ad:3734bdd9",
0021     "ddmEndPointIn": "BNL-OSG2_DATADISK",
0022     "realDatasetsIn": "mc15_13TeV.363638.MGPy8EG_N30NLO_Wmunu_Ht500_700_BFilter.merge.DAOD_STDM4.e4944_s2726_r7772_r7676_p2842_tid09596175_00",
0023 }
0024 jobSpec.computingSite = queueName
0025 
0026 
0027 pluginFactory = PluginFactory()
0028 
0029 # get plugin
0030 preparatorCore = pluginFactory.get_plugin(queueConfig.preparator)
0031 print(f"plugin={preparatorCore.__class__.__name__}")
0032 
0033 print("testing stagein:")
0034 print(f"BasePath from preparator configuration: {preparatorCore.basePath} ")
0035 preparatorCore.basePath = preparatorCore.basePath + "/testdata/"
0036 print(f"basePath redifuned for test data: {preparatorCore.basePath} ")
0037 
0038 tmpStat, tmpOut = preparatorCore.trigger_preparation(jobSpec)
0039 if tmpStat:
0040     print(" OK")
0041 else:
0042     print(f" NG {tmpOut}")
0043 
0044 print
0045 
0046 print("testing status check")
0047 while True:
0048     tmpStat, tmpOut = preparatorCore.check_stage_in_status(jobSpec)
0049     if tmpStat is True:
0050         print(" OK")
0051         break
0052     elif tmpStat is False:
0053         print(f" NG {tmpOut}")
0054         sys.exit(1)
0055     else:
0056         print(" still running. sleep 1 min")
0057         time.sleep(60)
0058 
0059 print
0060 
0061 print("checking path resolution")
0062 tmpStat, tmpOut = preparatorCore.resolve_input_paths(jobSpec)
0063 if tmpStat:
0064     print(f" OK {jobSpec.jobParams['inFilePaths']}")
0065 else:
0066     print(f" NG {tmpOut}")