Ghost Elements. Ghost Elements: Overview Most FEM programs communicates via shared nodes, using FEM_Update_field Most FEM programs communicates via shared.

Slides:



Advertisements
Similar presentations
Chapter 21 The STL (maps and algorithms) Bjarne Stroustrup
Advertisements

Three types of remote process invocation
Computer Architecture
COMPUTER NETWORK TOPOLOGIES
TE Sessions Supported by: Basic Concepts of Programming November 3, 2012.
Chapter 16 Graphical User Interfaces John Keyser’s Modifications of Slides by Bjarne Stroustrup
Systems and Technology Group © 2006 IBM Corporation Cell Programming Tutorial - JHD24 May 2006 Cell Programming Tutorial Jeff Derby, Senior Technical Staff.
Coordinatate systems are used to assign numeric values to locations with respect to a particular frame of reference commonly referred to as the origin.
RPC Robert Grimm New York University Remote Procedure Calls.
MPI Collective Communications
An Introduction to Hashing. By: Sara Kennedy Presented: November 1, 2002.
Sahalu Junaidu ICS 573: High Performance Computing 8.1 Topic Overview Matrix-Matrix Multiplication Block Matrix Operations A Simple Parallel Matrix-Matrix.
Introduction to MPI Programming (Part III)‏ Michael Griffiths, Deniz Savas & Alan Real January 2006.
Searching Kruse and Ryba Ch and 9.6. Problem: Search We are given a list of records. Each record has an associated key. Give efficient algorithm.
28.2 Functionality Application Software Provides Applications supply the high-level services that user access, and determine how users perceive the capabilities.
Getting Started with MPI Self Test with solution.
11/13/01CS-550 Presentation - Overview of Microsoft disk operating system. 1 An Overview of Microsoft Disk Operating System.
Chapter 4.1 Mathematical Concepts. 2 Applied Trigonometry Trigonometric functions Defined using right triangle  x y h.
CSE351/ IT351 Modeling And Simulation Choosing a Mesh Model Dr. Jim Holten.
Delivery, Forwarding, and Routing
. Memory Management. Memory Organization u During run time, variables can be stored in one of three “pools”  Stack  Static heap  Dynamic heap.
Today’s Lecture Process model –initial & always statements Assignments –Continuous & procedural assignments Timing Control System tasks.
DEMONSTRATION FOR SIGMA DATA ACQUISITION MODULES Tempatron Ltd Data Measurements Division Darwin Close Reading RG2 0TB UK T : +44 (0) F :
Spatial data models (types)
1 LiveViz – What is it? Charm++ library Visualization tool Inspect your program’s current state Client runs on any machine (java) You code the image generation.
The Charm++ ParFUM Framework PARallel Framework for Unstructured Meshing presented by: Isaac Dooley Parallel Programming Lab University Illinois Urbana-Champaign.
ParFUM Parallel Mesh Adaptivity Nilesh Choudhury, Terry Wilmarth Parallel Programming Lab Computer Science Department University of Illinois, Urbana Champaign.
Name Resolution Domain Name System.
CSCI 6962: Server-side Design and Programming JDBC Database Programming.
A Metadata Based Approach For Supporting Subsetting Queries Over Parallel HDF5 Datasets Vignesh Santhanagopalan Graduate Student Department Of CSE.
Computer Programming for Biologists Class 8 Nov 28 th, 2014 Karsten Hokamp
CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals.
1 FEM Framework Tutorial Sayantan Chakravorty 10/19/2004.
Real-Time Cyber Physical Systems Application on MobilityFirst Winlab Summer Internship 2015 Karthikeyan Ganesan, Wuyang Zhang, Zihong Zheng.
Adaptive Mesh Modification in Parallel Framework Application of parFUM Sandhya Mangala (MIE) Prof. Philippe H. Geubelle (AE) University of Illinois, Urbana-Champaign.
JAVA: An Introduction to Problem Solving & Programming, 5 th Ed. By Walter Savitch and Frank Carrano. ISBN © 2009 Pearson Education, Inc., Upper.
Arrays Module 6. Objectives Nature and purpose of an array Using arrays in Java programs Methods with array parameter Methods that return an array Array.
Application Paradigms: Unstructured Grids CS433 Spring 2001 Laxmikant Kale.
1 C++ Classes and Data Structures Jeffrey S. Childs Chapter 4 Pointers and Dynamic Arrays Jeffrey S. Childs Clarion University of PA © 2008, Prentice Hall.
Representation. Objectives Introduce concepts such as dimension and basis Introduce coordinate systems for representing vectors spaces and frames for.
IBM TSpaces Lab 3 Transactions Event Registration.
Applications with Multiple Activities. Most applications will have more than one activity. The main activity is started when the application is started.
GPRS functionality overview in Horner OCS. GPRS functionality – Peer to Peer communication over GPRS – CSCAPE connectivity over GPRS – Data exchange using.
How to write a MSGQ Transport (MQT) Overview Nov 29, 2005 Todd Mullanix.
9/12/99R. Moore1 Level 2 Trigger Software Interface R. Moore, Michigan State University.
Implementation: Charm++ Orion Sky Lawlor
 2008 Pearson Education, Inc. All rights reserved. 1 Arrays and Vectors.
