All pastes #402294 Raw Edit

Untitled

public text v1 · immutable
·published 2007-03-19 20:45 UTC
rendered paste body
# !/bin/bash

# how many cpu cores are in the machine?
CPU=`/bin/cat /proc/cpuinfo | /bin/grep proc | /bin/awk '{ print $3 }' | /usr/bin/tail -n 1`

CPU=$(($CPU + 1))

# gather serial output from watts-up and add date for logging

#cat /dev/ttyS0 | ./timestamp.pl >> log/time-outputs.log &

cat /dev/ttyS0 >> log/outputs.log &

# Idle run for base line measurment
echo "#IDLE START $DATE" >> log/outputs.log
echo "Starting IDLE Measurment for 10min"
echo "Please DO NOT CTRL-C "
date
sleep 10m
echo "#IDLE END $DATE" >> log/outputs.log

# run as many instances as there are cpu cores in the machine
# Start Dhrystone

echo "#DHRYSTONE START $DATE" >> log/outputs.log
echo "Starting $CPU instances of Dhrystone"
echo "The screen will not have any output during this test for 10min"
echo "Please DO NOT CTRL-C"
date

for ((i=1; i <= CPU ; i++))
do
        sh dodhry.sh 2>&1 > /dev/null &
done

sleep 10m
echo "Killing Dhrystone, 2min cool down till next test"

for i in `ps aux | grep dhry | grep -v grep | awk '{ print $2 }'`; do
	kill $i 2>&1 > /dev/null
done

echo "#DHRYSTONE END $DATE" >> log/outputs.log
sleep 120

# Start LinPack

echo "#LINPACK START $DATE" >> log/outputs.log
echo "Starting $CPU instances of LinPack"
echo "The screen will not have any output during this test for 10min"
echo "Please DO NOT CTRL-C"
date

for ((i=1; i <= CPU ; i++))
do
	sh dolinpack.sh 2>&1 > /dev/null &
done

sleep 10m
echo "Killing Linpack, 2min cool down till next test"

for i in `ps aux | grep do | grep -v grep | awk '{ print $2 }'`; do
	kill $i 2>&1 > /dev/null
done

for i in `ps aux | grep lpc | grep -v grep | awk '{ print $2 }'`; do
	kill $i 2>&1 > /dev/null
done

echo "#LINPACK END $DATE" >> log/outputs.log
sleep 120

# Start BurnP6 or BurnK7 depending one the proc type

echo "#BURNK7 START $DATE" >> log/outputs.log
echo "Starting $CPU instances of BurnK7 or BurnP6 depending on your processor"
echo "The screen will not have any output during this test for 10min"
echo "Please DO NOT CTRL-C"
date

if cat /proc/cpuinfo | grep vendor_id | grep AuthenticAMD 2>&1 > /dev/null; then
	for ((i=1; i <= CPU ; i++))
	do
	cpuburn-1.4/burnK7 &
	done
else
	for ((i=1; i <= CPU ; i++))
	do
	cpuburn-1.4/burnP6 &
	done
fi

sleep 10m
echo "Killing Burn"
pkill burn
echo "#BURNK7 END $DATE" >> log/outputs.log

# Idle end measurment

echo "Start IDLE Measurment for 10min"
echo "#IDLE START $DATE" >> log/outputs.log
date
sleep 10m
echo "#IDLE STOP $DATE" >> log/outputs.log
# kill wattsup input info gathering

for i in `ps aux | grep ttyS0 | grep -v grep | awk '{ print $2 }'` ; do
	kill $i
done

pkill timestamp.pl

sed log/outputs.log -e 's/,/ /g' > log/gnuplot-outputs.txt
sed -i log/gnuplot-outputs.txt -e 's/#d//g'

echo "Power testing is complete please gather the logs from log/"