# The Pochoir Project

### From SuperTech Wiki

(→Documentation) |
(→Documentation) |
||

Line 68: | Line 68: | ||

== <br>Documentation == | == <br>Documentation == | ||

[http://people.csail.mit.edu/yuantang/pochoir_spaa11.pdf The Pochoir Stencil Compiler], Yuan Tang, Rezaul Alam Chowdhury, Bradley C. Kuszmaul, Chi-Keung Luk, and Charles E. Leiserson, to appear in 23rd ACM Symposium on Parallelism in Algorithms and Architectures (SPAA'2011), 2011. | [http://people.csail.mit.edu/yuantang/pochoir_spaa11.pdf The Pochoir Stencil Compiler], Yuan Tang, Rezaul Alam Chowdhury, Bradley C. Kuszmaul, Chi-Keung Luk, and Charles E. Leiserson, to appear in 23rd ACM Symposium on Parallelism in Algorithms and Architectures (SPAA'2011), 2011. | ||

+ | |||

+ | |||

[http://people.csail.mit.edu/yuantang/pochoir_hotPar11.pdf Coding Stencil Computations Using the Pochoir Stencil-Specification Language], Yuan Tang, Rezaul Alam Chowdhury, Chi-Keung Luk, Charles E. Leiserson, to appear in 3rd USENIX Workshop on Hot Topics in Parallelism (HotPar'11), 2011. | [http://people.csail.mit.edu/yuantang/pochoir_hotPar11.pdf Coding Stencil Computations Using the Pochoir Stencil-Specification Language], Yuan Tang, Rezaul Alam Chowdhury, Chi-Keung Luk, Charles E. Leiserson, to appear in 3rd USENIX Workshop on Hot Topics in Parallelism (HotPar'11), 2011. | ||

+ | |||

+ | |||

[http://people.csail.mit.edu/yuantang/manual.pdf Manual] | [http://people.csail.mit.edu/yuantang/manual.pdf Manual] | ||

## Revision as of 15:57, 18 April 2011

## Contents |

##

Welcome to Pochoir

##

The Pochoir Stencil Compiler

Pochoir (pronounced "PO-shwar") is a compiler and runtime system for implementing stencil computations on multicore processors. A stencil defines the value of a grid point in a *d*-dimensional spatial grid at time *t* as a function of neighboring grid points at recent times before *t*. A stencil computation computes the stencil for each grid point over many time steps. Using Pochoir, a user specifies a computing kernel and boundary conditions using a simple stencil language embedded in C++. The Pochoir compiler produces cache-efficient multithreaded C++ code that can be compiled with the Intel 12.0 compiler for C++ with the Cilk multithreading extensions, which is available as part of the Intel Parallel Computer suite. The Pochoir package contains two main components: a C++ template library for debugging and testing Pochoir compliance and a domain-specific compiler written in Haskell that produces highly optimized code. (Currently, the Pochoir package has only been tested on Linux systems.)

Here is an example of a 2D heat equation coded in Pochoir:

#define mod(r,m) ((r)%(m) + ((r)<0)? (m):0) Pochoir_Boundary_2D(heat_bv, a, t, x, y) return a.get(t,mod(x,a.size(1)),mod(y,a.size(0))); Pochoir_Boundary_End int main(void) { Pochoir_Shape_2D 2D_five_pt[] = {{1,0,0}, {0,1,0}, {0,-1,0}, {0,-1,-1}, {0,0,-1}, {0,0,1}}; Pochoir_2D heat(2D_five_pt); Pochoir_Array_2D(double) u(X, Y); u.Register_Boundary(heat_bv); heat.Register_Array(u); Pochoir_Kernel_2D(heat_fn, t, x, y) u(t+1, x, y) = CX * (u(t, x+1, y) - 2 * u(t, x, y) + u(t, x-1, y)) + CY * (u(t, x, y+1) - 2 * u(t, x, y) + u(t, x, y-1)) + u(t, x, y); Pochoir_Kernel_End for (int x = 0; x < X; ++x) for (int y = 0; y < Y; ++y) u(0, x, y) = rand(); heat.Run(T, heat_fn); for (int x = 0; x < X; ++x) for (int y = 0; y < Y; ++y) cout << u(T, x, y); return 0; }

Pochoir is an open-source software project hosted by Supertech group at CSAIL, MIT. You are invited to contribute in any form (documentation, translation, writing code, fixing bugs, porting to other platforms, etc.). We are particularly interested in developing a set of real-world example stencil computations.

##

Performance Graphs

Comparing the number of grid points processed per second (semilogarithmic scale) for Pochoir-generated code on 12 cores versus serial- and parallel-loop implementations. In all figures, the top curve is for the Pochoir-generated code, the middle curve is for parallel loops, and the bottom curve is for serial loops. (a) A 3D wave equation with a nonperiodic boundary condition executing for 1000 time steps. (b) A 2D heat equation on a torus executing for 3200 time steps. (c) 1D pairwise sequence alignment (no time step). (d) A Lattice Boltzmann method with a nonperiodic boundary condition for 3000 time steps.

##

Pochoir Team

The Pochoir project is joint research by the Supertech Research Group at MIT and Intel Corporation. The core team includes the following researchers:

- Charles E. Leiserson, project leader

- Yuan Tang, principal researcher

##

Current Release

Pochoir 1.0 is now released (Feb, 2011)

Please send your name and affiliation to Pochoir Development List to request a copy of current release of Pochoir.

**Pochoir** is covered by the GNU Public License version 3.0

##

Documentation

The Pochoir Stencil Compiler, Yuan Tang, Rezaul Alam Chowdhury, Bradley C. Kuszmaul, Chi-Keung Luk, and Charles E. Leiserson, to appear in 23rd ACM Symposium on Parallelism in Algorithms and Architectures (SPAA'2011), 2011.

Coding Stencil Computations Using the Pochoir Stencil-Specification Language, Yuan Tang, Rezaul Alam Chowdhury, Chi-Keung Luk, Charles E. Leiserson, to appear in 3rd USENIX Workshop on Hot Topics in Parallelism (HotPar'11), 2011.

## Acknowledgment

The Pochoir project is supported in part by a grant from Intel Corporation and in part by NSF Grants CCF-0937860 and CNS-1017058.

Copyright © 2010-2011 Yuan Tang and Charles E. Leiserson, All Rights Reserved.