Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.0] Added configurable chunksize option to dirac_dms_replicate_and_r… #7672

Merged
merged 1 commit into from
Jun 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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")
Copy link
Contributor

@andresailer andresailer Jun 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Script.registerSwitch("N:", "ChunkSize=", "Number of files per request")
Script.registerSwitch("N:", "ChnkSze=", "Number of files per request")

To not confuse it with line 36 and 37!

Edit: /s

# 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
Loading