diff options
author | Cedric Nugteren <web@cedricnugteren.nl> | 2017-12-20 19:14:04 +0100 |
---|---|---|
committer | Cedric Nugteren <web@cedricnugteren.nl> | 2017-12-20 19:14:04 +0100 |
commit | c6806662509575fd33de9f7d75f0d8df5f874473 (patch) | |
tree | 84a35ef29949a402074422e45b6e3d62c6999f52 | |
parent | e2f8068459579d4d094386d7d3215153e430cb25 (diff) |
Added try-except to database script parser to skip invalid files
-rw-r--r-- | CHANGELOG | 1 | ||||
-rwxr-xr-x | scripts/database/database.py | 20 |
2 files changed, 13 insertions, 8 deletions
@@ -4,6 +4,7 @@ Development (next version) - Made it possible to override the tuning parameters in the clients straight from JSON tuning files - Added OpenCL pre-processor to unroll loops and perform array-to-register promotions for compilers which don't do this themselves (ARM Mali) - greatly improves performance on these platforms +- Various minor fixes and enhancements - Added tuned parameters for various devices (see README) Version 1.2.0 diff --git a/scripts/database/database.py b/scripts/database/database.py index 28f6ebf8..57fbf74a 100755 --- a/scripts/database/database.py +++ b/scripts/database/database.py @@ -106,16 +106,20 @@ def main(argv): # Loops over all JSON files in the supplied folder for file_json in glob.glob(json_files): - - # Loads the newly imported data sys.stdout.write("[database] Processing '" + file_json + "' ") # No newline printed - imported_data = io.load_tuning_results(file_json) - # Adds the new data to the database - old_size = db.length(database) - database = db.add_section(database, imported_data) - new_size = db.length(database) - print("with " + str(new_size - old_size) + " new items") # Newline printed here + try: + # Loads the newly imported data + imported_data = io.load_tuning_results(file_json) + + # Adds the new data to the database + old_size = db.length(database) + database = db.add_section(database, imported_data) + new_size = db.length(database) + print("with " + str(new_size - old_size) + " new items") # Newline printed here + + except ValueError: + print("--- WARNING: invalid file, skipping") # Checks for tuning results with mis-matched entries remove_mismatched_arguments(database) |