From bc8f512cf753500331ad7438abaebf02225e526c Mon Sep 17 00:00:00 2001 From: Dave Parker Date: Sat, 28 Mar 2020 16:32:02 +0000 Subject: [PATCH] prism-auto: --args-list option (command-line version of --args) Like --args , this allow a list of lists of arguments to be provided, with each element of the outer list representing a separate run of PRISM to be performed on all benchmarks. Here, these can be provided directly on the command-line, as a comma-separated list, rather than creating a file. For example: prism-auto ... --args-list '-gs,-jac,-jor -omega 0.9' --- prism/etc/scripts/prism-auto | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/prism/etc/scripts/prism-auto b/prism/etc/scripts/prism-auto index 18156910..8ca3d6eb 100755 --- a/prism/etc/scripts/prism-auto +++ b/prism/etc/scripts/prism-auto @@ -835,14 +835,23 @@ def benchmark(file, args, dir=""): modelFileArg = [file] if (file != "") else [] # Loop through benchmark options, if required + argsLists = [] + # May be specified in a file if options.bmFile: if not os.path.isfile(os.path.join(options.bmFile)): print("Cannot read arguments from non-existing file: " + os.path.join(options.bmFile)) sys.exit(1) - argsLists = getArgsListsFromFile(options.bmFile) + argsLists.extend(getArgsListsFromFile(options.bmFile)) + # And/or may be specified on the command line + if options.bmList: + for bmArgsString in options.bmList.split(','): + argsLists.append(bmArgsString.strip().split(' ')) + + # Now loop through benchmark options + if len(argsLists) > 0: for bmArgs in argsLists: runPrism(modelFileArg + args, bmArgs, dir) - # If none, just use existing args + # If none, just use existing args alone else: runPrism(modelFileArg + args, [], dir) @@ -1052,6 +1061,7 @@ signal.signal(signal.SIGINT, signal_handler) parser = OptionParser(usage="usage: %prog [options] args") parser.add_option("-l", "--log", dest="logDir", metavar="DIR", default="", help="Store PRISM output in logs in DIR") parser.add_option("-a", "--args", dest="bmFile", metavar="FILE", default="", help="Read argument lists for benchmarking from FILE") +parser.add_option("--args-list", dest="bmList", metavar="X", default="", help="Use X as argument lists for benchmarking (comma-separated)") parser.add_option("-e", "--echo", action="store_true", dest="echo", default=False, help="Just print out tasks, don't execute") parser.add_option("-m", "--matching", action="store_true", dest="matching", default=False, help="Only use matching models/properties, not all files") parser.add_option("-b", "--build", action="store_true", dest="build", default=False, help="Just build models, don't model check properties")