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.

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.
xcode
Contains Mac OS* Xcode* workspace for building and running the example.

To Build

General build directions can be found here.

Usage

sudoku [N]
sudoku inputfile N S [-p]
N is the number of threads to be used. S is the number of solutions to find: 1 finds the first, any other number will find all solutions. -p prints the first solution (optional argument)
To run a short version of this example, e.g., for use with Intel® Threading Tools:
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 input2 4.

Up to parent directory

Copyright © 2005-2010 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.