Linux Operations and Administration
JAVA: An Introduction to Problem Solving & Programming, 5 th Ed. By Walter Savitch and Frank Carrano. ISBN © 2008 Pearson Education, Inc., Upper.
1 Rocket Science using Charm++ at CSAR Orion Sky Lawlor 2003/10/21.
Arrays Chapter 7. MIS Object Oriented Systems Arrays UTD, SOM 2 Objectives Nature and purpose of an array Using arrays in Java programs Methods.
Add Cool Visualizations Here Sandia National Laboratories is a multi-program laboratory managed and operated by Sandia Corporation, a wholly owned subsidiary.
Arrays What is an array… –A data structure that holds a set of homogenous elements (of the same type) –Associate a set of numbers with a single variable.
1 Linked Multiple Queues. 2 A real world example. Not in the book. Sometimes we have a fixed number of items that move around among a fixed set of queues.
Chapter 7 - Functions. Functions u Code group that performs single task u Specification refers to what goes into and out of function u Design refers to.
1 Network Access to Charm Programs: CCS Orion Sky Lawlor 2003/10/20.
CCSA 221 Programming in C CHAPTER 3 COMPILING AND RUNNING YOUR FIRST PROGRAM 1 ALHANOUF ALAMR.
Distributed and Parallel Processing George Wells.
Arrays Chapter 7.
Basic Concepts of FEM Framework & API
LiveViz – What is it? Charm++ library Visualization tool
In-situ Visualization using VisIt
Parallel Objects: Virtualization & In-Process Components
Charm++ FEM Framework Tutorial
Component Frameworks:
Craig Schroeder October 26, 2004
Generic Classes and Methods
Test Review CIS 199 Exam 2 by.
CMSC 202 Lesson 20 Exceptions 1.
Presentation transcript:

Ghost Elements

Ghost Elements: Overview Most FEM programs communicates via shared nodes, using FEM_Update_field Most FEM programs communicates via shared nodes, using FEM_Update_field Some computations require read-only copies of remote elements—“ghosts” Some computations require read-only copies of remote elements—“ghosts” Stencil-type finite volume computations Stencil-type finite volume computations The push form of matrix-vector product The push form of matrix-vector product Many kinds of mesh modification Many kinds of mesh modification Ghosts are a recent addition to the FEM framework Ghosts are a recent addition to the FEM framework

Ghosts: 2D Example Ghost of 3 Ghost of 2 34 Serial Mesh Left Chunk Right Chunk

