Skip to content

Commit de80f6b

Browse files
committed
Give Warning When no Conda Env is activated
1 parent 95eaccb commit de80f6b

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

run_with_mpi_wrappers.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ CYAN='\033[0;36m'
1111
BOLD='\033[1m'
1212
RESET='\033[0m' # Reset color
1313

14+
if [[ -z "$CONDA_PREFIX" ]]; then
15+
echo -e "${RED}Error: No Conda environment detected.${NC}"
16+
echo -e "${YELLOW}Please activate a Conda environment that includes MPI (OpenMPI or MPICH).${NC}"
17+
exit 1
18+
fi
19+
1420
if [ $# -lt 2 ]; then
1521
echo -e "${RED}Usage: $0 <Fortran file> <mpiexec arguments>${RESET}"
1622
exit 1

tests/pot3d/validate.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ MPIEXEC=${CONDA_PREFIX}/bin/mpiexec
77
cp ${POT3D_HOME}/testsuite/${TEST}/input/* ${POT3D_HOME}/testsuite/${TEST}/run/
88
cd ${POT3D_HOME}/testsuite/${TEST}/run
99

10+
if [[ -z "$CONDA_PREFIX" ]]; then
11+
echo -e "${RED}Error: No Conda environment detected.${NC}"
12+
echo -e "${YELLOW}Please activate a Conda environment that includes MPI (OpenMPI or MPICH).${NC}"
13+
exit 1
14+
fi
15+
1016
# detect MPI implementation
1117
MPI_VERSION=$($MPIEXEC --version 2>&1)
1218
if echo "$MPI_VERSION" | grep -q "Open MPI"; then

tests/run_tests.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ while [[ $# -gt 0 ]]; do
2222
esac
2323
done
2424

25+
if [[ -z "$CONDA_PREFIX" ]]; then
26+
echo -e "${RED}Error: No Conda environment detected.${NC}"
27+
echo -e "${YELLOW}Please activate a Conda environment that includes MPI (OpenMPI or MPICH).${NC}"
28+
exit 1
29+
fi
30+
2531
MPIEXEC=${CONDA_PREFIX}/bin/mpiexec
2632

2733
# detect MPI implementation

0 commit comments

Comments
 (0)