Build Failure with NVCC and OpenMP enabled
Created by: crtrott
There seems to be a bug present in Cuda 7.5 (and 8) which makes the build fail when enabling OpenMP as well. Adding some extra brackets fixes that:
diff --git a/packages/zoltan2/src/algorithms/partition/Zoltan2_AlgMultiJagged.hpp b/packages/zoltan2/src/algorithms/partition/Zoltan2_AlgMultiJagged.hpp
index 4ce5a56..9fa413e 100644
--- a/packages/zoltan2/src/algorithms/partition/Zoltan2_AlgMultiJagged.hpp
+++ b/packages/zoltan2/src/algorithms/partition/Zoltan2_AlgMultiJagged.hpp
@@ -2902,6 +2902,7 @@ void AlgMJ<mj_scalar_t, mj_lno_t, mj_gno_t, mj_part_t>::mj_1D_part(
}
}
+ { //This unnecessary bracket works around a compiler bug in NVCC when compiling with OpenMP enabled
#ifdef HAVE_ZOLTAN2_OMP
#pragma omp barrier
#pragma omp single
@@ -2912,6 +2913,7 @@ void AlgMJ<mj_scalar_t, mj_lno_t, mj_gno_t, mj_part_t>::mj_1D_part(
temp_cut_coords = this->cut_coordinates_work_array;
this->cut_coordinates_work_array = t;
}
+ }
}
// Needed only if keep_cuts; otherwise can simply swap array pointers
@@ -3862,6 +3864,8 @@ void AlgMJ<mj_scalar_t, mj_lno_t, mj_gno_t, mj_part_t>::mj_get_new_cut_coordinat
}
}
+ { // This unnecessary bracket works around a compiler bug in NVCC when enabling OpenMP as well
+
//communication to determine the ratios of processors for the distribution
//of coordinates on the cut lines.
#ifdef HAVE_ZOLTAN2_OMP
@@ -3928,6 +3932,7 @@ void AlgMJ<mj_scalar_t, mj_lno_t, mj_gno_t, mj_part_t>::mj_get_new_cut_coordinat
*rectilinear_cut_count = 0;
}
}
+ }
}
/*! \brief Function fills up the num_points_in_all_processor_parts, so that
Can I apply that?