diff --git a/check_modules.sh b/check_modules.sh new file mode 100755 index 0000000..b8c3a63 --- /dev/null +++ b/check_modules.sh @@ -0,0 +1,17 @@ +#!/bin/bash -l + + +for m in $(module av 2>&1); do + if [[ $m =~ ^[A-Za-z] ]]; then + module load $m >.module_load.log 2>&1 + if ! module li 2>&1 | grep $m >/dev/null; then + echo "ERROR: Module $m failed to load" + fi + if grep -i "error" ".module_load.log" >/dev/null; then + echo "ERROR: Module $m reported errors when loading:" + awk '{print " " $0;}' .module_load.log + fi + module purge 2>/dev/null + fi +done +