File tree Expand file tree Collapse file tree 2 files changed +31
-2
lines changed Expand file tree Collapse file tree 2 files changed +31
-2
lines changed Original file line number Diff line number Diff line change @@ -2,11 +2,26 @@ set -ex
22
33POT3D_HOME=$PWD
44TEST=" validation"
5- MPIEXEC=${CONDA_PREFIX} /bin/mpiexec
65
76cp ${POT3D_HOME} /testsuite/${TEST} /input/* ${POT3D_HOME} /testsuite/${TEST} /run/
87cd ${POT3D_HOME} /testsuite/${TEST} /run
98
9+ # Check if conda is active
10+ if [[ -z " $CONDA_PREFIX " ]]; then
11+ echo -e " ${RED} Error: No Conda environment is active. Please activate a conda env with MPI installed.${NC} "
12+ exit 1
13+ fi
14+
15+ # Try locating mpiexec
16+ if [[ -x " ${CONDA_PREFIX} /bin/mpiexec" ]]; then
17+ MPIEXEC=" ${CONDA_PREFIX} /bin/mpiexec"
18+ elif command -v mpiexec & > /dev/null; then
19+ MPIEXEC=$( command -v mpiexec)
20+ else
21+ echo -e " ${RED} Error: mpiexec not found. Please install MPI (OpenMPI or MPICH) via Conda or system package manager.${NC} "
22+ exit 1
23+ fi
24+
1025# detect MPI implementation
1126MPI_VERSION=$( $MPIEXEC --version 2>&1 )
1227if echo " $MPI_VERSION " | grep -q " Open MPI" ; then
Original file line number Diff line number Diff line change @@ -22,7 +22,21 @@ while [[ $# -gt 0 ]]; do
2222 esac
2323done
2424
25- MPIEXEC=${CONDA_PREFIX} /bin/mpiexec
25+ # Check if conda is active
26+ if [[ -z " $CONDA_PREFIX " ]]; then
27+ echo -e " ${RED} Error: No Conda environment is active. Please activate a conda env with MPI installed.${NC} "
28+ exit 1
29+ fi
30+
31+ # Try locating mpiexec
32+ if [[ -x " ${CONDA_PREFIX} /bin/mpiexec" ]]; then
33+ MPIEXEC=" ${CONDA_PREFIX} /bin/mpiexec"
34+ elif command -v mpiexec & > /dev/null; then
35+ MPIEXEC=$( command -v mpiexec)
36+ else
37+ echo -e " ${RED} Error: mpiexec not found. Please install MPI (OpenMPI or MPICH) via Conda or system package manager.${NC} "
38+ exit 1
39+ fi
2640
2741# detect MPI implementation
2842MPI_VERSION=$( $MPIEXEC --version 2>&1 )
You can’t perform that action at this time.
0 commit comments