]> SALOME platform Git repositories - tools/sat_salome.git/commitdiff
Salome HOME
spns #34822: allow user to switch between OpenMP and TBB for VTK SMP implementation...
authorNabil Ghodbane <nabil.ghodbane@cea.fr>
Thu, 27 Apr 2023 15:41:55 +0000 (17:41 +0200)
committerNabil Ghodbane <nabil.ghodbane@cea.fr>
Thu, 27 Apr 2023 15:41:55 +0000 (17:41 +0200)
products/compil_scripts/ParaView-5.10.0.sh
products/compil_scripts/ParaView-5.11.0.sh
products/compil_scripts/ParaView-5.11.1.sh
products/compil_scripts/ParaView-5.8.0.sh
products/compil_scripts/ParaView-5.9.0.sh

index 006acc2f9a11ede843aafe332549de3f31986aa2..2f1a8eb53864b62289e42fbcd0d9e816b379d14c 100755 (executable)
@@ -127,17 +127,17 @@ then
     CMAKE_OPTIONS="${CMAKE_OPTIONS} -DPARAVIEW_USE_MPI:BOOL=OFF"
     CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCMAKE_CXX_COMPILER:STRING=`which g++`"
     CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCMAKE_C_COMPILER:STRING=`which gcc`"
-    if [[ $VTK_SMP_IMPLEMENTATION_TYPE = "sequential" ]]
+    if [[ $VTK_SMP_IMPLEMENTATION_TYPE == "sequential" ]]
     then
         echo "WARNING: sequential approach will be used..."
         CMAKE_OPTIONS="${CMAKE_OPTIONS} -DPARAVIEW_USE_MPI:BOOL=OFF"
         CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCMAKE_CXX_COMPILER:STRING=`which g++`"
         CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCMAKE_C_COMPILER:STRING=`which gcc`"
-    elif [[ $VTK_SMP_IMPLEMENTATION_TYPE = "TBB" ]]
+    elif [[ $VTK_SMP_IMPLEMENTATION_TYPE == "TBB" ]]
     then
         echo "WARNING: VTK_SMP_IMPLEMENTATION_TYPE was set to: TBB..."
         CMAKE_OPTIONS="${CMAKE_OPTIONS} -DVTK_SMP_IMPLEMENTATION_TYPE=TBB -DVTKm_ENABLE_TBB:BOOL=ON"
-    elif [[ $VTK_SMP_IMPLEMENTATION_TYPE = "OpenMP" ]]
+    elif [[ $VTK_SMP_IMPLEMENTATION_TYPE == "OpenMP" ]]
     then
         echo "WARNING: VTK_SMP_IMPLEMENTATION_TYPE was set to: OpenMP..."
         CMAKE_OPTIONS="${CMAKE_OPTIONS} -DVTK_SMP_IMPLEMENTATION_TYPE=OpenMP -DVTKm_ENABLE_OPENMP:BOOL=ON"
index 6407a6f27bfba3706b797003180fd1eb3f6976c6..d0be771dd00fc3e4e925671fe492b77f76b1384c 100755 (executable)
@@ -125,43 +125,49 @@ CMAKE_OPTIONS+=" -DVTK_PYTHON_VERSION:STRING=3"
 CMAKE_OPTIONS+=" -DVTK_WRAP_JAVA:BOOL=OFF"
 
 ### MPI settings
-if [ -n "$SAT_HPC" ]
-then
+if [ -n "$SAT_HPC" ]; then
     CMAKE_OPTIONS+=" -DPARAVIEW_USE_MPI:BOOL=ON"
     if [ -n "$MPI_ROOT_DIR" ]; then
