Skip to content

Commit

Permalink
Somewhat improved determining number of devices (incorrect if I_MPI_O…
Browse files Browse the repository at this point in the history
…FFLOAD was in action).
  • Loading branch information
hfp committed Aug 16, 2024
1 parent d0543e0 commit 7f5d362
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions config/cp2k/info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,14 @@ for FILE in ${FILES}; do
NDEVS=$(grep -m1 " DBCSR| ACC: Number of devices/node" "${FILE}" | sed -n "s/..*\s\s*\(\w\)/\1/p")
fi
if [ "${NDEVS}" ]; then
DEVIDS=$(grep -m1 "ACC_OPENCL_DEVIDS" "${FILE}" | sed -n "s/..*=\(\w\)/\1/p" | tr -cd ,)
if [ ! "${DEVIDS}" ]; then
DEVIDS=$(grep -m1 "CUDA_VISIBLE_DEVICES" "${FILE}" | sed -n "s/..*=\(\w\)/\1/p" | tr -cd ,)
fi
if [ "${DEVIDS}" ]; then
DEVIDS=$(wc -c <<<"${DEVIDS}")
NDEVS=$((DEVIDS<NDEVS?(DEVIDS+1):NDEVS))
fi
echo -e -n "\t\t${NDEVS} ACC"
fi
echo
Expand Down

0 comments on commit 7f5d362

Please sign in to comment.