Pluto: An automatic polyhedral parallelizer and locality optimizer
C Python C++ Shell Ruby Fortran Other
Latest commit a372de9 Oct 24, 2016 @bondhugula fix warnings
Signed-off-by: Uday Bondhugula <uday@csa.iisc.ernet.in>
Permalink
Failed to load latest commit information.
annotations Remove orio generated files Aug 11, 2010
candl @ e5a9b8a update piplib, candl and openscop modules; switch piplib repo url Mar 30, 2016
clan @ 42a7d0c update clan submodule May 30, 2016
cloog-isl @ dbb85eb update cloog-isl submodule Aug 8, 2014
doc update doc/submittingpatches Oct 17, 2015
examples 3d27pt - fix comment Sep 19, 2016
include/pluto libpluto API extensions for info on stmt structures Oct 24, 2016
isl @ 1b3ba3b update isl and cloog-isl submodules Aug 8, 2014
m4 add m4 dir to repository Feb 29, 2012
openscop @ 1ac1154 update piplib, candl and openscop modules; switch piplib repo url Mar 30, 2016
orio-0.1.0 Remove orio generated files again Aug 12, 2010
patches update apply_patches.sh and isl dim wise pw aff patch Dec 15, 2015
piplib @ 77aca10 update piplib submodule to may 19 2016 77aca1050c4fc51abb9a6822871614… Jun 23, 2016
polylib @ 9dffa45 add polylib Jul 23, 2013
src fix warnings Oct 24, 2016
test add high order stencil test caes in test/ Oct 2, 2016
tuner 4d tuner Dec 17, 2015
.gitignore test_plutolib Jul 28, 2012
.gitmodules update piplib, candl and openscop modules; switch piplib repo url Mar 30, 2016
ACKS 0.11.0 release May 30, 2014
AUTHORS update email Jan 28, 2015
COPYING update license to GPL v3 Jul 23, 2013
ChangeLog 0.11.4 release Oct 28, 2015
INSTALL 0.11.4 release Oct 28, 2015
LICENSE update license to GPL v3 Jul 23, 2013
LICENSE.LGPL2 LGPLv2 for libpluto Jul 28, 2012
Makefile.am update make test script Mar 31, 2016
NEWS Initializing repository Aug 7, 2010
README update README pre-reqs Oct 1, 2016
apply_patches.sh update apply_patches.sh and isl dim wise pw aff patch Dec 15, 2015
autogen.sh update autogen.sh - reorder + output Aug 20, 2014
configure.ac configure piplib with dp and gmp but not with sp Jun 22, 2016
getversion.sh.in update getversion.sh.in Jul 31, 2012
inscop Changes to inscop that caused issues when working with files already … Feb 14, 2014
plann update license to GPL v3 Jul 23, 2013
ploog update license to GPL v3 Jul 23, 2013
plorc Change license to GPL v2+ Nov 1, 2010
plutune Initializing repository Aug 7, 2010
polycc.sh.in polycc.sh.in minor update Jun 6, 2015
recloog Initializing repository Aug 7, 2010
test-iss.sh put iss impl in master branch Nov 8, 2014
test.sh lose test/deep.c from test.sh Mar 31, 2016
vloog update license to GPL v3 Jul 23, 2013

README

#
# Pluto README
#
# Uday Bondhugula
# uday@csa.iisc.ernet.in
#

LICENSE

Pluto is available under GPL v3, and libpluto is available under LGPL v2.1.

INSTALLING PLUTO

PREREQUISITES

A Linux distribution. Pluto has been tested on x86 and x86-64 machines 
running Fedora, Ubuntu, and RedHat Enterprise Server.  Solaris should also 
be fine if you have GNU utilities. In order to use the development version 
from Pluto's git repository, automatic build system tools including 
autoconf, automake, and libtool are needed. GMP (GNU multi precision 
arithmetic library) is needed by ISL (one of the included libraries). If 
it's not already on your system, it can be installed easily with, for 
eg., eg., 'sudo yum -y install gmp gmp-devel' on a Fedora. It is also 
recommended astyle and indent be installed if a user wishes to browse 
through generated code.

Pluto includes all polyhedral libraries that it depends on.


BUILDING PLUTO

Stable release

$ tar zxvf pluto-0.11.4.tar.gz
$ cd pluto-0.11.4/
$ ./configure
$ make
$ make test

configure can be provided --with-isl-prefix=<isl install location> to 
build with another isl, otherwise the bundled isl is used.

Development version from Git

