Overture and MetaChoas for CISM Developers M. Wiltberger With thanks to Bill Henshaw and Alan Sussman.

Slides:



Advertisements
Similar presentations
Partial Differential Equations
Advertisements

Virtual Realism TEXTURE MAPPING. The Quest for Visual Realism.
Parallel Computation of the 2D Laminar Axisymmetric Coflow Nonpremixed Flames Qingan Andy Zhang PhD Candidate Department of Mechanical and Industrial Engineering.
Geometric (Classical) MultiGrid. Hierarchy of graphs Apply grids in all scales: 2x2, 4x4, …, n 1/2 xn 1/2 Coarsening Interpolate and relax Solve the large.
Parallelizing stencil computations Based on slides from David Culler, Jim Demmel, Bob Lucas, Horst Simon, Kathy Yelick, et al., UCB CS267.
CSCI 317 Mike Heroux1 Sparse Matrix Computations CSCI 317 Mike Heroux.
CSE351/ IT351 Modeling And Simulation Choosing a Mesh Model Dr. Jim Holten.
CS267 L12 Sources of Parallelism(3).1 Demmel Sp 1999 CS 267 Applications of Parallel Computers Lecture 12: Sources of Parallelism and Locality (Part 3)
Partial Differential Equations
Network and Grid Computing –Modeling, Algorithms, and Software Mo Mu Joint work with Xiao Hong Zhu, Falcon Siu.
Flexible Control of Data Transfer between Parallel Programs Joe Shang-chieh Wu Alan Sussman Department of Computer Science University of Maryland, USA.
E.Papandrea PM3 - Paris, 2 nd Mar 2004 DFCI COMPUTING PERFORMANCEPage 1 Enzo Papandrea COMPUTING PERFORMANCE.
Parabolic PDEs Generally involve change of quantity in space and time Equivalent to our previous example - heat conduction.
ECIV 720 A Advanced Structural Mechanics and Analysis Lecture 12: Isoparametric CST Area Coordinates Shape Functions Strain-Displacement Matrix Rayleigh-Ritz.
1 Chapter 9 NUMERICAL SOLUTION OF PARTIAL DIFFERENTIAL EQUATIONS.
Chapter 13 Finite Difference Methods: Outline Solving ordinary and partial differential equations Finite difference methods (FDM) vs Finite Element Methods.
Numerical methods for PDEs PDEs are mathematical models for –Physical Phenomena Heat transfer Wave motion.
© 2011 Autodesk Freely licensed for use by educational institutions. Reuse and changes require a note indicating that content has been modified from the.
1 Finite-Volume Formulation. 2 Review of the Integral Equation The integral equation for the conservation statement is: Equation applies for a control.
By. What advantages has it? The Reasons for Choosing Python  Python is free  It is object-oriented  It is interpreted  It is operating-system independent.
Scientific Computing Partial Differential Equations Poisson Equation Calculus of Variations.
1 Web Based Interface for Numerical Simulations of Nonlinear Evolution Equations Ryan N. Foster & Thiab Taha Department of Computer Science The University.
CS 591x – Cluster Computing and Programming Parallel Computers Parallel Libraries.
Processing of a CAD/CAE Jobs in grid environment using Elmer Electronics Group, Physics Department, Faculty of Science, Ain Shams University, Mohamed Hussein.
A Parallel Computational Framework for Discontinuous Galerkin Methods Kumar Vemaganti Mechanical Engineering University of Cincinnati.
S.S. Yang and J.K. Lee FEMLAB and its applications POSTEC H Plasma Application Modeling Lab. Oct. 25, 2005.
Coupling Parallel Programs via MetaChaos Alan Sussman Computer Science Dept. University of Maryland With thanks to Mike Wiltberger (Dartmouth/NCAR)
Initial Results from the Integration of Earth and Space Frameworks Cecelia DeLuca/NCAR, Alan Sussman/University of Maryland, Gabor Toth/University of Michigan.
UPC Applications Parry Husbands. Roadmap Benchmark small applications and kernels —SPMV (for iterative linear/eigen solvers) —Multigrid Develop sense.
PDE2D, A General-Purpose PDE Solver Granville Sewell Mathematics Dept. University of Texas El Paso.
Introduction to Parallel Finite Element Method using GeoFEM/HPC-MW Kengo Nakajima Dept. Earth & Planetary Science The University of Tokyo VECPAR’06 Tutorial:
Linear Systems Iterative Solutions CSE 541 Roger Crawfis.
Discontinuous Galerkin Methods for Solving Euler Equations Andrey Andreyev Advisor: James Baeder Mid.
A finite element approach for modeling Diffusion equation Subha Srinivasan 10/30/09.
+ Numerical Integration Techniques A Brief Introduction By Kai Zhao January, 2011.
1 SciDAC TOPS PETSc Work SciDAC TOPS Developers Satish Balay Chris Buschelman Matt Knepley Barry Smith.
JAVA AND MATRIX COMPUTATION
ACES WorkshopJun-031 ACcESS Software System & High Level Modelling Languages by
CFX-10 Introduction Lecture 1.
Max-Planck-Institut für Plasmaphysik, EURATOM Association Different numerical approaches to 3D transport modelling of fusion devices Alexander Kalentyev.
Parallel Solution of the Poisson Problem Using MPI
Domain Decomposition in High-Level Parallelizaton of PDE codes Xing Cai University of Oslo.
Cracow Grid Workshop, November 5-6, 2001 Concepts for implementing adaptive finite element codes for grid computing Krzysztof Banaś, Joanna Płażek Cracow.
Lecture 21 MA471 Fall 03. Recall Jacobi Smoothing We recall that the relaxed Jacobi scheme: Smooths out the highest frequency modes fastest.
CIS/ME 794Y A Case Study in Computational Science & Engineering 2-D conservation of momentum (contd.) Or, in cartesian tensor notation, Where repeated.
Discretization for PDEs Chunfang Chen,Danny Thorne Adam Zornes, Deng Li CS 521 Feb., 9,2006.
Linear Algebra Operators for GPU Implementation of Numerical Algorithms J. Krüger R. Westermann computer graphics & visualization Technical University.
Partial Derivatives Example: Find If solution: Partial Derivatives Example: Find If solution: gradient grad(u) = gradient.
1 Zonal Boundary Conditions. 2 Some Basics The flow domain is divided into zones and grids are generated within each zone. The flow equations are solved.
April 24, 2002 Parallel Port Example. April 24, 2002 Introduction The objective of this lecture is to go over a simple problem that illustrates the use.
Finding Rightmost Eigenvalues of Large, Sparse, Nonsymmetric Parameterized Eigenvalue Problems Minghao Wu AMSC Program Advisor: Dr. Howard.
1 Copyright by PZ Bar-Yoseph © Finite Element Methods in Engineering Winter Semester Lecture 7.
Computational Fluid Dynamics Lecture II Numerical Methods and Criteria for CFD Dr. Ugur GUVEN Professor of Aerospace Engineering.
Algorithm Artificial compressibility Symmetric Coupled Gauss Seidel Parallel Pressure (SCGS-PP) 1st, 3rd and 5th order convective schemes 2nd, 4rd and.
SPiiPlus Training Class
Support for Program Analysis as a First-Class Design Constraint in Legion Michael Bauer 02/22/17.
Xing Cai University of Oslo
Jens Krüger Technische Universität München
The Rendering Equation
Adaptive Grid Generation for Magnetically Confined Plasmas
topic13_grid_generation
State Space Method.
CS6068 Applications: Numerical Methods
Introduction to parallelism and the Message Passing Interface
topic13_grid_generation
A Software Framework for Easy Parallelization of PDE Solvers
Parallelizing Unstructured FEM Computation
Ph.D. Thesis Numerical Solution of PDEs and Their Object-oriented Parallel Implementations Xing Cai October 26, 1998.
CASA Day 9 May, 2006.
Presentation transcript:

Overture and MetaChoas for CISM Developers M. Wiltberger With thanks to Bill Henshaw and Alan Sussman

What is Overture? A Collection of C++ Classes that can be used to solve PDEs on overlapping grids Key Features High level interface for PDEs on adaptive and curvilinear grids Provides a library of finite differences operators Conservative/NonConservative 2 nd and 4 Th order Uses A++/P++ array class for serial parallel array operations Extensive grid generation capablities

Overture: A toolkit for solving PDEs Mappings (geometry) MappedGrid GridCollection MappedGridFunction GridCollectionFunction Operators div, grad, bc's Grid Generator Ogen Adaptive Mesh Refinement Solvers Oges, Ogmg, OverBlown A++P++ array class Data base (HDF) Graphics (OpenGL) Boxlib (LBL)

A++ Array Class Serial and Parallel Array operations Easily passed to Fortran Just recompile with different library for parallel code using MPI calls do j=1,8 do i=1,8 u(i,j)=0.25*(v(i+1,j)+v(i-1,j) +v(i,j+1+v(i,j+1) enddo enddo Fortran realArray u(10,10), v(10,10); Range I(8,8), J(8,8); v = 1; u(I,J) =0.25*(v(I+1,J)+v(I-1,J)+ v(I,J+1)+v(I,J-1)); C++

realArray x(10,10), u(10,10); Range I(1,8), J(1,8);... where( x(I,J) >.5 ) u(I,J) = sin( 2.*Pi*x(I,J) ); do j=1,8 do i=1,8 if( x(i,j).gt. 0.5 )then u(i,j) = sin( 2.*pi*x(i,j) ) end if end do C++ Fortran Using the where statement in A++

RealArray u(10), v(3); intArray ia(3); ia(0)=2; ia(1)=4; ia(2)=7; Range I(0,2);... v(I)=u(ia)+2.*u(ia+1); do i=0,2 v(i)=u(ia(i))+2.*u(ia(i)+1); end do C++ Fortran Indirect addressing with A++

Passing A++ arrays to Fortran C++ Fortran extern "C" { void myfortran_( int & m, int & n, real & u); } realArray u(20,10); myfortran_( u.getLength(0), u.getLength(1), *u.getDataPointer() ); subroutine myfortran( m,n,u ) real u(m,n)... end

A Mapping defines a continuous transformation x r Mapping domainDimension rangeDimension map( r,x,xr ) inverseMap( x,r,rx ) boundaryConditions singularities... SquareMapping AnnulusMapping SphereMapping HyperbolicMapping EllipticTransform MatrixMapping RevolutionMapping etc. unit square Each mapping has an optimized map and inverseMap map

A MappedGrid holds the grid points and other geometry info MappedGrid gridIndexRange Mapping vertex vertexDerivative cellVolume faceNormal... Mapping that defines the geometry grid points jacobian derivatives optionally computed geometry arrays Figure here

A GridCollection holds a list of MappedGrids GridCollection numberOfGrids operator [int g] refinementLevel[int l]... access to a MappedGrid, g=0,1,.. GridCollection for a refinement level base grids refinement grids

A MappedGridFunction holds solution values realMappedGridFunction numberOfComponents MappedGrid MappedGridOperators x,y,z,xx,... derivatives derived from an A++ realArray which implies it inherits all A++ operators scalar, vector, 2-tensor,.. Grid functions can be vertex-centered, cell-centered, face-centered etc. MappedGrid mg(mapping); realMappedGridFunction u(mg); u=1.;

A GridCollectionFunction is a list of MappedGridFunctions GridCollection gc(...); Range all; realGridCollectionFunction u(gc,all,all,all,2); u=1.; for( int grid=0; grid<gc.numberOfGrids(); grid++ ) u[grid]=1.; realGridCollectionFunction realMappedGridFunction

Operators The Operator classes define differential operators and boundary conditions. - 2nd/4th order approximations plus some conservative approximations MappedGrid mg(sphere); MappedGridOperators op(mg); floatMappedGridFunction u(mg), v(mg), w; v=u.x()+u.y(); w=u.laplacianCoefficients(); Compute the derivatives directly Form the sparse matrix for the differential operator

Overture can be used at a number of levels GridCollection gc(...); realGridCollectionFunction u(gc), v(gc); GridCollectionOperators op(gc); v = u.x(); for( int grid=0; grid<gc.numberOfGrids(); grid++ ) v[grid]=u[grid].x(); for( grid=0; grid<gc.numberOfGrids(); grid++ ) xFortran_( *v[grid].getDataPointer(), *u[grid].getDataPointer(),...); Operate at the collection level Call Fortran Operate at the single grid level

A sample Overture program int main() { CompositeGrid cg; // Create a Composite grid getFromADataBaseFile(cg,”mygrid.hdf”); floatCompositeGridFunction u(cg); u = 1.0; // Set initial conditions CompositeGridOperators og(cg); // Create Operators u.setOperators(op); float t=0, dt=0.005, a=1., b=1., nu=0.1; for(int step=0;step<200;step++) { u+=dt*(-a*u.x()-b*u.y()+nu*(u.xx()+u.yy()); t+=dt; u.interpolate(); // Exchange info between grids u.applyBoundaryConditions(dircichelt,allBoundaries); u.finishBoundaryConditions(); } return 0; } Solve u t +au x + bu y - (u xx +u yy ) on overlaping grid

Wave Equation Solver The Overture primer contains a short code showing how to write a solver for the wave equation. This example shows how a wave is able to pass through a grid interface with few artificial reflections.

Incompressible flow past two cylinders Fine grids are integrated implicitly, coarse grids explicitly.

What is MetaChoas? A runtime meta-library that achieves direct data transfers between data structures managed by different parallel libraries Runtime meta-library means that it interacts with data parallel libraries and languages used for separate applications (including MPI) Can exchange data between separate (sequential or parallel) applications Manage data transfers between different libraries in the same application This often referred to as the MxN problem in parallel programming

How does MetaChaos work? It starts with the Data Descriptor Information about how the data is distributed across the processors Usually supplied by the library/program developer Sussman et al. are working on generalizing this process MetaChaos then uses a linearization ( L S A ) of the data to be moved (the regions) to determine the optimal method to move data from set of regions in A ( S A ) to a set of regions in B ( S B ) Moving the data is a three step process L S A = l libX (S A ) L S B = L S A S B = l -1 libY (L S B ) Only constraint on this operation is each region must have the same number of elements

A Simple Example: Heat Eq Using P++ #include main(int argc, char **argv) { Optimization_Manager::Initialize_Virtual_Machine("",iNPEs,argc,argv); int i,j,iTimeStep, iNumX, iNumT; Index I(1,iNumX-1); doubleArray daSolution(iNumX+1,iNumT+1),daTemp(iNumX+1,iNumT+1); daSolution = 0.0; // Setup BC via scalar indexing for(i=1;i<=iNumX/2;i++) daSolution(i,0)=2*i*dDX; for(i=iNumX/2+1;i<=iNumX-1;i++)daSolution(i,0)=2*(1-i*dDX); // Solve Heat Eq for(int iStep=0;iStep<9;iStep++) { daSolution(I,iStep+1) = dR*(daSolution(I+1,iStep) 2*daSolution(I,iStep)+daSolution(I-1,iStep))+ daSolution(I,iStep); } Optimization_Manager::Exit_Virtual_Machine(); }

Split in two Using MetaChoas #include main(int argc, char **argv) { Optimization_Manager::Initialize_Virtual_Machine("",NPES,argc,argv); Index I(1,iNumX-1); this_pgme = InitPgme(pgme_name,NPES); other_pgme = WaitPgme(other_pgme_name,NPES_other); Sync2Pgme(this_pgme,other_pgme); doubleArray daSolution(iNumX+1,iNumT+1),daTemp(iNumX+1,iNumT+1); daSolution = 0.0; BP_Set = Alloc_setOfRegion(); // Solve Heat Eq for(int iStep=0;iStep<9;iStep++) { daSolution(I,iStep+1) = dR*(daSolution(I+1,iStep) 2*daSolution(I,iStep)+daSolution(I-1,iStep))+ daSolution(I,iStep); } Optimization_Manager::Exit_Virtual_Machine(); }

A Simple Example: Wave Eq Using P++ #include main(int argc, char **argv) { Optimization_Manager::Initialize_Virtual_Machine("",iNPES,argc,argv); doubleArray daUnm1(iNumX+2,iNumY+2),daUn(iNumX+2,iNumY+2); doubleArray daUnp1(iNumX+2,iNumY+2); Index I(1,iNumX), J(1,iNumY); // Indices for computational domain for(j=1;j<iNumY+1;j++) { daUnm1(I,j) = sin(dW*dTime + (daX(I)*2*dPi)/dLenX); daUn(If,j) = sin(dW*0 + (daX(If)*2*dPi)/dLenX); } // Apply BC Omitteed for space // Evole a step forward in time for(i=1;i<iNSteps;i++) { daUnp1(I,J) = ((dC*dC*dDT*dDT)/(dDX*dDX))* (daUn(I-1,J)-2*daUn(I,J)+daUn(I+1,J)) + 2*daUn(I,J) - daUnm1(I,J); // Apply BC Omitted for space } Optimization_Manager::Exit_Virtual_Machine(); }

Split into two using MetaChaos #include main(int argc, char **argv) { Optimization_Manager::Initialize_Virtual_Machine("",NPES,argc,argv); this_pgme = InitPgme(pgme_name,NPES); other_pgme = WaitPgme(other_pgme_name,NPES_other); Sync2Pgme(this_pgme,other_pgme); BP_set = Alloc_setOfRegion(); left[0] = 4; right[0] = 4; stride[0] = 1; left[1] = 5; right[1] = 5; stride[0] = 1; reg = Alloc_R_HDF(DIM,left,right,stride); Add_Region_setOfRegion(reg,BP_Set); BP_da = getPartiDescriptor(&daUn); sched = ComputeScheduleForSender(…,BP_da,BP_set,…); for(i=1;i<iNSteps;i++) { daUnp1(I,J) = ((dC*dC*dDT*dDT)/(dDX*dDX))* (daUn(I-1,J)-2*daUn(I,J)+daUn(I+1,J)) + 2*daUn(I,J) - daUnm1(I,J); iDataMoveSend(other_pgme,sched,daUn,getLocalArray().getDataPointer); iDataMoveRecv(other_pgme,sched,daUn,getLocalArray().getDataPointer); Sync2Pgme(this_pgme,other_pgme); } Optimization_Manager::Exit_Virtual_Machine(); }

How CISM will use Overture and MetaChoas