-       # On CentOS, Fedora, hdf5-openmpi-devel system package installs HDF5 headers in the openmpi include directory
-       # This screws up ParaView at runtime since xdmf2 is built with the wrong HDF5 files
-       # Attempts to fix at Xdmf2 CMakeLists file did not help to resolve this issue
-       #  tried include_directories(BEFORE "${HDF_INCLUDE_DIRS}")
-       if [ "${SAT_openmpi_IS_NATIVE}" == "1" ] &&  [ -f "${MPI_INCLUDE_DIR}/hdf5.h" ] &&  [ "$SAT_hdf5_IS_NATIVE" != "1" ]; then
+             # On CentOS, Fedora, hdf5-openmpi-devel system package installs HDF5 headers in the openmpi include directory
+             # This screws up ParaView at runtime since xdmf2 is built with the wrong HDF5 files
+             # Attempts to fix at Xdmf2 CMakeLists file did not help to resolve this issue
+             #  tried include_directories(BEFORE "${HDF_INCLUDE_DIRS}")
+             if [ "${SAT_openmpi_IS_NATIVE}" == "1" ] &&  [ -f "${MPI_INCLUDE_DIR}/hdf5.h" ] &&  [ "$SAT_hdf5_IS_NATIVE" != "1" ]; then
             echo "WARNING: openMPI is system based and hdf5-openmpi-devel is installed on your node (${MPI_INCLUDE_DIR}/hdf5.h detected...)"
-       else
+             else
             CMAKE_OPTIONS+=" -DCMAKE_CXX_COMPILER:STRING=${MPI_CXX_COMPILER}"
             CMAKE_OPTIONS+=" -DCMAKE_C_COMPILER:STRING=${MPI_C_COMPILER}"
-       fi
+             fi
+    fi
+    # SMP implementation
+    if [ "${VTK_SMP_IMPLEMENTATION_TYPE}" == "sequential" ]; then
+        echo "FATAL: Inconsistent VTK_SMP_IMPLEMENTATION_TYPE!"
+        exit  1
+    elif [ "${VTK_SMP_IMPLEMENTATION_TYPE}" == "OpenMP" ]; then
+        echo "WARNING: VTK_SMP_IMPLEMENTATION_TYPE was set to: OpenMP..."
+        CMAKE_OPTIONS+=" -DVTK_SMP_IMPLEMENTATION_TYPE=OpenMP -DVTKm_ENABLE_OPENMP:BOOL=ON"
+    elif [ "${VTK_SMP_IMPLEMENTATION_TYPE}" == "TBB" ]; then
+        echo "WARNING: VTK_SMP_IMPLEMENTATION_TYPE was set to: TBB..."
+        CMAKE_OPTIONS+=" -DVTK_SMP_IMPLEMENTATION_TYPE=TBB -DVTKm_ENABLE_TBB:BOOL=ON"
     fi
-    CMAKE_OPTIONS+=" -DVTK_SMP_IMPLEMENTATION_TYPE=OpenMP -DVTKm_ENABLE_OPENMP=ON"
     CMAKE_OPTIONS+=" -DVTK_MODULE_ENABLE_VTK_FiltersParallelMPI=YES"
     CMAKE_OPTIONS+=" -DVTK_MODULE_ENABLE_VTK_ParallelMPI=YES"
     CMAKE_OPTIONS+=" -DMPI_C_FOUND=${MPI_C_FOUND}"
-elif [ -n "$VTK_SMP_IMPLEMENTATION_TYPE" ]
-then
+
+elif [ "${VTK_SMP_IMPLEMENTATION_TYPE}" != "" ]; then
     echo "WARNING: VTK_SMP_IMPLEMENTATION_TYPE environment variable was found...."
     CMAKE_OPTIONS+=" -DPARAVIEW_USE_MPI:BOOL=OFF"
     CMAKE_OPTIONS+=" -DCMAKE_CXX_COMPILER:STRING=`which g++`"
     CMAKE_OPTIONS+=" -DCMAKE_C_COMPILER:STRING=`which gcc`"
-    if [[ $VTK_SMP_IMPLEMENTATION_TYPE = "sequential" ]]
-    then
+    if [ "${VTK_SMP_IMPLEMENTATION_TYPE}" == "sequential" ]; then
         echo "WARNING: sequential approach will be used..."
         CMAKE_OPTIONS+=" -DPARAVIEW_USE_MPI:BOOL=OFF"
         CMAKE_OPTIONS+=" -DCMAKE_CXX_COMPILER:STRING=`which g++`"
         CMAKE_OPTIONS+=" -DCMAKE_C_COMPILER:STRING=`which gcc`"
