Overview
Parallel version of the Sieve of Eratosthenes.
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 example.
Directories
- msvs
- Contains Microsoft* Visual Studio* 2005 workspace for building and running the example.
- xcode
- Contains Xcode* IDE workspace for building and running the example.
To Build
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 directions).
Run it with a small problem size and the desired number of threads, e.g., primes 4 100000.
Up to parent directory
Copyright © 2005-2011 Intel Corporation. All Rights Reserved.
Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are
registered trademarks or trademarks of Intel Corporation or its
subsidiaries in the United States and other countries.
* Other names and brands may be claimed as the property of others.