diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2017-05-31 13:54:32 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2017-05-31 13:58:20 -0700 |
commit | a980aead874f555d01bb410b84024831404a408b (patch) | |
tree | c0f8bcfce474d6fb435bb74032089d1791e2dd9b /tensorflow/tools/test | |
parent | 0a84cfd58821820ac6636effcd2135328a48a2e7 (diff) |
Use test_adjusted_name when making the mangled_test_name in
run_and_gather_logs_lib.py, to avoid duplicate file names when the same test is
run on multiple GPUs.
PiperOrigin-RevId: 157630193
Diffstat (limited to 'tensorflow/tools/test')
-rw-r--r-- | tensorflow/tools/test/run_and_gather_logs_lib.py | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/tensorflow/tools/test/run_and_gather_logs_lib.py b/tensorflow/tools/test/run_and_gather_logs_lib.py index e803d5cdac..570e09f165 100644 --- a/tensorflow/tools/test/run_and_gather_logs_lib.py +++ b/tensorflow/tools/test/run_and_gather_logs_lib.py @@ -131,8 +131,18 @@ def run_and_gather_logs(name, test_name, test_args, # Hopefully running in sandboxed mode test_executable = os.path.join(".", test_executable) + test_adjusted_name = name + gpu_config = gpu_info_lib.gather_gpu_devices() + if gpu_config: + gpu_name = gpu_config[0].model + gpu_short_name_match = re.search(r"Tesla [KP][4,8]0", gpu_name) + if gpu_short_name_match: + gpu_short_name = gpu_short_name_match.group(0) + test_adjusted_name = name + "|" + gpu_short_name.replace(" ", "_") + temp_directory = tempfile.mkdtemp(prefix="run_and_gather_logs") - mangled_test_name = name.strip("/").replace("/", "_").replace(":", "_") + mangled_test_name = (test_adjusted_name.strip("/") + .replace("|", "_").replace("/", "_").replace(":", "_")) test_file_prefix = os.path.join(temp_directory, mangled_test_name) test_file_prefix = "%s." % test_file_prefix @@ -151,15 +161,6 @@ def run_and_gather_logs(name, test_name, test_args, if not log_files: raise MissingLogsError("No log files found at %s." % test_file_prefix) - test_adjusted_name = name - gpu_config = gpu_info_lib.gather_gpu_devices() - if gpu_config: - gpu_name = gpu_config[0].model - gpu_short_name_match = re.search(r"Tesla [KP][4,8]0", gpu_name) - if gpu_short_name_match: - gpu_short_name = gpu_short_name_match.group(0) - test_adjusted_name = name + "|" + gpu_short_name.replace(" ", "_") - return (process_test_logs( test_adjusted_name, test_name=test_name, |