Simple script checking for errors when loading modules.

This commit is contained in:
Christoph Niethammer 2012-06-05 10:26:41 +00:00
parent 4b05d29e5a
commit 0712e9dd95

17
check_modules.sh Executable file
View file

@ -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