Fixed MPI build with higher version of GCC (#14122)
authorTeng Li <tengli@fb.com>
Sat, 17 Nov 2018 02:02:13 +0000 (18:02 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Sat, 17 Nov 2018 02:53:24 +0000 (18:53 -0800)
Summary:
This appears as I enabled -Werror in c10d build. Good to catch this and fix it.

Should fix https://github.com/pytorch/pytorch/issues/14078 and https://github.com/pytorch/pytorch/issues/13962
Pull Request resolved: https://github.com/pytorch/pytorch/pull/14122

Differential Revision: D13110678

Pulled By: teng-li

fbshipit-source-id: f4c19e16976d65debbd33ed59e17ddbaa19f765a

.jenkins/pytorch/build.sh
torch/lib/c10d/ProcessGroupMPI.cpp

index e4381f4..72b8d4f 100755 (executable)
@@ -11,7 +11,7 @@ if [[ "$BUILD_ENVIRONMENT" == *-xenial-cuda9-* ]]; then
   sudo apt-get -qq install --allow-downgrades --allow-change-held-packages libnccl-dev=2.2.13-1+cuda9.0 libnccl2=2.2.13-1+cuda9.0
 fi
 
-if [[ "$BUILD_ENVIRONMENT" == *-xenial-cuda8-* ]] || [[ "$BUILD_ENVIRONMENT" == *-xenial-cuda9-cudnn7-py2* ]] || [[ "$BUILD_ENVIRONMENT" == *-trusty-py2.7.9* ]]; then
+if [[ "$BUILD_ENVIRONMENT" == *-xenial-cuda9*gcc7* ]] || [[ "$BUILD_ENVIRONMENT" == *-xenial-cuda8-* ]] || [[ "$BUILD_ENVIRONMENT" == *-xenial-cuda9-cudnn7-py2* ]] || [[ "$BUILD_ENVIRONMENT" == *-trusty-py2.7.9* ]]; then
   # TODO: move this to Docker
   sudo apt-get -qq update
   sudo apt-get -qq install --allow-downgrades --allow-change-held-packages openmpi-bin libopenmpi-dev
index 9277cd1..896dde4 100644 (file)
@@ -150,8 +150,11 @@ ProcessGroupMPI::AsyncWork::AsyncWork(
 
 ProcessGroupMPI::AsyncWork::~AsyncWork() {
   if (request_ != MPI_REQUEST_NULL) {
-    throw std::runtime_error(
-        "Attempted destruction of AsyncWork before work has completed");
+    std::cerr
+        << "Attempted destruction of AsyncWork before work has completed, "
+        << "terminating the program."
+        << std::endl;
+    std::terminate();
   }
 }