Back to Taskflow

Intel® Threading Building Blocks.Sudoku sample

3rd-party/tbb/examples/task_group/sudoku/readme.html

4.0.02.7 KB
Original Source

Intel® Threading Building Blocks. Sudoku sample

This directory contains a simple example that finds all solutions to a Sudoku board.

It uses a straightforward state-space search algorithm that exhibits OR-parallelism. It can be optionally run until it obtains just the first solution. The point of the example is to teach how to use the task_group interface.

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

sudoku.cppDriver. input1Sample input file with modest number of solutions. input2Sample input file with small number of solutions. input3Sample input file with larger number of solutions. input4Sample input file with very large number of solutions. MakefileMakefile for building the example.

Directories

msvsContains Microsoft* Visual Studio* workspace for building and running the example with the Intel® C++ Compiler (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

sudoku _-h_Prints the help for command line options sudoku [n-of-threads=value] [filename=value] [verbose] [silent] [find-one]sudoku [n-of-threads [filename]] [verbose] [silent] [find-one]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.
filename is an input filename.
verbose - prints the first solution.
silent - no output except elapsed time.
find-one - stops after finding first solution.
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., sudoku 4 input2.

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