# 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.cpp
  Main program which parses command line options and runs the algorithm with different numbers of threads.
primes.h
  The Sieve of Eratosthenes interface.
primes.cpp
  The Sieve of Eratosthenes implementation.
Makefile
  Makefile for building the example.

Directories

msvs
  Contains Microsoft* Visual Studio* workspace for building and running the example (Windows* systems only).
xcode
  Contains 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 the TBB default.
  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.
© 2017, Intel Corporation