diff options
author | 2018-09-13 15:15:23 -0700 | |
---|---|---|
committer | 2018-09-13 15:18:52 -0700 | |
commit | eb7953970c8b2b8a054cddf8ed4b78e66fcd2d02 (patch) | |
tree | 0742c239059166acf8ded8605a3f1a2740bf2afe /tensorflow | |
parent | fb50c8e9a3cb2ccfac9cf4a847d5841cba80b524 (diff) |
Fix parallel_gpu_execute.sh script on windows.
PiperOrigin-RevId: 212887532
Diffstat (limited to 'tensorflow')
-rwxr-xr-x | tensorflow/tools/ci_build/gpu_build/parallel_gpu_execute.sh | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/tensorflow/tools/ci_build/gpu_build/parallel_gpu_execute.sh b/tensorflow/tools/ci_build/gpu_build/parallel_gpu_execute.sh index 48b3989d86..03a2a07fb1 100755 --- a/tensorflow/tools/ci_build/gpu_build/parallel_gpu_execute.sh +++ b/tensorflow/tools/ci_build/gpu_build/parallel_gpu_execute.sh @@ -31,6 +31,28 @@ TF_TESTS_PER_GPU=${TF_TESTS_PER_GPU:-4} # future and to use a rounder number, we set it to 1G. export TF_PER_DEVICE_MEMORY_LIMIT_MB=1024 +# ******************************************************************* +# This section of the script is needed to +# make things work on windows under msys. +# ******************************************************************* +RUNFILES_MANIFEST_FILE="${TEST_SRCDIR}/MANIFEST" +function rlocation() { + if is_absolute "$1" ; then + # If the file path is already fully specified, simply return it. + echo "$1" + elif [[ -e "$TEST_SRCDIR/$1" ]]; then + # If the file exists in the $TEST_SRCDIR then just use it. + echo "$TEST_SRCDIR/$1" + elif [[ -e "$RUNFILES_MANIFEST_FILE" ]]; then + # If a runfiles manifest file exists then use it. + echo "$(grep "^$1 " "$RUNFILES_MANIFEST_FILE" | sed 's/[^ ]* //')" + fi +} + +TEST_BINARY="$(rlocation $TEST_WORKSPACE/${1#./})" +shift +# ******************************************************************* + mkdir -p /var/lock # Try to acquire any of the TF_GPU_COUNT * TF_TESTS_PER_GPU # slots to run a test at. @@ -46,8 +68,8 @@ for j in `seq 0 $((TF_TESTS_PER_GPU-1))`; do # This export only works within the brackets, so it is isolated to one # single command. export CUDA_VISIBLE_DEVICES=$i - echo "Running test $@ on GPU $CUDA_VISIBLE_DEVICES" - $@ + echo "Running test $TEST_BINARY $* on GPU $CUDA_VISIBLE_DEVICES" + "$TEST_BINARY" $@ ) return_code=$? flock -u "$lock_fd" |