-    elif [[ $VTK_SMP_IMPLEMENTATION_TYPE = "TBB" ]]
-    then
+    elif [ "${VTK_SMP_IMPLEMENTATION_TYPE}" == "TBB" ]; then
         echo "WARNING: VTK_SMP_IMPLEMENTATION_TYPE was set to: TBB..."
         CMAKE_OPTIONS+=" -DVTK_SMP_IMPLEMENTATION_TYPE=TBB -DVTKm_ENABLE_TBB:BOOL=ON"
-    elif [[ $VTK_SMP_IMPLEMENTATION_TYPE = "OpenMP" ]]
-    then
+    elif [ "${VTK_SMP_IMPLEMENTATION_TYPE}" == "OpenMP" ]; then
         echo "WARNING: VTK_SMP_IMPLEMENTATION_TYPE was set to: OpenMP..."
         CMAKE_OPTIONS+=" -DVTK_SMP_IMPLEMENTATION_TYPE=OpenMP -DVTKm_ENABLE_OPENMP:BOOL=ON"
     else
@@ -325,6 +331,7 @@ fi
 
 echo
 echo "*** cmake" ${CMAKE_OPTIONS}
+
 cmake ${CMAKE_OPTIONS} $SOURCE_DIR
 if [ $? -ne 0 ]
 then
index 6407a6f27bfba3706b797003180fd1eb3f6976c6..d0be771dd00fc3e4e925671fe492b77f76b1384c 100755 (executable)
@@ -125,43 +125,49 @@ CMAKE_OPTIONS+=" -DVTK_PYTHON_VERSION:STRING=3"
 CMAKE_OPTIONS+=" -DVTK_WRAP_JAVA:BOOL=OFF"
 
 ### MPI settings
-if [ -n "$SAT_HPC" ]
-then
+if [ -n "$SAT_HPC" ]; then
     CMAKE_OPTIONS+=" -DPARAVIEW_USE_MPI:BOOL=ON"
     if [ -n "$MPI_ROOT_DIR" ]; then
-       # On CentOS, Fedora, hdf5-openmpi-devel system package installs HDF5 headers in the openmpi include directory
-       # This screws up ParaView at runtime since xdmf2 is built with the wrong HDF5 files
-       # Attempts to fix at Xdmf2 CMakeLists file did not help to resolve this issue
-       #  tried include_directories(BEFORE "${HDF_INCLUDE_DIRS}")
-       if [ "${SAT_openmpi_IS_NATIVE}" == "1" ] &&  [ -f "${MPI_INCLUDE_DIR}/hdf5.h" ] &&  [ "$SAT_hdf5_IS_NATIVE" != "1" ]; then
+             # On CentOS, Fedora, hdf5-openmpi-devel system package installs HDF5 headers in the openmpi include directory
+             # This screws up ParaView at runtime since xdmf2 is built with the wrong HDF5 files
+             # Attempts to fix at Xdmf2 CMakeLists file did not help to resolve this issue
+             #  tried include_directories(BEFORE "${HDF_INCLUDE_DIRS}")
+             if [ "${SAT_openmpi_IS_NATIVE}" == "1" ] &&  [ -f "${MPI_INCLUDE_DIR}/hdf5.h" ] &&  [ "$SAT_hdf5_IS_NATIVE" != "1" ]; then
             echo "WARNING: openMPI is system based and hdf5-openmpi-devel is installed on your node (${MPI_INCLUDE_DIR}/hdf5.h detected...)"
-       else
+             else
             CMAKE_OPTIONS+=" -DCMAKE_CXX_COMPILER:STRING=${MPI_CXX_COMPILER}"
             CMAKE_OPTIONS+=" -DCMAKE_C_COMPILER:STRING=${MPI_C_COMPILER}"
