1#! /bin/bash 2 3if [ ! $SCRIPTS_DIR ]; then 4 # assume we're running standalone 5 export SCRIPTS_DIR=../../scripts/ 6fi 7 8source $SCRIPTS_DIR/setenv.sh 9LOG_FILE="$LOG_DIR/$LOG_FORMAT-pthread_cond_many.log" 10 11echo "Logging to: " | tee -a $LOG_FILE 12echo "$LOG_FILE " | tee -a $LOG_FILE 13echo "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# 18make 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 25nthread=5000 26iter=400 27nproc=5 28 29echo "pthread_cond_many configuration:" | tee -a $LOG_FILE 30echo "number of threads = $nthread " | tee -a $LOG_FILE 31echo "number of iterations = $iter " | tee -a $LOG_FILE 32echo "number of processes = $nproc " | tee -a $LOG_FILE 33 34# Remove any existing local log files 35rm -f $nthread.$iter.$nproc.*.out 36 37i=0 38./pthread_cond_many --realtime --broadcast -i $iter -n $nthread > $nthread.$iter.$nproc.$i.out & 39i=1 40while test $i -lt $nproc 41do 42 ./pthread_cond_many --broadcast -i $iter -n $nthread > $nthread.$iter.$nproc.$i.out & 43 i=`expr $i + 1` 44done 45wait 46