Skip to content

Commit

Permalink
feat: Added configurable chunksize option to dirac_dms_replicate_and_…
Browse files Browse the repository at this point in the history
…register_request script
  • Loading branch information
marianne013 committed Jun 12, 2024
1 parent 2af7871 commit e0cedc5
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,19 @@ def getLFNList(arg):
def main():
catalog = None
Script.registerSwitch("C:", "Catalog=", "Catalog to use")
Script.registerSwitch("N:", "ChunkSize=", "Number of files per request")
# Registering arguments will automatically add their description to the help menu
Script.registerArgument(" requestName: a request name")
Script.registerArgument(" LFNs: single LFN or file with LFNs")
Script.registerArgument(["targetSE: target SE"])
Script.parseCommandLine()

chnksize = 100
for switch in Script.getUnprocessedSwitches():
if switch[0] == "C" or switch[0].lower() == "catalog":
catalog = switch[1]

if switch[0] == "N" or switch[0].lower() == "chunksize":
chnksize = int(switch[1])
args = Script.getPositionalArgs()

requestName = None
Expand All @@ -54,7 +58,7 @@ def main():
from DIRAC.Resources.Catalog.FileCatalog import FileCatalog
from DIRAC.Core.Utilities.List import breakListIntoChunks

lfnChunks = breakListIntoChunks(lfnList, 100)
lfnChunks = breakListIntoChunks(lfnList, chnksize)
multiRequests = len(lfnChunks) > 1

error = 0
Expand Down

0 comments on commit e0cedc5

Please sign in to comment.