From 56f4eeeff71bf2f1a1f063b47d31cae971d7593e Mon Sep 17 00:00:00 2001 From: Daniela Bauer Date: Tue, 25 Jun 2024 16:46:39 +0200 Subject: [PATCH] =?UTF-8?q?sweep:=20#7672=20Added=20configurable=20chunksi?= =?UTF-8?q?ze=20option=20to=20dirac=5Fdms=5Freplicate=5Fand=5Fr=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../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..82bbf151897 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() + + chunksize = 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": + chunksize = 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, chunksize) multiRequests = len(lfnChunks) > 1 error = 0