+# This is to allow use of yod, pdsh, etc.
+fanout() {
+ local clients=$1; shift
+ local tmpfile=$1; shift
+ local result
+ case $fanout_cmd in
+ 'pdsh')
+ $fanout_cmd $pdsh_args "$clients" "$@" >> $tmpfile 2>&1
+ echo $?
+ return
+ ;;
+ 'mpirun')
+ # horrible misuse of globals
+ $fanout_cmd -np $((ntask*nclnt)) "$@" >> $tmpfile 2>&1
+ echo $?
+ return
+ ;;
+ 'yod')
+ # and another
+ $fanout_cmd -np $((ntask*nclnt)) "$@" >> $tmpfile 2>&1
+ echo $?
+ return
+ ;;
+
+ *)
+ echo "255"
+ return
+ ;;
+ esac
+}
+
+dump_cache() {
+ # we are assuming mpi uses will also have pdsh
+ local clients=$1;shift
+ local tmpfile=$1;shift
+ clear_cache='for LRU in /proc/fs/lustre/ldlm/namespaces/*/lru_size;
+ do sudo /bin/bash -c "echo clear > $LRU"; done'
+ echo "=> $clear_cache" >> $tmpfile
+ $pdsh $pdsh_args "$test_clients" "$clear_cache" >> $tmpfile 2>&1
+ status=$?
+ echo "Completion Status: $status" >> $tmpfile
+
+ if ((status)); then
+ echo "ERROR"
+ else
+ echo "OK"
+ fi
+}