https://github.com/rootmos/primes
Personal project for playing around with C++11, STL and what-not. Experts be warned of ugly code!
https://github.com/rootmos/primes
Last synced: over 1 year ago
JSON representation
Personal project for playing around with C++11, STL and what-not. Experts be warned of ugly code!
- Host: GitHub
- URL: https://github.com/rootmos/primes
- Owner: rootmos
- License: gpl-3.0
- Created: 2014-06-23T05:36:58.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2014-08-03T10:02:05.000Z (almost 12 years ago)
- Last Synced: 2025-01-26T16:12:58.440Z (over 1 year ago)
- Language: C++
- Homepage:
- Size: 3.41 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog
- License: COPYING
Awesome Lists containing this project
README
Primes!
=======
To compile:
-----------
### Fetch the [cppformat](https://github.com/cppformat/cppformat) library.
```
git submodule update --init
```
### In debug mode
```
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug
make
```
### In release mode
```
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make
```
To run tests:
-------------
Unzip the test file:
```
gunzip 2000000.txt.gz
```
Mount a tmpfs/ramfs for extra speed:
```
mkdir tmp
sudo mount -t tmpfs tmpfs tmp
```
Run the tests with the `run` command. The parameters are as follows:
1. Number of repetitions
2. Range of sieving threads, formated as "1 7" meaning that we try from 1 to 7 threads.
3. Range of threads converting uints to strings in the same format as above.
4. Range of chunks for the threads specified as above in 100000:s.
5. The binary to try
For example:
```
./run 10 "1 7" "1 7" "1 10" src/primes
```
Then the test output will be in the newly created `tests` folder.