3 # Simple function used by run_*.sh scripts
8 if [ -z "${!name}" ]; then
9 echo "$0: $name must be set"
13 [ $failed ] && exit 1 || true
16 echoerr () { echo "$@" 1>&2 ; }
19 echoerr "$(date +'%F %H:%M:%S'): client load was signaled to terminate"
21 local PGID=$(ps -eo "%c %p %r" | awk "/ $PPID / {print \$3}")
28 local mpirun="$MPIRUN $MPIRUN_OPTIONS"
29 local command="$mpirun $@"
30 local mpilog=$TMP/mpi.log
34 if [ -n "$MPI_USER" -a "$MPI_USER" != root -a -n "$mpirun" ]; then
35 echo "+ chmod 0777 $MOUNT"
37 command="su $MPI_USER sh -c \"$command \""
42 eval $command 2>&1 | tee $mpilog || true
45 if [ $rc -eq 0 ] && grep -q "p4_error:" $mpilog ; then
54 for i in ${1//,/ }; do
55 list="$list $i@$NETTYPE"
60 # FIXME: all setup/cleanup can be done without rpc.sh
63 [ x$1 = x--verbose ] && verbose=true
65 export LST_SESSION=`$LST show_session 2>/dev/null | awk -F " " '{print $5}'`
66 [ "$LST_SESSION" == "" ] && return
75 lst_session_cleanup_all () {
76 local list=$(comma_list $(nodes_list))
77 do_rpc_nodes $list lst_end_session
81 lsmod | grep -q lnet_selftest && rmmod lnet_selftest > /dev/null 2>&1 || true
85 local list=$(comma_list $(nodes_list))
87 # lst end_session needs to be executed only locally
88 # i.e. on node where lst new_session was called
89 lst_end_session --verbose
90 do_rpc_nodes $list lst_cleanup
94 load_module lnet_selftest
98 local list=$(comma_list $(nodes_list))
99 do_rpc_nodes $list lst_setup