Back to Taskflow

Intel® Threading Building Blocks.Primes sample

3rd-party/tbb/examples/parallel_reduce/primes/readme.html

4.0.02.5 KB
Original Source

Intel® Threading Building Blocks. Primes sample

Parallel version of the Sieve of Eratosthenes.

The example can be built in the offload version to run on Intel® Many Integrated Core (Intel® MIC) Architecture based coprocessor (see build instructions).

System Requirements

For the most up to date system requirements, see the release notes.

Files

main.cppMain program which parses command line options and runs the algorithm with different numbers of threads. primes.hThe Sieve of Eratosthenes interface. primes.cppThe Sieve of Eratosthenes implementation. MakefileMakefile for building the example.

Directories

msvsContains Microsoft* Visual Studio* workspace for building and running the example (Windows* systems only). xcodeContains Xcode* IDE workspace for building and running the example (macOS* systems only).

For information about the minimum supported version of IDE, see release notes.

Build instructions

General build directions can be found here.

Usage

primes _-h_Prints the help for command line options primes [n-of-threads=value] [number=value] [grain-size=value] [n-of-repeats=value] [silent]primes [n-of-threads [number [grain-size [n-of-repeats]]]][silent]n-of-threads is the number of threads to use; a range of the form low[:high], where low and optional high are non-negative integers or 'auto' for a platform-specific default number.
number is an upper bound of range to search primes in, must be a positive integer.
grain-size is an optional grain size, must be a positive integer.
n-of-repeats is a number of the calculation repeats, must be a positive integer.
silent - no output except elapsed time.
To run a short version of this example, e.g., for use with Intel® Parallel Inspector: Build a debug version of the example (see the build instructions).
Run it with a small problem size and the desired number of threads, e.g., primes 4 100000.

Up to parent directory


Legal Information

Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and/or other countries.
* Other names and brands may be claimed as the property of others.
© 2020, Intel Corporation