$ git clone git://repo.or.cz/pluto.git
$ cd pluto/
$ git submodule init 
$ git submodule update
$ ./autogen.sh
$ ./configure [--enable-debug] [--with-isl-prefix=<isl install location>]
$ make
$ make test

* --with-isl-prefix=<location> to compile and link with an already installed 
isl. By default, the version of isl bundled with Pluto will be used.

'polycc' is the wrapper script around src/pluto (core transformer) and all 
other components. 'polycc' runs all of these in sequence on an input C 
program (with the section to  parallelize/optimize marked) and is what a 
user should use on input. Output generated is OpenMP parallel C code that 
can be readily compiled and run on shared-memory parallel machines like 
general-purpose multicores. libpluto.{so,a} is also built and can be found 
in src/.libs/. 'make install' will install it.


TRYING A NEW CODE

- Use '#pragma scop' and '#pragma endscop' around the section of code 
  you want to parallelize/optimize.

- Then, just run 
    
    ./polycc <C source file> --parallel --tile

  The transformation is also printed out, and test.par.c will have the 
  parallelized code. If you want to see intermediate files, like the 
  .cloog file generated (.opt.cloog, .tiled.cloog, or .par.cloog 
  depending on command-line options provided), use --debug on command 
  line.

- Tile sizes can be specified in a file 'tile.sizes', otherwise default 
  sizes will be set. See doc/DOC.txt on how to specify the sizes.

To run a good number of experiments on a code, it is best to use the setup 
created for example codes in the examples/ directory.  If you do not have 
ICC (Intel C compiler), uncomment line 7 and comment line 
8 of examples/common.mk to use GCC.

- Just copy one of the sample directories in examples/, edit Makefile (SRC = 
  )

- do a make (this will build all executables; 'orig' is the original code 
  compiled with the native compiler, 'tiled' is the tiled code, 'par' is the 
  OpenMP parallelized+locality optimized code, 'lbpar' with diamond tiling 
  when possible. One could do 'make <target>' where target can be orig, 
  orig_par, opt, tiled, par, lbpar, etc. (see examples/common.mk for full 
  list)

- 'make test' to test for correctness, 'make perf', 'make lbperf' to compare 
performance


COMMAND-LINE OPTIONS

Run

./polycc -h 

or see documentation (doc/DOC.txt) for details


TRYING ANY INCLUDED EXAMPLE CODE

Lets say we are trying the 2-d gauss seidel kernel. In examples/seidel, do 
'make par'; this will generate seidel.par.c from seidel.c and also compile 
it to generate 'par'.  Likewise, 'make tiled' for 'tiled' and 'make orig' 
for 'orig'.

$ cd examples/seidel

seidel.c: This is the original code (the kernel in this code is extracted).  
'orig' is the corresponding executable when compiled with the native 
compiler (gcc or icc for eg.) with optimization flags, 'orig_par' with the 
native compiler's auto-parallelization enabled.

seidel.opt.c: This is the transformed code without tiling (this is of not 
much use, except for seeing benefits of fusion in some cases). 'opt' is the 
corresponding executable.

seidel.tiled.c: This is Pluto generated code optimized for locality with 
tiling and other transformations, but not not parallelized - this should be 
used for sequential execution. 'tiled' is the corresponding executable.

seidel.par.c: This is Pluto parallelized code optimized for locality and 
parallelism  with tiling and other transformations. This code has OpenMP 
pragmas. 'par' is the corresponding executable.

- To change any of the flags used for an example, edit the top section of 
  examples/common.mk or the Makefile in the example directory

- To manually specify tile sizes, create tile.sizes; see examples/matmul/ 
   for example or doc/DOC.txt for more information on setting tile sizes. 

The executables already have timers; you just have to run them and that will 
print execution time for the core part of the computation as well.

To run the Pluto parallelized version:

$ OMP_NUM_THREADS=4; ./par

To run native compiler optimized/auto-parallelized version:

$ OMP_NUM_THREADS=4; ./orig_par

To run the original unparallelized code:

$ ./orig

To run the locality optimized version generated by Pluto:

$ ./tiled

- 'make clean' in the particular example's directory removes all executables 
    as well as generated codes

To launch a complete verification that compares output of tiled, par
with orig for all examples, in examples/, run 'make test'.

[examples/ ]$ make test



MORE INFO

* See doc/DOC.txt for an overview of the system and details on all 
command-line options.

* For specifying custom tile sizes through 'tile.sizes' file, see 
doc/DOC.txt

* For specifying custom fusion structure through '.fst' file, see 
doc/DOC.txt


CONTACT

Please send all bugs reports and comments to Uday Bondhugula 
<uday@csa.iisc.ernet.in> or post of pluto-development@googlegroups.com.