Skip to content

Commit

Permalink
Merge pull request #7672 from ic-hep/confmychunk
Browse files Browse the repository at this point in the history
[8.0] Added configurable chunksize option to dirac_dms_replicate_and_r…
  • Loading branch information
fstagni authored Jun 25, 2024
2 parents 93ca768 + 7b83324 commit 4ff10ef
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()

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
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, chunksize)
multiRequests = len(lfnChunks) > 1

error = 0
Expand Down

0 comments on commit 4ff10ef

Please sign in to comment.