From e0cedc5f483261bc3a435f0e314d19c64f67e431 Mon Sep 17 00:00:00 2001 From: Daniela Bauer Date: Wed, 12 Jun 2024 14:52:14 +0100 Subject: [PATCH] feat: Added configurable chunksize option to dirac_dms_replicate_and_register_request script --- .../scripts/dirac_dms_replicate_and_register_request.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/DIRAC/DataManagementSystem/scripts/dirac_dms_replicate_and_register_request.py b/src/DIRAC/DataManagementSystem/scripts/dirac_dms_replicate_and_register_request.py index e0793ca96f0..eb1f34aaac8 100755 --- a/src/DIRAC/DataManagementSystem/scripts/dirac_dms_replicate_and_register_request.py +++ b/src/DIRAC/DataManagementSystem/scripts/dirac_dms_replicate_and_register_request.py @@ -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 @@ -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