Skip to content

Commit

Permalink
add single file access mode via xrootd
Browse files Browse the repository at this point in the history
  • Loading branch information
piperov committed Feb 28, 2024
1 parent 78f79c5 commit 423c5aa
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
5 changes: 5 additions & 0 deletions af_benchmark/data_access/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ def get_file_list(cls):
xrootdserver = cls.config.get('data-access.xrootdserver', 'eos.cms.rcac.purdue.edu:1094')
dbs = DbsApi('https://cmsweb.cern.ch/dbs/prod/global/DBSReader')
file_list = ["root://"+xrootdserver+"/"+file['logical_file_name'] for file in dbs.listFiles(block_name=dbsblock)]
elif mode == 'dbs_file':
dbsfile = cls.config.get('data-access.file', "")
xrootdserver = cls.config.get('data-access.xrootdserver', 'cms-xcache.rcac.purdue.edu:1094')
dbs = DbsApi('https://cmsweb.cern.ch/dbs/prod/global/DBSReader')
file_list = ["root://"+xrootdserver+"/"+dbsfile]
else:
raise NotImplementedError(
f"Data access modes other than 'local' and 'local_dir' are not yet implemented"
Expand Down
12 changes: 12 additions & 0 deletions af_benchmark/example-configs/example-config-dbs-file.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
executor:
backend: sequential
data-access:
mode: dbs_file
# xrootdserver: eos.cms.rcac.purdue.edu:1094
xrootdserver: cms-xcache.rcac.purdue.edu:1094
# xrootdserver: cmsxrootd.hep.wisc.edu:1094
file: /store/data/Run2016B/SingleMuon/NANOAOD/02Apr2020_ver2-v1/20000/90322FC2-4027-0E47-92E4-22307EC8EAD2.root
processor:
parallelize_over: files
columns: 5
operation: sum
7 changes: 6 additions & 1 deletion af_benchmark/executor/sequential.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ def _execute(self, func, args, **kwargs):
:meta public:
"""
first = [func(arg, **kwargs) for arg in args]
return [func(arg, **kwargs) for arg in args]

print(first)
second=2
print(second)

def get_n_workers(self):
return 1
return 1

0 comments on commit 423c5aa

Please sign in to comment.