-       fi
+             fi
+    fi
+    # SMP implementation
+    if [ "${VTK_SMP_IMPLEMENTATION_TYPE}" == "sequential" ]; then
+        echo "FATAL: Inconsistent VTK_SMP_IMPLEMENTATION_TYPE!"
+        exit  1
+    elif [ "${VTK_SMP_IMPLEMENTATION_TYPE}" == "OpenMP" ]; then
+        echo "WARNING: VTK_SMP_IMPLEMENTATION_TYPE was set to: OpenMP..."
+        CMAKE_OPTIONS+=" -DVTK_SMP_IMPLEMENTATION_TYPE=OpenMP -DVTKm_ENABLE_OPENMP:BOOL=ON"
+    elif [ "${VTK_SMP_IMPLEMENTATION_TYPE}" == "TBB" ]; then
+        echo "WARNING: VTK_SMP_IMPLEMENTATION_TYPE was set to: TBB..."
+        CMAKE_OPTIONS+=" -DVTK_SMP_IMPLEMENTATION_TYPE=TBB -DVTKm_ENABLE_TBB:BOOL=ON"
     fi
-    CMAKE_OPTIONS+=" -DVTK_SMP_IMPLEMENTATION_TYPE=OpenMP -DVTKm_ENABLE_OPENMP=ON"
     CMAKE_OPTIONS+=" -DVTK_MODULE_ENABLE_VTK_FiltersParallelMPI=YES"
     CMAKE_OPTIONS+=" -DVTK_MODULE_ENABLE_VTK_ParallelMPI=YES"
     CMAKE_OPTIONS+=" -DMPI_C_FOUND=${MPI_C_FOUND}"
-elif [ -n "$VTK_SMP_IMPLEMENTATION_TYPE" ]
-then
+
+elif [ "${VTK_SMP_IMPLEMENTATION_TYPE}" != "" ]; then
     echo "WARNING: VTK_SMP_IMPLEMENTATION_TYPE environment variable was found...."
     CMAKE_OPTIONS+=" -DPARAVIEW_USE_MPI:BOOL=OFF"
     CMAKE_OPTIONS+=" -DCMAKE_CXX_COMPILER:STRING=`which g++`"
     CMAKE_OPTIONS+=" -DCMAKE_C_COMPILER:STRING=`which gcc`"
-    if [[ $VTK_SMP_IMPLEMENTATION_TYPE = "sequential" ]]
-    then
+    if [ "${VTK_SMP_IMPLEMENTATION_TYPE}" == "sequential" ]; then
         echo "WARNING: sequential approach will be used..."
         CMAKE_OPTIONS+=" -DPARAVIEW_USE_MPI:BOOL=OFF"
         CMAKE_OPTIONS+=" -DCMAKE_CXX_COMPILER:STRING=`which g++`"
         CMAKE_OPTIONS+=" -DCMAKE_C_COMPILER:STRING=`which gcc`"
-    elif [[ $VTK_SMP_IMPLEMENTATION_TYPE = "TBB" ]]
-    then
+    elif [ "${VTK_SMP_IMPLEMENTATION_TYPE}" == "TBB" ]; then
         echo "WARNING: VTK_SMP_IMPLEMENTATION_TYPE was set to: TBB..."
         CMAKE_OPTIONS+=" -DVTK_SMP_IMPLEMENTATION_TYPE=TBB -DVTKm_ENABLE_TBB:BOOL=ON"
-    elif [[ $VTK_SMP_IMPLEMENTATION_TYPE = "OpenMP" ]]
-    then
+    elif [ "${VTK_SMP_IMPLEMENTATION_TYPE}" == "OpenMP" ]; then
         echo "WARNING: VTK_SMP_IMPLEMENTATION_TYPE was set to: OpenMP..."
         CMAKE_OPTIONS+=" -DVTK_SMP_IMPLEMENTATION_TYPE=OpenMP -DVTKm_ENABLE_OPENMP:BOOL=ON"
     else
@@ -325,6 +331,7 @@ fi
 
 echo
 echo "*** cmake" ${CMAKE_OPTIONS}
+
 cmake ${CMAKE_OPTIONS} $SOURCE_DIR
 if [ $? -ne 0 ]
 then
