From 285957294e7babe551f2ae39bcaed91b7d174ef9 Mon Sep 17 00:00:00 2001 From: Guytri KASTANE Date: Tue, 29 Oct 2024 09:04:23 +0100 Subject: [PATCH] spns #43007: use petsc with mpi on salome native; updated SOLVERLAB compilation script for debug mode --- applications/SALOME-master-native.pyconf | 6 +++--- products/compil_scripts/SOLVERLAB.sh | 13 +++++++++++++ products/compil_scripts/petsc-3.16.0.sh | 5 +++++ products/env_scripts/mpi4py.py | 4 +++- products/env_scripts/openmpi.py | 1 + 5 files changed, 25 insertions(+), 4 deletions(-) diff --git a/applications/SALOME-master-native.pyconf b/applications/SALOME-master-native.pyconf index ef0d1f2..410d4a8 100644 --- a/applications/SALOME-master-native.pyconf +++ b/applications/SALOME-master-native.pyconf @@ -115,7 +115,7 @@ APPLICATION : patsy : 'native' ParaView : {tag:'5.11.0', base: 'no', section: 'version_5_11_0_MPI', hpc: 'yes'} PERSALYS : 'v16.0.1' - petsc : {tag : '3.16.0', section: 'version_3_16_0'} + petsc : {tag : '3.16.0', base: 'no', section: 'version_3_16_0', hpc: 'yes'} Pillow : 'native' planegcs : '0.18-3cb6890' psutil : 'native' @@ -203,7 +203,7 @@ APPLICATION : 'YDEFX' 'pmml' 'SALOMEBOOTSTRAP' - 'SOLVERLAB' + 'SOLVERLAB' : {tag: 'master', base: 'no', section: 'default_MPI', hpc: 'yes'} 'TopIIVolMesh' #'TESTBASE' 'CEATESTBASE' : 'SalomeV9' @@ -495,7 +495,7 @@ __overwrite__ : 'APPLICATION.products.swig' : '4.0.2' 'APPLICATION.products.meshio' : {tag: '5.3.5' , base: 'no', section: 'version_5_3_5_no_pip' } 'APPLICATION.products.opencv' : {tag: '3.2.0', base: 'no', section: 'version_3_2_0_FD38' } - 'APPLICATION.products.petsc' : {tag: '3.16.0', base: 'no', section: 'version_3_16_0_FD38' } + 'APPLICATION.products.petsc' : {tag: '3.16.0', base: 'no', section: 'version_3_16_0_FD38', hpc: 'yes' } 'APPLICATION.products.PyFMI' : {tag: '2.6', base: 'no', section: 'version_2_6_FD38' } 'APPLICATION.products.medfile' : {tag: '4.1.1', base: 'no', section: 'version_4_1_1_FD38' } 'APPLICATION.products.catalyst' : {tag: '2.0', base: 'no', section: 'version_2_0_FD38' } diff --git a/products/compil_scripts/SOLVERLAB.sh b/products/compil_scripts/SOLVERLAB.sh index fa08db5..91c92e7 100755 --- a/products/compil_scripts/SOLVERLAB.sh +++ b/products/compil_scripts/SOLVERLAB.sh @@ -69,6 +69,12 @@ else fi fi +if [ -n "${SAT_DEBUG}" ]; then + CMAKE_OPTIONS+=" -DCMAKE_BUILD_TYPE=Debug" +else + CMAKE_OPTIONS+=" -DCMAKE_BUILD_TYPE=Release" +fi + echo echo "*** cmake "$CMAKE_OPTIONS cmake $CMAKE_OPTIONS $SOURCE_DIR @@ -86,6 +92,13 @@ if [ $? -ne 0 ]; then exit 2 fi +echo +echo "*** env_SOLVERLAB.sh deps path" +if [ "$SAT_openmpi_IS_NATIVE" != "1" ]; then + sed -i '/export MPI_ROOT_DIR=.*/a export OPAL_PREFIX=${MPI_ROOT_DIR}' $PRODUCT_INSTALL/env_SOLVERLAB.sh +fi +sed -i "s|${PRODUCT_INSTALL%/*}|\$\{ROOT\_DIR\}|g" $PRODUCT_INSTALL/env_SOLVERLAB.sh + echo echo "*** make doc install" make docCDMATH docCoreFlows install diff --git a/products/compil_scripts/petsc-3.16.0.sh b/products/compil_scripts/petsc-3.16.0.sh index d5b432a..03ab48e 100755 --- a/products/compil_scripts/petsc-3.16.0.sh +++ b/products/compil_scripts/petsc-3.16.0.sh @@ -45,6 +45,11 @@ then CONFIGURE_FLAGS+=" --download-mpi4py=ext/mpi4py-3.0.3.tar.gz" fi echo "*** configure --prefix=${PRODUCT_INSTALL} --with-mpi-dir=${MPI_ROOT_DIR} ${CONFIGURE_FLAGS}" + if [ "$SAT_openmpi_IS_NATIVE" == "1" ]; then + CONFIGURE_FLAGS+=" --with-cc=${MPI_C_COMPILER}" + CONFIGURE_FLAGS+=" --with-cxx=${MPI_CXX_COMPILER}" + CONFIGURE_FLAGS+=" --with-fc=${MPI_FC_COMPILER}" + fi ./configure --prefix=${PRODUCT_INSTALL} --with-mpi-dir=${MPI_ROOT_DIR} ${CONFIGURE_FLAGS} else echo "*** configure --prefix=${PRODUCT_INSTALL} --with-mpi=0 ${CONFIGURE_FLAGS}" diff --git a/products/env_scripts/mpi4py.py b/products/env_scripts/mpi4py.py index 296a697..3957a96 100644 --- a/products/env_scripts/mpi4py.py +++ b/products/env_scripts/mpi4py.py @@ -12,5 +12,7 @@ def set_env(env, prereq_dir, version): env.prepend("PYTHONPATH",os.path.join(prereq_dir, 'lib', 'python' + versionPython, 'site-packages')) def set_nativ_env(env): - pass + import mpi4py + MPI4PY_ROOT_DIR=os.path.join('/',*mpi4py.__path__[0].split('/')[:-1]) + env.set("MPI4PY_ROOT_DIR", MPI4PY_ROOT_DIR) diff --git a/products/env_scripts/openmpi.py b/products/env_scripts/openmpi.py index 9866871..7241b0f 100644 --- a/products/env_scripts/openmpi.py +++ b/products/env_scripts/openmpi.py @@ -46,6 +46,7 @@ def set_nativ_env(env): env.set('MPI_ROOT', prereq_dir) env.set('MPI_C_COMPILER', os.path.join(prereq_bin,'mpicc')) env.set('MPI_CXX_COMPILER', os.path.join(prereq_bin,'mpicxx')) + env.set('MPI_FC_COMPILER', os.path.join(prereq_bin,'mpifort')) env.set('MPI_C_FOUND', os.path.join(prereq_dir,'lib','libmpi.so')) env.set('MPI_INCLUDE_DIR', prereq_inc) if prereq_bin != "/usr/bin": -- 2.39.2