View Full Document

6 views

Unformatted text preview:

EECS Electrical Engineering and Computer Sciences P A BERKELEY PAR LAB R A L L E L C O M P U T I N G L A B O Tuning Stencils Kaushik Datta Microsoft Site Visit April 29 2008 R A T O R Y EECS Electrical Engineering and Computer Sciences Stencil Code Overview BERKELEY PAR LAB For a given point a stencil is a pre determined set of nearest neighbors possibly including itself A stencil code updates every point in a regular grid with a constant weighted subset of its neighbors applying a stencil QuickTime and a TIFF LZW decompressor are needed to see this picture 2D Stencil QuickTime and a TIFF LZW decompressor are needed to see this picture 3D Stencil EECS Electrical Engineering and Computer Sciences Stencil Applications BERKELEY PAR LAB Stencils are critical to many scientific applications Diffusion Electromagnetics Computational Fluid Dynamics Both uniform and adaptive block structured meshes Many type of stencils 1D 2D 3D meshes Number of neighbors 5 pt 7 pt 9 pt 27 pt Gauss Seidel update in place vs Jacobi iterations 2 meshes Varying boundary conditions constant vs periodic EECS Electrical Engineering and Computer Sciences Na ve Stencil Code BERKELEY PAR LAB void stencil3d double A double B int nx int ny int nz for all grid indices in x dim for all grid indices in y dim for all grid indices in z dim B center S0 A center S1 A top A bottom A left A right A front A back EECS Electrical Engineering and Computer Sciences Our Stencil Code Executes a 3D 7 point Jacobi iteration on a 256 3 grid Performs 8 flops 6 adds 2 mults per point Parallelization performed with pthreads Thread affinity multithreading then multicore then multisocket Flop Byte Ratio 0 33 write allocate architectures 0 5 Ideal BERKELEY PAR LAB EECS Electrical Engineering and Computer Sciences QuickTime and a decompressor are needed to see this picture QuickTime and a decompressor are needed to see this picture QuickTime and a decompressor are needed to see this picture QuickTime and a decompressor are



Access the best Study Guides, Lecture Notes and Practice Exams

Loading Unlocking...
Login

Join to view Tuning Stencils and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Tuning Stencils and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?