Got from IBM DLPAR Tool Set for pSeries:
#!/bin/ksh
# PURPOSE: To produce a CPU-load of up to 100% for all CPUs in the OS instance
# for an input # of seconds.
# SYNTAX: cpuStress.ksh <seconds>
# e.g. cpuStress.ksh 120
# SAMPLE USAGE: onHostsBg "cpuStress.ksh 120"
# COMPONENT OF: IBM pSeries DLPAR Toolset 2.0.1.0, February 2004.
# COPYRIGHT: IBM Corporation, 2002,2003,2004. All rights reserved.
if [[ $# -ne 1 ]] ;
then
echo "SYNTAX: $0 <seconds>"
exit
fi
dir=`dirname $0`
cpus=`lsdev -Cc processor -S a | wc -l`
sec=$1;
while [[ $i -le $cpus ]]
do
$dir/loopFor $sec &
(( i = $i + 1 ))
done
And you need compile this:
/* PURPOSE: To use up a CPU via looping for an input number of seconds.
* SYNTAX: loopFor <seconds>
* COMPONENT OF: IBM pSeries DLPAR Toolset 2.0.1.0, February 2004.
* COPYRIGHT: IBM Corporation, 2002,2003,2004. All rights reserved.
*/
#include <stdio.h>
#include <time.h>
int main (argc, argv)
int argc ; /* # arguments */
char *argv[]; /* Argument list */
{
int x = 4;
int y, i, sec1, sec2, sec;
time_t t1, t2;
struct tm *timep1, *timep2;
sec = (int) atoi(argv[1]);
if (argc != 2 )
{
printf("SYNTAX: loopFor <seconds>\n");
return(-1);
}
t1= time(NULL);
timep1 = localtime(&t1);
sec1 = timep1->tm_hour * 3600 + timep1->tm_min * 60 + timep1->tm_sec;
for (;

{ y = x * x ;
y = y/x ;
t2 = time(NULL);
timep2 = localtime(&t2);
sec2 = timep2->tm_hour * 3600 + timep2->tm_min * 60 + timep2->tm_sec;
if ( (sec2 - sec1) >= sec )
{
return 0;
}
}
}
If you need compiled version get it from dlparToolset2010.tar.gz which you can download from:
r, m.