Overview
- 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).
Files
- sudoku.cpp
- Driver.
- input1
- Sample input file with modest number of solutions.
- input2
- Sample input file with small number of solutions.
- input3
- Sample input file with larger number of solutions.
- input4
- Sample input file with very large number of solutions.
- Makefile
- Makefile for building example.
Directories
- msvs
- Contains Microsoft* Visual Studio* 2008 workspace for building and running the example with the Intel® C++ compiler (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.
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 the TBB default.
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 directions).
Run it with a small problem size and the desired number of threads, e.g., sudoku 4 input2.
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.