Building Ghosts: Add ghost elements layer-by-layer from init Add ghost elements layer-by-layer from init A chunk will include ghosts of all the elements it is connected to by “tuples”—sets of nodes A chunk will include ghosts of all the elements it is connected to by “tuples”—sets of nodes For 2D, a tuple might be a 2-node edge For 2D, a tuple might be a 2-node edge For 3D, a tuple might be a 4-node face For 3D, a tuple might be a 4-node face You specify a ghost layer with FEM_Add_ghost_layer(tupleSize,ghostNodes) You specify a ghost layer with FEM_Add_ghost_layer(tupleSize,ghostNodes) ghostNodes indicates whether to add ghost nodes as well as ghost elements. ghostNodes indicates whether to add ghost nodes as well as ghost elements.

Building Ghosts: FEM_Add_ghost_elem(e,t,elem2tuple) FEM_Add_ghost_elem(e,t,elem2tuple) e is the element type e is the element type t is the number of tuples per element t is the number of tuples per element elem2tuple maps an element to its tuples: elem2tuple maps an element to its tuples: A tupleSize by t array of integers A tupleSize by t array of integers Contains element-local node numbers Contains element-local node numbers Repeat this call for each ghost element type Repeat this call for each ghost element type

Ghosts: Node adjacency /* Node-adjacency: triangles have 3 nodes */ FEM_Add_ghost_layer(1,0); /* 1 node per tuple */ const static int tri2node[]={0,1,2}; FEM_Add_ghost_elem(0,3,tri2node); 0 1 2

Ghosts: Edge adjacency /* Edge-adjacency: triangles have 3 edges */ FEM_Add_ghost_layer(2,0); /* 2 nodes per tuple */ const static int tri2edge[]={0,1, 1,2, 2,0}; FEM_Add_ghost_elem(0,3,tri2edge); 0 1 2

Extracting and Using Ghosts Ghosts are always given larger numbers than non-ghosts—that is, ghosts are at the end Ghosts are always given larger numbers than non-ghosts—that is, ghosts are at the end FEM_Get_node_ghost() and FEM_Get_elem_ghost(e) FEM_Get_node_ghost() and FEM_Get_elem_ghost(e) Return the index of the first ghost node or element Return the index of the first ghost node or element FEM_Update_ghost_field(fid,e,data) FEM_Update_ghost_field(fid,e,data) Obtain other processor’s data (formatted like fid) for each ghost element of type e Obtain other processor’s data (formatted like fid) for each ghost element of type e 0eg

Ghost Elements: Sub-Mesh

Ghost Elements

Ghosts and Symmetries

In addition to cross-processor ghosts, can build ghosts to model problem symmetries In addition to cross-processor ghosts, can build ghosts to model problem symmetries Translational and rotational periodicities Translational and rotational periodicities Mirror symmetry Mirror symmetry FEM_Add_linear_periodicity(nFaces,nPer, facesA,facesB, nNodes,nodeLocs) FEM_Add_linear_periodicity(nFaces,nPer, facesA,facesB, nNodes,nodeLocs) Identify these two lists of faces under linear periodicity, and build ghosts to match Identify these two lists of faces under linear periodicity, and build ghosts to match

Symmetry Ghosts: 2D Example Ghost of 3 Ghost of 2 34 Serial Mesh Left ChunkRight Chunk Sym. Ghost 4 Sym. Ghost 1 Horizontal Periodicity

Symmetry Ghost Elements

Symmetry-Ghost Elements

Ghosts and Symmetries: Update

NetFEM Client

NetFEM Client: Pretty pictures of wave dispersion around a crack

NetFEM: Zoom in

NetFEM: Outline Elements

NetFEM: Point Nodes

NetFEM Server

NetFEM Server Side: Overview To allow the NetFEM client to connect, you add NetFEM registration calls to your server To allow the NetFEM client to connect, you add NetFEM registration calls to your server Register nodes and element types Register nodes and element types Register data items: scalars or spatial vectors associated with each node or element Register data items: scalars or spatial vectors associated with each node or element You provide the display name and units for each data item You provide the display name and units for each data item Link your program with “-module netfem” Link your program with “-module netfem” Run with “++server”, and connect! Run with “++server”, and connect!

