Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-10 08:39:00

0001 from pandajedi.jedicore.JediTaskBufferInterface import JediTaskBufferInterface
0002 
0003 # Set up the task buffer interface
0004 tb_if = JediTaskBufferInterface()
0005 tb_if.setupInterface()
0006 
0007 # Get the site mapper
0008 site_mapper = tb_if.get_site_mapper()
0009 
0010 # Define a random site of panda sites
0011 panda_sites = [
0012     "ANALY_DESY-HH",
0013     "ANALY_DESY-HH_TEST",
0014     "WT2_Install",
0015     "BNL_Test_2_CE_1",
0016     "ANALY_IN2P3-CC-T2_RD",
0017     "UKI-SOUTHGRID-OX-HEP_SL6",
0018     "RU-Protvino-IHEP",
0019     "ANALY_NICS_Kraken",
0020     "ANALY_TRIUMF_HIMEM",
0021     "TESTGLEXEC",
0022     "ANALY_GRIF-LPNHE",
0023     "UKI-SCOTGRID-GLASGOW_MCORE",
0024     "BNL_PROD",
0025     "RAL-LCG2_SL6",
0026 ]
0027 
0028 # Test the getSiteInputStorageEndpointMap function
0029 # print tb_if.getSiteInputStorageEndpointMap(panda_sites, site_mapper)
0030 
0031 # for panda_site in panda_sites:
0032 #     print panda_site
0033 #     tmp_site_spec = site_mapper.getSite('ANALY_DESY-HH')
0034 #     print '------------------- ddm -------------------'
0035 #     print 'ddm_input: {0}, ddm_output: {1}'.format(tmp_site_spec.ddm_input, tmp_site_spec.ddm_output)
0036 #     print '------------------- setokens values -------------------'
0037 #     print 'setokens_input: {0}, setokens_output: {1}'.format(tmp_site_spec.setokens_input.values(),
0038 #                                                              tmp_site_spec.setokens_output.values())
0039 #     print '------------------- setokens -------------------'
0040 #     print 'setokens_input: {0}, setokens_output: {1}'.format(tmp_site_spec.setokens_input,
0041 #                                                              tmp_site_spec.setokens_output)
0042 
0043 from pandaserver.dataservice import DataServiceUtils  # noqa: E402
0044 
0045 sites = sorted(site_mapper.getCloud("WORLD")["sites"])
0046 for tmp_site_name in sites:
0047     print(f"tmp_site_name: {tmp_site_name}")
0048 
0049     tmp_site_spec = site_mapper.getSite(tmp_site_name)
0050 
0051     # print 'tmp_site_spec.ddm_input: {0}'.format(tmp_site_spec.ddm_input)
0052     # print 'tmp_site_spec.setokens_input: {0}'.format(tmp_site_spec.setokens_input.values())
0053     # print 'combination: {0}'.format([tmp_site_spec.ddm_input] + tmp_site_spec.setokens_input.values())
0054 
0055     for tmp_ddm_endpoint in [tmp_site_spec.ddm_input] + list(tmp_site_spec.setokens_input.values()):
0056         try:
0057             tmp_prefix = DataServiceUtils.getDQ2Prefix(tmp_ddm_endpoint)
0058             print(f"prefix: {tmp_prefix}")
0059         except TypeError:
0060             print("excepted!")
0061 
0062     print("-------------------")