Is there a mock program that uses the CPU on multiple cores?
I am playing around with htop
, gprof
, etc. I’d like a program that basically just runs on multiple cores so I can profile it and learn how to use these tools. I know I can write my own c++
code with -fopenmp
and run a useless loop, but I was hoping there’s a stock unix command I can use?
Basically I just want a program that uses 100% of however many cores I tell it, until I ask it to stop. Does this exist?
Not stock, but here are a few tool I have used before:
- primes (usually in your distributions games package) just simply fork off a few dozen and it will generate primes from now until forever.
- Stress: http://people.seas.harvard.edu/~apw/stress/
- CPUBurn: http://patrickmylund.com/projects/cpuburn/