NetFEM Server Side: Setup n=NetFEM_Begin(FEM_My_partition(),timestep, dim,NetFEM_POINTAT) n=NetFEM_Begin(FEM_My_partition(),timestep, dim,NetFEM_POINTAT) Call this each time through your timeloop; or skip Call this each time through your timeloop; or skip timestep identifies this data update timestep identifies this data update dim is the spatial dimension—must be 2 or 3 dim is the spatial dimension—must be 2 or 3 Returns a NetFEM handle n used by everything else Returns a NetFEM handle n used by everything else NetFEM_End(n) NetFEM_End(n) Finishes update n Finishes update n

NetFEM Server Side: Nodes NetFEM_Nodes(n,nnodes,coord,”Position (m)”) NetFEM_Nodes(n,nnodes,coord,”Position (m)”) Registers node locations with NetFEM—future vectors and scalars will be associated with nodes Registers node locations with NetFEM—future vectors and scalars will be associated with nodes n is the handle returned by NetFEM_Begin n is the handle returned by NetFEM_Begin nnodes is the number of nodes nnodes is the number of nodes coord is a dim by nnodes array of doubles coord is a dim by nnodes array of doubles The string describes the coordinate system and meaning of nodes The string describes the coordinate system and meaning of nodes Currently, there can only be one call to nodes Currently, there can only be one call to nodes

NetFEM: Node Displacement

NetFEM Server Side: Elements NetFEM_Elements(n,nelem,nodeper, conn,”Triangles”) NetFEM_Elements(n,nelem,nodeper, conn,”Triangles”) Registers elements with NetFEM—future vectors and scalars will be associated with these elements Registers elements with NetFEM—future vectors and scalars will be associated with these elements n is the handle returned by NetFEM_Begin n is the handle returned by NetFEM_Begin nelem is the number of elements nelem is the number of elements nodeper is the number of nodes per element nodeper is the number of nodes per element conn is a nodeper by nelem array of node indices conn is a nodeper by nelem array of node indices The string describes the kind of element The string describes the kind of element Repeat to register several kinds of element Repeat to register several kinds of element Perhaps: Triangles, squares, pentagons, … Perhaps: Triangles, squares, pentagons, …

NetFEM: Element Stress

NetFEM Server Side: Vectors NetFEM_Vector(n,val,”Displacement (m)”) NetFEM_Vector(n,val,”Displacement (m)”) Registers a spatial vector with each node or element Registers a spatial vector with each node or element Whichever kind was registered last Whichever kind was registered last n is the handle returned by NetFEM_Begin n is the handle returned by NetFEM_Begin val is a dim by nitems array of doubles val is a dim by nitems array of doubles There’s also a more general NetFEM_Vector_field in the manual There’s also a more general NetFEM_Vector_field in the manual The string describes the meaning and units of the vectors The string describes the meaning and units of the vectors Repeat to register multiple sets of vectors Repeat to register multiple sets of vectors Perhaps: Displacement, velocity, acceleration, rotation, … Perhaps: Displacement, velocity, acceleration, rotation, …

NetFEM: Element Velocity

NetFEM Server Side: Scalars NetFEM_Scalar(n,val,s,”Displacement (m)”) NetFEM_Scalar(n,val,s,”Displacement (m)”) Registers s scalars with each node or element Registers s scalars with each node or element Whichever kind was registered last Whichever kind was registered last n is the handle returned by NetFEM_Begin n is the handle returned by NetFEM_Begin val is an s by nitems array of doubles val is an s by nitems array of doubles There’s also a more general NetFEM_Scalar_field in the manual There’s also a more general NetFEM_Scalar_field in the manual s is the number of doubles for each node or element s is the number of doubles for each node or element The string describes the meaning and units of the scalars The string describes the meaning and units of the scalars Repeat to register multiple sets of scalars Repeat to register multiple sets of scalars Perhaps: Stress, plasticity, node type, damage, … Perhaps: Stress, plasticity, node type, damage, …