index 2f8229435fb05b094fa0f02de99cb88d7cdc81d3..0fec740e1c74c0b384b71627826d589945028c17 100755 (executable)
@@ -125,17 +125,17 @@ then
     CMAKE_OPTIONS="${CMAKE_OPTIONS} -DPARAVIEW_USE_MPI:BOOL=OFF"
     CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCMAKE_CXX_COMPILER:STRING=`which g++`"
     CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCMAKE_C_COMPILER:STRING=`which gcc`"
-    if [[ $VTK_SMP_IMPLEMENTATION_TYPE = "sequential" ]]
+    if [[ $VTK_SMP_IMPLEMENTATION_TYPE == "sequential" ]]
     then
         echo "WARNING: sequential approach will be used..."
         CMAKE_OPTIONS="${CMAKE_OPTIONS} -DPARAVIEW_USE_MPI:BOOL=OFF"
         CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCMAKE_CXX_COMPILER:STRING=`which g++`"
         CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCMAKE_C_COMPILER:STRING=`which gcc`"
-    elif [[ $VTK_SMP_IMPLEMENTATION_TYPE = "TBB" ]]
+    elif [[ $VTK_SMP_IMPLEMENTATION_TYPE == "TBB" ]]
     then
         echo "WARNING: VTK_SMP_IMPLEMENTATION_TYPE was set to: TBB..."
         CMAKE_OPTIONS="${CMAKE_OPTIONS} -DVTK_SMP_IMPLEMENTATION_TYPE=TBB -DVTKm_ENABLE_TBB:BOOL=ON"
-    elif [[ $VTK_SMP_IMPLEMENTATION_TYPE = "OpenMP" ]]
+    elif [[ $VTK_SMP_IMPLEMENTATION_TYPE == "OpenMP" ]]
     then
         echo "WARNING: VTK_SMP_IMPLEMENTATION_TYPE was set to: OpenMP..."
         CMAKE_OPTIONS="${CMAKE_OPTIONS} -DVTK_SMP_IMPLEMENTATION_TYPE=OpenMP -DVTKm_ENABLE_OPENMP:BOOL=ON"
index eaf6ff093a1c1f5e0a861d7ccc3dc058fce384af..2775b1c73be033d7d86114806b3db5619b8008d1 100755 (executable)
@@ -142,17 +142,17 @@ then
     CMAKE_OPTIONS+=" -DPARAVIEW_USE_MPI:BOOL=OFF"
     CMAKE_OPTIONS+=" -DCMAKE_CXX_COMPILER:STRING=`which g++`"
     CMAKE_OPTIONS+=" -DCMAKE_C_COMPILER:STRING=`which gcc`"
-    if [[ $VTK_SMP_IMPLEMENTATION_TYPE = "sequential" ]]
+    if [[ $VTK_SMP_IMPLEMENTATION_TYPE == "sequential" ]]
     then
         echo "WARNING: sequential approach will be used..."
         CMAKE_OPTIONS+=" -DPARAVIEW_USE_MPI:BOOL=OFF"
         CMAKE_OPTIONS+=" -DCMAKE_CXX_COMPILER:STRING=`which g++`"
         CMAKE_OPTIONS+=" -DCMAKE_C_COMPILER:STRING=`which gcc`"
-    elif [[ $VTK_SMP_IMPLEMENTATION_TYPE = "TBB" ]]
+    elif [[ $VTK_SMP_IMPLEMENTATION_TYPE == "TBB" ]]
     then
         echo "WARNING: VTK_SMP_IMPLEMENTATION_TYPE was set to: TBB..."
         CMAKE_OPTIONS+=" -DVTK_SMP_IMPLEMENTATION_TYPE=TBB -DVTKm_ENABLE_TBB:BOOL=ON"
-    elif [[ $VTK_SMP_IMPLEMENTATION_TYPE = "OpenMP" ]]
+    elif [[ $VTK_SMP_IMPLEMENTATION_TYPE == "OpenMP" ]]
     then
         echo "WARNING: VTK_SMP_IMPLEMENTATION_TYPE was set to: OpenMP..."
         CMAKE_OPTIONS+=" -DVTK_SMP_IMPLEMENTATION_TYPE=OpenMP -DVTKm_ENABLE_OPENMP:BOOL=ON"