Simple script checking for errors when loading modules.
This commit is contained in:
parent
4b05d29e5a
commit
0712e9dd95
1 changed files with 17 additions and 0 deletions
17
check_modules.sh
Executable file
17
check_modules.sh
Executable 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
|
||||||
|
|
Loading…
Reference in a new issue