NetFEM Server Side: 2D Example integer :: t,n, numnp, numel real*8, dimension(2,numnp) :: coor,d,v,a integer, dimension(3,numel) :: conn n=NetFEM_Begin(FEM_My_partition(),t,2,NetFEM_POINTAT) CALL NetFEM_Nodes(n,numnp,coor,'Position (m)') CALL NetFEM_Vector(n,d,'Displacement (m)') CALL NetFEM_Vector(n,v,'Velocity (m/s)') CALL NetFEM_Vector(n,a,'Acceleration (m/s^2)') CALL NetFEM_Elements(n,numel,3,conn,'Triangles') CALL NetFEM_Scalar(n,stress,1,'Stress (pure)') CALL NetFEM_End(n)

NetFEM: Conclusion Easy, general way to get output from an FEM computation Easy, general way to get output from an FEM computation Client configures itself based on server Client configures itself based on server Client can be run anywhere (from home!) Client can be run anywhere (from home!) Server performance impact minimal (1  s!) Server performance impact minimal (1  s!) Future work: Future work: Support multiple chunks per processor Support multiple chunks per processor Non-network, file-based version Non-network, file-based version Movie mode Movie mode

Multiple Modules

Use of 2 or more CHARM++ frameworks in the same program Use of 2 or more CHARM++ frameworks in the same program FEM—multiple unstructured mesh chunks FEM—multiple unstructured mesh chunks MBLOCK—multiple structured mesh blocks MBLOCK—multiple structured mesh blocks AMPI—Adaptive MPI-on-Charm++ AMPI—Adaptive MPI-on-Charm++ All based on the Threaded CHARM++ framework (TCHARM) All based on the Threaded CHARM++ framework (TCHARM) For example, we may want to use AMPI in our FEM program for exchanging information between FEM chunks For example, we may want to use AMPI in our FEM program for exchanging information between FEM chunks

Details Can compose FEM programs with other modules by just calling that module’s attach routine from init() Can compose FEM programs with other modules by just calling that module’s attach routine from init() For example: For example: void init(void) { //Start AMPI, to allow drivers to use MPI calls: //Start AMPI, to allow drivers to use MPI calls:MPI_Attach(“myAMPIFEM”); //.. Use FEM_Set() calls as usual.. }

Example #include ‘fem.h’ #include ‘mpi.h’ void driver(void) { //..use FEM_Get calls as usual.. //..use FEM_Get calls as usual.. //Broadcast “data” from chunk 0: //Broadcast “data” from chunk 0: MPI_Bcast(&data,1,MPI_DOUBLE,0,MPI_COMM_WORLD); MPI_Bcast(&data,1,MPI_DOUBLE,0,MPI_COMM_WORLD); //...timeloop: Use FEM_Update_field calls as usual... //...timeloop: Use FEM_Update_field calls as usual... if (dataToSend) if (dataToSend) MPI_Send(&data,4,MPI_INT,dest,tag,MPI_COMM_WORLD); MPI_Send(&data,4,MPI_INT,dest,tag,MPI_COMM_WORLD); else else MPI_Recv(&data,4,MPI_INT,src,tag,MPI_COMM_WORLD,&status); MPI_Recv(&data,4,MPI_INT,src,tag,MPI_COMM_WORLD,&status);}

Multiple Modules: Conclusion Easy to use other modules from FEM framework Easy to use other modules from FEM framework Just call MPI_Attach from init, and link with “-module ampi” Just call MPI_Attach from init, and link with “-module ampi” We could also have specified how to combine frameworks by writing a special startup routine named TCHARM_User_setup() We could also have specified how to combine frameworks by writing a special startup routine named TCHARM_User_setup() Not FEM-centric: overrides the normal call to init() Not FEM-centric: overrides the normal call to init() Allows you to call main computation routine something other than driver() Allows you to call main computation routine something other than driver() See TCHARM manual for details See TCHARM manual for details