Cilk Plus Installation Guide

From SuperTech Wiki

(Difference between revisions)
Jump to: navigation, search
Line 59: Line 59:
** '''Cilkprof:''' <code>$ cilkprof ./cilkprogram</code>
** '''Cilkprof:''' <code>$ cilkprof ./cilkprogram</code>
*** This command generates two csv output files, <code>cilkprogram.bb.csv</code> and <code>cilkprogram.cc.csv</code>, containing work and span profiling data for your Cilk program.  At this time, the data in these files are most easily perused using your favorite spreadsheet program.  For more information on configuring the output of Cilkprof, run <code>$ cilkprof -h</code>.
*** This command generates two csv output files, <code>cilkprogram.bb.csv</code> and <code>cilkprogram.cc.csv</code>, containing work and span profiling data for your Cilk program.  At this time, the data in these files are most easily perused using your favorite spreadsheet program.  For more information on configuring the output of Cilkprof, run <code>$ cilkprof -h</code>.
 +
 +
 +
 +
= <br>The PARSEC Cilkification Project =
 +
We are interested in bringing Cilk parallelization to PARSEC, an industry-strength benchmark suite for emerging projects. The suite contains 13 projects: x264, a H.264 standard-compliant video stream encoder; facesim, a realistic human facial muscle simulation module; raytrace, a ray-tracing engine; vips: an large-image-oritneded image processing engine; freqmine, a data mining engine that can operate online; fluidanimate, a fast fluid animation module in 3D (faster than Joe Stam's algorithm); streamcluster, a clustering algorithm that can operate online; bodytrack, an algorithm to reconstruct the human pose in different video sequences providing a prior knowledge of the skeleton; canneal, a program to improve the circuit routing planning of a particular circuit with the help of the simulated annealing algorithm; swaption, an option pricing simulation engine; blackscholes, a stock market analysis algorithm; dedup, a compression engine that can operate online over a continuous data stream; ferret, an image retrieval engine. We are also interested in finding common patterns in these programs, and make them standard features of the Cilk language.

Revision as of 20:00, 14 June 2012

Intel provides a suite of tools for programming Cilk-based programs. The tool set contains the Intel compiler ICC, the parallelism checker Cilkview, the race condition reporter Cilkscreen, the binary-level instrumentation gadget Pintool, the fine-level instrumentation tool Cilkprof. Here is a guide to install them on a 64-bit Linux.

  • Installation
  1. Install ICC or GCC: You need a license from Intel® in order to install ICC. A free, open-source version is available in the cilkplus branch of GCC.
    • Installing ICC: These instructions assume your shell is bash.
    1. Go to http://software.intel.com/en-us/articles/intel-software-evaluation-center/.
    2. Select "Intel® C++ Composer XE 2011 for Linux" (or any Linux product suite listed as containing "Intel® C++ Composer XE") and download the 64-bit version.
    3. Unpack the downloaded file and run $ /path/to/unpacked/file/install.sh. To allow all users to access ICC on the system, run this install script as root.
    4. Follow the on-screen instructions to install ICC.
    5. To set up your environment variables to use ICC, run $ source /path/to/intel/bin/compilervars.sh intel64.
    • Installing GCC: These instructions walk you through checking out and building the cilkplus branch of GCC. Complete instructions for building GCC from source can be found at http://gcc.gnu.org/install/index.html. These instructions will install GCC into a custom directory, gcc-cilk, so as not to overwrite the existing version of GCC on your system. As a warning, this process takes a while and uses a couple gigabytes of space.
    1. Check out the latest version of the cilkplus branch of GCC.
      $ svn checkout svn://gcc.gnu.org/svn/gcc/branches/cilkplus gcc-cilk-src
      Note: I encountered problems with my connection timing out when I tried to check out the repository from http://gcc.gnu.org/svn/gcc/branches/cilkplus instead of svn://gcc.gnu.org/svn/gcc/branches/cilkplus. If you encounter similar problems, make sure you are using the "svn" protocol, instead of the "http" protocol. If you have previously checked out the gcc cilkplus source using "http," you can switch your checkout to use "svn" by running
      $ svn switch --relocate http://gcc.gnu.org/svn/gcc/branches/cilkplus svn://gcc.gnu.org/svn/gcc/branches/cilkplus
      in the directory containing your checkout. -- TB
    2. Create two new directories, gcc-cilk-obj and gcc-cilk, in the same directory containing gcc-cilk-src.
      $ mkdir gcc-cilk-obj gcc-cilk
    3. Install gmp, mpfr, and mpc on your system.
    4. Configure GCC as follows:
      $ cd gcc-cilk-obj
      $ ../gcc-cilk-src/configure --prefix=../gcc-cilk --enable-languages=c,c++
      Note: You may want to add --disable-multilib to the configuration options if multilib is not installed on your system. Otherwise, you may encounter errors such as:
      gnu/stubs-32.h: No such file or directory compilation terminated.
    5. Compile GCC: $ make
    6. Install GCC into gcc-cilk: $ make install
    7. The new GCC binary is /path/to/gcc-cilk/bin/gcc.
  2. Install Cilkview Cilkscreen: Get it from here: http://software.intel.com/en-us/articles/intel-cilk-plus-software-development-kit/. The include bin directory in PATH.
  3. Install Pintool: Download pintool from here: http://www.pintool.org/downloads.html. Install.
  4. Install Cilkprof: You need Pin revision 43611 in order to run Cilkprof. These instructions include instructions on downloading and installing this version of Pin for Cilkprof.
    1. Change to the directory in which you would like to install Cilkprof.
    2. Create two new directories, cilkutil and 3rdparty.
      $ mkdir cilkutil 3rdparty
    3. Download Pin revision 43611 for Linux from http://www.pintool.org/downloads.html, and place the downloaded archive into 3rdparty.
    4. Download “libzca source to provide access to Cilk metadata” and “cilkprof source example of using Cilk metadata” from http://software.intel.com/en-us/articles/download-intel-cilk-plus-software-development-kit/, and place the downloaded archives into cilkutil.
    5. Run $ cd 3rdparty and then unpack the Pin archive.
    6. Rename the folder created from unpacking the archive to pintool.
    7. Run $ cd ../cilkutil and unpack both archives.
    8. Ensure you have the necessary permissions on the unpacked archives, using chmod.
      $ chmod -R 755 *
    9. Build libzca as follows.
      $ cd zca/src
      $ make OUT=linux64
    10. Build cilkprof as follows.
      $ cd ../../cilkprof
      $ make
    11. Download the cilkprof script from http://web.mit.edu/neboat/www/code/cilkprof, and place it in a directory in your PATH environment variable.
    12. Set the CILKUTIL environment variable to point to the cilkutil directory. For example, if your shell is bash, add the following line to your .bashrc.
      export CILKUTIL=/path/to/cilkutil
  • Brief Usage
    • Compile with ICC: $ icc cilkprogram.cpp -o cilkprogram
    • Check parallelism: $ cilkview ./cilkprogram
    • Check race condition: $ cilkscreen ./cilkprogram
    • Pintool: TO BE COMPLETED
    • Linux perf tool:
      • Show list of counters: $ perf list
      • check L1 data load miss: $ perf stat -c L1-dcache-load-misses ./cilkprogram
    • Cilkprof: $ cilkprof ./cilkprogram
      • This command generates two csv output files, cilkprogram.bb.csv and cilkprogram.cc.csv, containing work and span profiling data for your Cilk program. At this time, the data in these files are most easily perused using your favorite spreadsheet program. For more information on configuring the output of Cilkprof, run $ cilkprof -h.



The PARSEC Cilkification Project

We are interested in bringing Cilk parallelization to PARSEC, an industry-strength benchmark suite for emerging projects. The suite contains 13 projects: x264, a H.264 standard-compliant video stream encoder; facesim, a realistic human facial muscle simulation module; raytrace, a ray-tracing engine; vips: an large-image-oritneded image processing engine; freqmine, a data mining engine that can operate online; fluidanimate, a fast fluid animation module in 3D (faster than Joe Stam's algorithm); streamcluster, a clustering algorithm that can operate online; bodytrack, an algorithm to reconstruct the human pose in different video sequences providing a prior knowledge of the skeleton; canneal, a program to improve the circuit routing planning of a particular circuit with the help of the simulated annealing algorithm; swaption, an option pricing simulation engine; blackscholes, a stock market analysis algorithm; dedup, a compression engine that can operate online over a continuous data stream; ferret, an image retrieval engine. We are also interested in finding common patterns in these programs, and make them standard features of the Cilk language.

Personal tools
Members Only
Off Topic