|
|
|
@ -89,12 +89,11 @@ def getMatchingModelsInDir(dir, propertiesFile): |
|
|
|
# Get a list of properties in a directory, by searching for all files with an appropriate extension. |
|
|
|
# If a properties files "props.pctl" has a matching file "props.pctl.args", then the contents of this |
|
|
|
# are also appended. Multiple lines in the .args file results in multiple copies of the properties file. |
|
|
|
# Each item of the returned list is itself a list because the model specification may be in several parts, |
|
|
|
# Each item of the returned list is itself a list because the property specification may be in several parts, |
|
|
|
# e.g. ["props.pctl", "-const", "T=10"], but the first item is always the name of the properties file. |
|
|
|
|
|
|
|
def getPropertiesInDir(dir): |
|
|
|
propertiesFiles = [] |
|
|
|
# Otherwise look for all properties files |
|
|
|
for file in os.listdir(dir): |
|
|
|
if os.path.isfile(os.path.join(dir, file)) and isPrismPropertiesFile(file): |
|
|
|
propertiesFiles.append(os.path.join(dir, file)) |
|
|
|
@ -107,12 +106,11 @@ def getPropertiesInDir(dir): |
|
|
|
# Get a list of properties in a directory with prefix matching a model file name. |
|
|
|
# If a properties files "props.pctl" has a matching file "props.pctl.args", then the contents of this |
|
|
|
# are also appended. Multiple lines in the .args file results in multiple copies of the properties file. |
|
|
|
# Each item of the returned list is itself a list because the model specification may be in several parts, |
|
|
|
# Each item of the returned list is itself a list because the property specification may be in several parts, |
|
|
|
# e.g. ["props.pctl", "-const", "T=10"], but the first item is always the name of the properties file. |
|
|
|
|
|
|
|
def getMatchingPropertiesInDir(dir, modelFile): |
|
|
|
propertiesFiles = [] |
|
|
|
# Otherwise look for all properties files |
|
|
|
for file in os.listdir(dir): |
|
|
|
if os.path.isfile(os.path.join(dir, file)) and isPrismPropertiesFile(file): |
|
|
|
if os.path.basename(os.path.join(dir, file)).startswith(os.path.basename(modelFile)): |
|
|
|
@ -292,6 +290,7 @@ def benchmarkModelFile(modelFile): |
|
|
|
benchmark(modelFile + args) |
|
|
|
# Otherwise, find properties |
|
|
|
else: |
|
|
|
# Find and benchmark properties |
|
|
|
if options.matching: propertiesFiles = getMatchingPropertiesInDir(dir, modelFile[0]) |
|
|
|
else: propertiesFiles = getPropertiesInDir(dir) |
|
|
|
for propertiesFile in propertiesFiles: |
|
|
|
|