Overview

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).

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 (Windows* systems only).
xcode
Contains Xcode* IDE workspace for building and running the example (OS X* systems only).

To Build

General build directions can be found here. 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-2014 Intel Corporation. All Rights Reserved.

Intel is a registered trademark or trademark 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.