## Overview

Parallel seismic wave simulation that demonstrates use of parallel_for and affinity_partitioner.
The example can be built in the offload version to run on Intel® Many Integrated Core (Intel® MIC) Architecture based coprocessor (see build instructions). NOTE: Currently, the offload version does not support GUI and can only be used with console mode.

## Files

main.cpp
  Main program which parses command line options and runs the algorithm with different numbers of threads.
universe.h
  Wave propagation methods interface.
universe.cpp
  Wave propagation methods implementation.
seismic_video.h
  GUI mode support interface.
seismic_video.cpp
  GUI mode support implementation.
Makefile
  Makefile for building example.

## Directories

msvs
  Contains Microsoft* Visual Studio* 2010 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. The following additional options are supported:

`make [(general targets: {release, debug} [test])] UI={con, gdi, d2d, x, mac}`
  Build and run as usual, but build with the specified GUI driver: console, GDI+*, Direct2D*, X11, or OpenGL* (see the description of the common GUI code for more information on available graphics support). For Linux* and OS X* systems, the best available driver is detected automatically by the Makefile. For Windows* systems, UI=gdi is the default GUI driver; compiling with UI=d2d may offer superior performance, but can only be used if the Microsoft* DirectX* SDK is installed on your system and if overlay is supported by your graphics card. Use UI=con to build without the GUI for use in making performance measurements (strongly recommended when measuring performance or scalability; see note below).
`make [(above options or targets)] XARCH=x64`
  Build and run as above, but also specify XARCH=x64 (or XARCH=AMD64 for older compilers) when building the example on Windows* as a 64-bit binary.
`make [(above options or targets)] DDLIB_DIR=<specify path to library directory of Direct Draw* SDK here>`
  If you experience ddraw.lib linking problems, specify the correct library directory via this option.
`make [(above options or targets)] CXXFLAGS=-DX_FULLSYNC`
  Build and run as above, but enable full X11 synchronization if you experience "tearing" of motion on slower video systems.

## Usage

`seismic -h`
  Prints the help for command line options
`seismic [n-of-threads=value] [n-of-frames=value] [silent] [serial]`
`seismic [n-of-threads [n-of-frames]] [silent] [serial]`
  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.
  n-of-frames is a number of frames the example processes internally.
  silent - no output except elapsed time.
  serial - in GUI mode start with serial version of algorithm.
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 the desired number of threads and smaller number of frames, e.g., `seismic 4 5`.

## Hot keys

The following hot keys can be used in interactive execution mode when the example is compiled with the graphical user interface:

<left mouse button>
  Starts new seismic wave in place specified by mouse cursor.
<space>
  Toggles between parallel and serial execution modes.
<p>
  Enables parallel execution mode.
<s>
  Enables serial execution mode.
<e>
  Enables screen updates.
<d>
  Disables screen updates (strongly recommended when measuring performance or scalability; see note below).
<esc>
  Stops execution.

## Notes

- While running with the GUI display turned on should yield reasonable performance in most cases, running with the GUI display turned off is strongly recommended in order to demonstrate the full performance and scalability of the example.

Up to parent directory

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