manyconnect.in
来自「fortran并行计算包」· IN 代码 · 共 79 行
IN
79 行
#! /bin/shfile=`pwd`/test-portprefix="@prefix@"exec_prefix="@exec_prefix@"mpiexec="@bindir@/mpiexec"starter="$mpiexec -n 1"testpgm=testconnectrm -f $file# Default number of processes to start (the test is for large numbers# of processes; use "manyconnect 10" to start with fewer for debugging)nconn=100# To avoid problems with listner queues, we pause every blockstart# processesblockstart=10# Print help/usage information if requestedif [ "$1" = "-help" -o "$1" = "-usage" ] ; then echo "$0 [ -singleton ] [ nconn [ testprogram ] ]" exit 0fiif [ "$1" = "-singleton" ] ; then starter=eval shiftfiif [ -n "$1" ] ; then nconn=$1 shiftfiif [ -n "$1" ] ; then if [ -x "$1" ] ; then testpgm=$1 else echo "Expected to find an executable program; found $1" exit 1 fi shiftfi# Make sure that the program is executableif [ ! -x "$testpgm" ] ; then # Try to make it echo "Making $testpgm" make $testpgm if [ $? != 0 ] ; then echo "Failure in make $testpgm" exit 1 fi if [ ! -x "$testpgm" ] ; then echo "The program $testpgm either does not exist or is not executable" exit 1 fifi# Start one and sleep to avoid problems with two processes opening the# test-port file for writing$starter ./$testpgm $file $nconn 1 &sleep 1nstarted=2blockcount=2while [ $nstarted -lt $nconn ] ; do #echo "Starting $nstarted" $starter ./$testpgm $file $nconn $nstarted & echo "Started process $! (num $nstarted)" nstarted=`expr $nstarted + 1` blockcount=`expr $blockcount + 1` if [ -n "$2" ] ; then sleep $2 elif [ $blockcount -ge $blockstart ] ; then blockcount=0 sleep 1 fidone#echo "Starting $nstarted"$starter ./$testpgm $file $nconn $nstartedwait
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?