#!/usr/bin/ksh93 # rperf version 4 # No restrictions, copy and use at will, this is just sample code. # No warrentee given or implied. machine=`lsattr -El sys0 -a modelname -F value` cpus=`lsdev -Cc processor | grep Available | wc -l | sed 's/ //g'` procstr=`lsdev -Cc processor | head -1 | cut -d' ' -f1` proctype=`lsattr -El $procstr | awk '/^type/ {print $2}'` Hz=`lsattr -El ${procstr%% *} -a frequency -F value` # Ensure that procspeed is not null, since the conversion to MHz below will # cause the script to exit with an error if null. if [[ ! -z $Hz ]] then # Convert Hz to MHz, and round up or down if (( ($Hz%1000000) >= 500000 )) then (( MHz=($Hz/1000000) + 1 )) else (( MHz=($Hz/1000000) )) fi else echo MHz rating is not available, exiting exit 2 fi # break the MHz in to the first two digits (enough for the lookup) and the rest dd=${MHz:0:2} ff=${MHz:2:9} # This first attempt does not round up the lower digits! # ff=${ff//[0-9]/0} # so below we round down, round up and round to 50 if(( $ff < 10 )) # if below 10 i.e. 01 and 09 round down then ff=${ff//[0-9]/0} elif(( $ff > 90 )) # if bigger than 90 round up then ff=${ff//[0-9]/0} let dd=$dd+1 elif(( $ff > 40 )) then if(( $ff < 60 )) # near 50 so make it 50 then ff=50 fi fi roundedMHz=$dd$ff lookup=${machine}_${roundedMHz}_${cpus} # Debug lines for testing machines other than the current one # lookup=IBM,9119-595_2300_1 # cpus=3 if [ "$1" == "-?" ] then echo "rperf -v -?" echo -v = verbose mode echo -? = this output echo rperf outputs the performance number of the current machine or LPAR echo "either Relative Performance (rPerf)" echo " or Relative OLTP (roltp)" echo Depending on the age of the machine. echo There is no simple way to convert from rolpt to rPerf - sorry. echo echo If it says estimated then it is NOT an offical number echo LPARs the number may be estimated but it is a simple maths calculation echo i.e. if we have the offical number for 4 CPUs then 1 CPU is simply echo a fourth - this will be an under estimate. echo echo If you find bugs or missing information please let us know. echo Perferred mechanism found at http://www.ibm.com/systems/p/community/ echo AIX Performance Tools Forum echo AIX Wiki echo e-mail to nag@uk.ibm.com exit fi if [ "$1" == "-v" ] then echo Information is from two public documents from www.ibm.com echo -- - System p Performance Report echo -- - System p Facts and Features Document echo Machine=$machine MHz=$MHz Rounded-MHz=$roundedMHz CPUs=$cpus CPUType=$proctype echo lookup $lookup fi # below is the default but changed to roltp or estimated where necessary units=rPerf lookup1() { if [ "$1" == "" ] then return fi if((cpus==$1)) then rating=$2 return fi if((cpus<$1)) then let rating=$2/$1*$cpus; estimated="estimated" fi } matchup() { # Debug echo matchup $1 $2 $3 $4 $5 $6 $7 $8 $9 $10 $11 $12 $13 $14 arguments= $# rating=0 if(($#>=2)) then lookup1 $1 $2 ; fi; if((rating != 0)) then return; fi; if(($#>=4)) then lookup1 $3 $4 ; fi; if((rating != 0)) then return; fi; if(($#>=6)) then lookup1 $5 $6 ; fi; if((rating != 0)) then return; fi; if(($#>=8)) then lookup1 $7 $8 ; fi; if((rating != 0)) then return; fi; if(($#>=10)) then lookup1 $9 $10 ; fi; if((rating != 0)) then return; fi; if(($#>=12)) then lookup1 $11 $12 ; fi; if((rating != 0)) then return; fi; if(($#>=14)) then lookup1 $13 $14 ; fi; } case $lookup in IBM,7043-150_250_1) rating=0.18;; IBM,7043-150_375_1) rating=0.26;; IBM,7043-260_200_1) rating=10.5; units=roltp ;; IBM,7043-260_200_2) rating=21.0; units=roltp ;; IBM,7044-170_333_1) rating=0.58 ;; IBM,7044-170_400_1) rating=0.73 ;; IBM,7044-170_450_1) rating=0.79 ;; IBM,7044-270_375_1) rating=1.00 ;; IBM,7044-270_375_2) rating=1.92 ;; IBM,7044-270_375_3) rating=2.55 ;; IBM,7044-270_375_4) rating=3.47 ;; IBM,7044-270_375_2) rating=1.99 ;; IBM,7044-270_375_4) rating=3.59 ;; IBM,7044-270_450_2) rating=2.27 ;; IBM,7044-270_450_4) rating=4.01 ;; IBM,7025-F80_450_1) rating=23.0; units=roltp ;; IBM,7025-F80_450_2) rating=50.0; units=rolpt ;; IBM,7025-F80_450_4) rating=87.7; units=roltp ;; IBM,7025-F80_500_6) rating=111.9; units=roltp ;; IBM,7025-F80_600_1) rating=32.3; units=roltp ;; IBM,7025-F80_600_2) rating=69.0; units=rolpt ;; IBM,7025-F80_600_4) rating=117.0; units=roltp ;; IBM,7025-F80_500_6) rating=191.2; units=roltp ;; IBM,7025-6F0_450_1) rating=0.93 ;; IBM,7025-6F0_450_2) rating=2.02 ;; IBM,7025-6F0_450_4) rating=3.55 ;; IBM,7025-6F0_600_1) rating=1.26 ;; IBM,7025-6F0_600_2) rating=2.69 ;; IBM,7025-6F0_600_4) rating=4.57 ;; IBM,7025-6F0_750_1) rating=1.91 ;; IBM,7025-6F0_750_2) rating=3.49 ;; IBM,7025-6F0_750_4) rating=5.85 ;; IBM,7025-6F1_450_1) rating=0.93 ;; IBM,7025-6F1_450_2) rating=2.02 ;; IBM,7025-6F1_450_4) rating=3.55 ;; IBM,7025-6F1_668_6) rating=7.46 ;; IBM,7025-6F1_600_1) rating=1.26 ;; IBM,7025-6F1_600_2) rating=2.69 ;; IBM,7025-6F1_600_4) rating=4.57 ;; IBM,7025-6F1_750_1) rating=1.91 ;; IBM,7025-6F1_750_2) rating=3.49 ;; IBM,7025-6F1_750_4) rating=5.85 ;; IBM,7025-6F1_750_6) rating=8.23 ;; IBM,7017-S80_450_6) rating=161.7; units=rolpt ;; IBM,7017-S80_450_12) rating=306.7; units=rolpt ;; IBM,7017-S80_450_18) rating=428.7; units=rolpt ;; IBM,7017-S80_450_24) rating=533.3; units=rolpt ;; IBM,7017-S80_600_6) rating=219.0; units=rolpt ;; IBM,7017-S80_600_12) rating=416.0; units=rolpt ;; IBM,7017-S80_600_18) rating=583.3; units=rolpt ;; IBM,7017-S80_600_24) rating=736.0; units=rolpt ;; # JLB P670 ref IBM : fact and features february 8, 2005 IBM,7040-671_1500_*) matchup 4 13.66 8 24.18 16 46.79 0 0 ;; IBM,7040-681_1100_*) matchup 8 18.02 16 34.66 24 48.11 32 60.66 0 0 ;; IBM,7040-681_1300_*) matchup 8 21.20 16 40.92 24 56.46 32 71.44 0 0 ;; IBM,7040-681_1500_*) matchup 8 24.18 16 46.79 24 64.99 32 81.95 0 0 ;; IBM,7040-681_1700_*) matchup 8 27.11 16 52.45 24 2.86 32 92.19 0 0 ;; IBM,7040-681_1900_*) matchup 8 30.63 16 59.26 24 82.32 32 104.17 0 0 ;; IBM,9115-505_1500_2) rating=9.13 ;; # The 1 CPU zero L2 cache model has a low rPerf #- here we assume it is not popular and you have a an 1 VP CPU LPAR # IBM,9115-505_1650_1) rating=3.51 ;; IBM,9115-505_1650_1) let rating=9.86/2; estimated="estimated i.e. assuming its not the 1 CPU with zero L2 model" ;; IBM,9115-505_1650_*) matchup 2 9.86 4 20.25 0 0 ;; IBM,9115-505_1900_*) matchup 1 4.10 2 11.49 0 0 ;; IBM,9115-505_2100_*) lookup1 2 12.46 ;; IBM,9110-51A_1500_*) matchup 1 3.25 2 9.13 4 18.75 ;; IBM,9110-510_1650_*) matchup 1 5.24 2 9.86 4 20.25 ;; IBM,9110-51A_1900_*) lookup1 1 6.11 ;; IBM,9110-51A_2100_*) matchup 1 6.63 2 12.46 0 0 ;; IBM,9111-520_1500_*) matchup 1 3.25 2 9.13 0 0 ;; IBM,9111-520_1650_*) lookup1 2 9.86 ;; IBM,9131-52A_1650_*) matchup 1 3.62 2 10.15 4 20.25 ;; IBM,9131-52A_1500_*) matchup 2 11.16 4 18.75 0 0 ;; IBM,9131-52A_2100_*) matchup 1 6.63 2 12.46 0 0 ;; IBM,9133-55A_1500_*) matchup 4 18.20 8 34.46 0 0;; IBM,9133-55A_1650_*) matchup 2 10.15 4 20.25 8 38.34 ;; IBM,9133-55A_1900_*) matchup 2 11.16 4 22.26 0 0 ;; IBM,9133-55A_2100_*) matchup 2 12.46 4 24.86 0 0;; IBM,9113-550_1500_*) matchup 1 3.25 2 9.13 4 18.20 ;; IBM,9113-550_1650_*) matchup 2 9.86 4 19.66 0 0 ;; IBM,9116-561_1500_*) matchup 4 18.75 8 35.50 16 65.24 ;; IBM,9116-561_1800_*) matchup 4 21.72 8 41.12 16 75.58 ;; IBM,9117-570_1500_*) matchup 2 9.13 4 18.20 8 34.46 ;; IBM,9117-570_1650_*) matchup 2 9.86 4 19.66 8 37.22 12 53.43 16 68.40 ;; # darn we have two machines at same MHz for POWER5 and POWER5+ IBM,9117-570_1900_*) if [ $proctype == "POWER5+" ] then matchup 2 12.27 4 24.18 8 46.36 12 66.55 16 95.96 else matchup 2 11.16 4 22.26 8 42.14 12 60.50 16 77.45 fi;; IBM,9117-570_2100_*) matchup 2 13.83 4 27.58 8 52.21 12 74.95 16 95.96;; IBM,9119-590_1650_*) matchup 8 41.68 16 80.86 24 16.29 32 151.72 0 0 ;; IBM,9119-590_2100_*) matchup 8 55.74 16 108.13 24 155.51 32 202.88 0 0 ;; IBM,9119-595_1650_*) matchup 16 80.86 24 116.29 32 151.72 40 182.07 48 212.41 56 242.76 64 273.10;; IBM,9119-595_1900_*) matchup 16 90.67 24 130.39 32 170.11 40 204.14 48 238.16 56 272.18 64 306.21;; IBM,9119-595_2100_*) matchup 16 108.13 24 155.51 32 202.88 40 243.46 48 284.04 56 324.61 64 365.19;; IBM,9119-595_2300_*) matchup 16 116.13 24 167.58 32 218.64 40 262.37 48 306.10 56 349.83 64 393.55 ;; # JS21 Blades IBM,7988-J21_2700_*) matchup 2 5.31;; IBM,7988-J21_2500_*) matchup 4 8.72;; # POWER6 # JS12 and JS22 IBM,7998-60X_3800_*) matchup 2 14.71;; IBM,7998-61X_4000_*) matchup 4 30.26;; # 520 IBM,8203-E4A_4200_*) matchup 1 8.39 2 15.95 4 31.48 ;; # 550 IBM,8204-E8A_3500_*) matchup 2 15.85 4 31.27 6 45.04 8 58.80;; IBM,8204-E8A_4200_*) matchup 2 18.38 4 36.28 6 52.24 8 68.20;; # 570 IBM,9117-MMA_3500_*) matchup 2 15.85 4 31.69 8 58.95 12 83.35 16 105.75 ;; IBM,9117-MMA_4200_*) matchup 2 18.38 4 36.76 8 68.38 12 96.68 16 122.67 ;; IBM,9117-MMA_4700_*) matchup 2 20.13 4 40.26 8 74.89 12 105.89 16 134.35 ;; # 595 IBM,9119-FHA_4200_*) matchup 8 75.58 16 142.90 32 266.51 48 373.60 64 479.89 ;; IBM,9119-FHA_5000_*) matchup 8 87.10 16 164.67 32 307.12 48 430.53 64 553.01 ;; *) rating=unknown; units=unknown;; esac if (( $rating == 0 )) then rating=unknown units=unknown fi printf "%.2f %s %s\n" $rating $units $estimated