From 0712e9dd95f5a93c89c85f5a845bf0ef91b476e9 Mon Sep 17 00:00:00 2001 From: Christoph Niethammer Date: Tue, 5 Jun 2012 10:26:41 +0000 Subject: [PATCH] Simple script checking for errors when loading modules. --- check_modules.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 check_modules.sh 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 +