Home | History | Annotate | Download | only in latency
      1 #! /bin/bash
      2 
      3 if [ ! $SCRIPTS_DIR ]; then
      4 	# assume we're running standalone
      5 	export SCRIPTS_DIR=../../scripts/
      6 fi
      7 
      8 source $SCRIPTS_DIR/setenv.sh
      9 LOG_FILE="$LOG_DIR/$LOG_FORMAT-pthread_cond_many.log"
     10 
     11 echo "Logging to: " | tee -a $LOG_FILE
     12 echo "$LOG_FILE " | tee -a $LOG_FILE
     13 echo "and to local individual .out files " | tee -a $LOG_FILE
     14 
     15 #
     16 # make will eventually go away from here, as will the above echoes
     17 #
     18 make
     19 
     20 #
     21 # Test lots of threads.  Specify "--realtime" if you want the first
     22 # process to run realtime.  The remainder of the processes (if any)
     23 # will run non-realtime in any case.
     24 
     25 nthread=5000
     26 iter=400
     27 nproc=5
     28 
     29 echo "pthread_cond_many configuration:" | tee -a $LOG_FILE
     30 echo "number of threads = $nthread " | tee -a $LOG_FILE
     31 echo "number of iterations = $iter " | tee -a $LOG_FILE
     32 echo "number of processes = $nproc " | tee -a $LOG_FILE
     33 
     34 # Remove any existing local log files
     35 rm -f $nthread.$iter.$nproc.*.out
     36 
     37 i=0
     38 ./pthread_cond_many --realtime --broadcast -i $iter -n $nthread > $nthread.$iter.$nproc.$i.out &
     39 i=1
     40 while test $i -lt $nproc
     41 do
     42         ./pthread_cond_many --broadcast -i $iter -n $nthread > $nthread.$iter.$nproc.$i.out &
     43         i=`expr $i + 1`
     44 done
     45 wait
     46