From 212b9ffa2c25beccda577b5f6250da93359c9d20 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Tue, 12 Feb 2013 17:48:16 +0100 Subject: [PATCH] Try to make the smpi-mpich-env test more robust in multitasking environments. Only select the processes that share the same session ID. --- teshsuite/smpi/mpich-test/env/runtests | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/teshsuite/smpi/mpich-test/env/runtests b/teshsuite/smpi/mpich-test/env/runtests index 3ee7e0104b..75a58bf8ca 100755 --- a/teshsuite/smpi/mpich-test/env/runtests +++ b/teshsuite/smpi/mpich-test/env/runtests @@ -120,7 +120,14 @@ RunTest getproc 1 "*** Test Get Processor Name ***" # # If there was a Unix standard interface to ps, we could check for orphaned # processes... -if ps -fwu $LOGNAME > /dev/null 2>&1 ; then +if ps --version | grep procps > /dev/null 2>&1 ; then + # This is a try to be a better choice than ps -u because it + # restricts the list of processes to those of the current session. + # The options are known to work with the ps command from the procps + # package. + SESSION=`ps -o sess= $$` + PSPGM="ps -o pid,tname,command -s $SESSION" +elif ps -fwu $LOGNAME > /dev/null 2>&1 ; then # This is a better choice than ps aux because it restricts the list of # processes to those of the running user. The w is needed on some # systems to get a long output for the command -- 2.20.1