examples/parallel_for/tachyon/README.md
Parallel raytracer / renderer that demonstrates the use of parallel_for.
This example includes software developed by John E. Stone.
This example is a 2-D raytracer/renderer that visually shows different parallel scheduling methods and their resulting speedup. The code was parallelized by speculating that each pixel could be rendered in parallel. The resulting parallel code was then checked for correctness by using Intel® Thread Checker, which pointed out where synchronization was needed. Minimal synchronization was then inserted into the parallel code. The resulting parallel code exhibits good speedup.
cmake <path_to_example> [EXAMPLES_UI_MODE=value]
cmake --build .
EXAMPLES_UI_MODE - defines the GUI mode, supported values are gdi, d2d, con on Windows, x,con on Linux and mac,con on macOS. The default mode is con. See the common page to get more information.
TACHYON_VERSION - this examples contains several version that may be changed via TACHYON_VERSION Cmake variable.
blocked_range to parallelize over tasks that are groups of scan-lines.blocked_range2d to parallelize over tasks that are rectangular sub-areas.make run_tachyon - executes the example with predefined parameters.make perf_run_tachyon - executes the example with suggested parameters to measure the oneTBB performance once.make light_test_tachyon - executes the example with suggested parameters to reduce execution time.make benchmark_tachyon - executes the example with suggested parameters to repeat performance measurements several times and report their relative error.make benchmark_tachyon_data - same as benchmark_tachyon saving results into benchmark_tachyon_data.csv file.Usage:
tachyon [dataset=value] [boundthresh=value] [no-display-updating] [no-bounding] [silent] [-h] [dataset [boundthresh]]
-h - Prints the help for command line options.dataset - path/name of one of the *.dat files in the dat directory for the example.boundthresh - bounding threshold value.no-display-updating - disable run-time display updating.no-bounding - disable bounding technique.n-of-repeats - how many times to repeat rendering to collect its reliable performance statistics.The tbb and tbb1d version of examples has the following settings that may be handled by environment variables:
TBB_NUM_THREADS environment variable to the desired number of threads before running.auto_partitioner by default. To change this default, set the TBB_PARTITIONER environment variable to the aff value to use affinity_partitioner and to simp to use simple_partitioner.TBB_GRAINSIZE environment variable to the desired grain size before running. The grain size corresponds to the number of pixels (in the X or Y direction, for a rectangular sub-area) in each parallel task.The following hot keys can be used in interactive execution mode when the example is compiled with the graphical user interface:
any key - enable repetition of rendering after the pause. Press ESC to stop the application.space - toggle run-time display updating mode while rendering (see no-display-updating above).p - holds the picture after rendering completion. Press 'p' again to continue.esc - stop execution.