https://github.com/riesinger/primus
Small CPU speedometer based on prime calculation
https://github.com/riesinger/primus
Last synced: 9 months ago
JSON representation
Small CPU speedometer based on prime calculation
- Host: GitHub
- URL: https://github.com/riesinger/primus
- Owner: riesinger
- Created: 2015-08-13T14:10:36.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2016-01-02T20:28:28.000Z (over 10 years ago)
- Last Synced: 2024-12-31T12:26:53.583Z (over 1 year ago)
- Language: C++
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# what is primus?
primus is a small benchmarking or CPU heating application. It just calculates prime numbers on multiple (or a single) threads. Use it with the `time` command in front to measure the time it took to calculate.
## Installation
```bash
git clone https://github.com/Arial7/primus
cd primus
make
```
I put different optimization levels directly into the Makefile. Just run
```bash
make O2
```
for example.
ATTENTION!: O3 does wierd things, for me it just removes the whole number calculation. The program instantly finishes, it does nothing at all.
## Usage
The default usage is:
### Benchmarking
```bash
time ./primus
```
where `` is the maximum number to calculate to. I typically use 1.000.000 (without the dots please).
`` is pretty self-explanatory, it is the count of threads to calculate on. On multi-core systems, using more threads is better, as the first threads finish earlier than the last threads. So on my octa-core I typically use 32 threads. To get accurate results. Also, the bigger the number you want to calculate to, the more cores you should use.
### CPU heating
```bash
./primus heat [numberOfThreads]
```
Primus will just calculate primes until you stop it with `^C`.
`[numberOfThreads]` is optional, as primus will try to find out how many cores you have.