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
2
2
3
3
POT3D_HOME=$PWD
4
4
TEST=" validation"
5
- MPIEXEC=${CONDA_PREFIX} /bin/mpiexec
6
5
7
6
cp ${POT3D_HOME} /testsuite/${TEST} /input/* ${POT3D_HOME} /testsuite/${TEST} /run/
8
7
cd ${POT3D_HOME} /testsuite/${TEST} /run
9
8
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
+
10
25
# detect MPI implementation
11
26
MPI_VERSION=$( $MPIEXEC --version 2>&1 )
12
27
if 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
22
22
esac
23
23
done
24
24
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
26
40
27
41
# detect MPI implementation
28
42
MPI_VERSION=$( $MPIEXEC --version 2>&1 )
You can’t perform that action at this time.
0 commit comments