Skip to content

Commit

Permalink
Merge pull request #33 from tmaeno/master
Browse files Browse the repository at this point in the history
added --useNumFilesInSecDSsAsRatio to prun
  • Loading branch information
tmaeno authored Jul 30, 2024
2 parents 8b0b311 + 3a6a830 commit 54b6926
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 6 deletions.
7 changes: 7 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
** Release Notes

1.5.77
* added --useNumFilesInSecDSsAsRatio to prun

1.5.76
* For changes in ALRB_USER_PLATFORM
* execute_pchain in panda_api.py

1.5.75
* warning message for missing nickname in IAM

Expand Down
9 changes: 5 additions & 4 deletions pandaclient/MiscUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,10 @@ def makeJediJobParam(
elif outDS:
dictItem["consolidate"] = ".".join(outDS.split(".")[:2]) + "." + wrappedUuidGen() + "/"
if nFilesPerJob not in [None, 0]:
dictItem["nFilesPerJob"] = nFilesPerJob
if useNumFilesAsRatio and nFilesPerJob not in [None, 0]:
dictItem["ratio"] = nFilesPerJob
if useNumFilesAsRatio:
dictItem["ratio"] = nFilesPerJob
else:
dictItem["nFilesPerJob"] = nFilesPerJob
if file_list:
dictItem["files"] = file_list
if hidden:
Expand Down Expand Up @@ -324,7 +325,7 @@ def parse_secondary_datasets_opt(secondaryDSs):
if l:
tmpMap[tmpItems[2]]["files"].append(l)
else:
errStr = "Wrong format %s in --secondaryDSs. Must be " "StreamName:nFilesPerJob:DatasetName[:Pattern[:nSkipFiles[:FileNameList]]]" % tmpItem
errStr = "Wrong format %s in --secondaryDSs. Must be " "StreamName:nFiles:DatasetName[:Pattern[:nSkipFiles[:FileNameList]]]" % tmpItem
return False, errStr
# set
secondaryDSs = tmpMap
Expand Down
2 changes: 1 addition & 1 deletion pandaclient/PandaToolsPkgInfo.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
release_version = "1.5.76"
release_version = "1.5.77"
17 changes: 16 additions & 1 deletion pandaclient/PrunScript.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,13 @@ def main(get_taskparams=False, ext_args=None, dry_mode=False):
action="store",
dest="secondaryDSs",
default="",
help="List of secondary datasets when the job requires multiple inputs. See PandaRun wiki page for detail",
help="List of secondary datasets when the job requires multiple inputs. "
"Comma-separated strings in the format of StreamName:nFiles:DatasetName[:Pattern[:nSkipFiles[:FileNameList]]]. "
"StreamName is the stream name used in --exec to expand to actual filenames. "
"nFiles is the number of files per job by default, while it means the ratio to the number of primary "
"files when --useNumFilesInSecDSsAsRatio is set. DatasetName is the dataset name. "
"Pattern is used to filter files in the dataset. nSkipFiles is the number of files to skip in the dataset. "
"FileNameList is a file listing names of files to be used in the dataset. ",
)
group_input.add_argument(
"--reusableSecondary",
Expand All @@ -387,6 +393,14 @@ def main(get_taskparams=False, ext_args=None, dry_mode=False):
default="",
help="A comma-separated list of secondary streams which reuse files when all files are used",
)
group_input.add_argument(
"--useNumFilesInSecDSsAsRatio",
action="store_const",
const=True,
dest="useNumFilesInSecDSsAsRatio",
default=False,
help="Set the option when the nFiles field in --secondaryDSs means the ratio to the number of primary files",
)
group_submit.add_argument(
"--site",
action="store",
Expand Down Expand Up @@ -2509,6 +2523,7 @@ def _onExit(dir, files, del_command):
include=tmpMap["pattern"],
offset=tmpMap["nSkip"],
nFilesPerJob=tmpMap["nFiles"],
useNumFilesAsRatio=options.useNumFilesInSecDSsAsRatio,
reusableAtt=reusableAtt,
outDS=options.outDS,
file_list=tmpMap["files"],
Expand Down

0 comments on commit 54b6926

Please sign in to comment.