A Network-based PDE Solving Environment

42
A Network-based PDE Solving A Network-based PDE Solving Environment Environment Mo Mu Department of Mathematics Hong Kong University of Science & Technology Team members: Chan Chui Ling, Chan Wing On, Cheung Lai Yee, Chim Lai Fong, Choi Kam Wing, Ho Ka Man, Ho Woon Ping, Kong Yin Wa, Law Man Fai, Ma Po Yee, So Ming Cheung, Tsui Ka Cheung, Tsui Wai Ming, Wu Sze Man, Yan Chi Hang, Falcon Siu, Xaio Hong Zhu

description

PDE.Mart. A Network-based PDE Solving Environment. Mo Mu Department of Mathematics Hong Kong University of Science & Technology Team members: - PowerPoint PPT Presentation

Transcript of A Network-based PDE Solving Environment

Page 1: A Network-based PDE Solving Environment

A Network-based PDE Solving EnvironmentA Network-based PDE Solving Environment

Mo Mu

Department of MathematicsHong Kong University of Science & Technology

Team members:Chan Chui Ling, Chan Wing On, Cheung Lai Yee, Chim Lai Fong, Choi Kam Wing, Ho Ka Man, Ho Woon Ping, Kong Yin Wa, Law Man Fai, Ma Po Yee, So Ming Cheung, Tsui Ka Cheung, Tsui Wai Ming, Wu Sze Man, Yan Chi Hang, Falcon Siu, Xaio Hong Zhu

Page 2: A Network-based PDE Solving Environment

BackgroundBackground

• NetSolve/GridSolve– Network and grid-based– Function evaluation: <output> = <name>(<input>)– Some PDE applications

• Web Pellpack – PDE oriented with the full functionality of PDELab– Host-based with VNC + html upload

• WebInterfacer– Host-based with CGI + html + …– Batch applications

• PDE.Mart– Network-based with Java platform + multi-language library– PDE-oriented

• Net Pellpack – Network-based with Java + …– PDE-oriented

Page 3: A Network-based PDE Solving Environment

MissionsMissions

• Develop a network-based and PDE-oriented PSE (Problem solving environment)

• Investigate the impact and research issues of the rapidly growing network/grid technologies in designing and developing network/grid-based PSEs for scientific and engineering applications.

Page 4: A Network-based PDE Solving Environment

System StructureSystem Structure

Page 5: A Network-based PDE Solving Environment

FeaturesFeatures

• Network-based Java platform– Web browser-enabled interactive GUI– Client-Server protocol

• PDE-oriented PSE– Problem specification with complicated geometry, PDE, and

boundary/interface/initial conditions, including multi-domain and multi-model problems

– Engine builder for method selection and composition– Post-processing with visualization and data analysis

• Software engineering– Platform: uniform, flexible, machine independent, object-oriented – LIB: effective and efficient software integration with multi-language and

multi-source software parts• PDE-API-based mechanism • Multi-layer and two-way wrapper framework

Page 6: A Network-based PDE Solving Environment

NETWORK-based GUI

• Provide a platform for specifying applications, constructing PDE solvers, and post-processing

• Convert the graphical user interface to the PDE object-based internal system interface

• Communicate with the server for transporting the objects

• Serve as an agent between the client and server

Page 7: A Network-based PDE Solving Environment

Characteristics

• Intensive interaction • Demanding graphics support• Object-oriented• Hierarchical browsing (domain shapes, PDE

types, numerical)

Page 8: A Network-based PDE Solving Environment

Overall Structure of PDE-GUI

Page 9: A Network-based PDE Solving Environment

Domain Editor

Page 10: A Network-based PDE Solving Environment

Shape Editor: General 2D

Page 11: A Network-based PDE Solving Environment

PDE Editor: Rectangle

Page 12: A Network-based PDE Solving Environment

PDE Editor

Page 13: A Network-based PDE Solving Environment

Model Editor: Elliptic, 2nd Order, Linear, Standard Form-- Equation Page (3D)

Page 14: A Network-based PDE Solving Environment

Model Editor: Elliptic, 2nd Order, Linear, Standard Form-- Boundary Condition Page (3D)

Page 15: A Network-based PDE Solving Environment

Method Editors

• Components of Numerical PDE methods– Domain (spatial & temporal) discretization– PDE discretization– Indexing– Solution– Blackbox

• Method browsing• Application range – problems and other numerical

components• Performance evaluation and method recommendation• Relational database for method selection, solver

composition, and consistency/error checking

Page 16: A Network-based PDE Solving Environment

Post-processing

• Visualization– VisAD– Built on top of Java3D

• Data analysis– Error analysis– Interpolation at off-mesh points– Derivatives, etc

Page 17: A Network-based PDE Solving Environment

Surface Plot of PDE Solution

Page 18: A Network-based PDE Solving Environment

PDE-SERVERPDE-SERVER

• Java application running on the host server

• Client-Server protocol– Multiple users– PDE solution services

Page 19: A Network-based PDE Solving Environment

Overall Structure of PDE-ServerOverall Structure of PDE-Server

Page 20: A Network-based PDE Solving Environment

ServerServer

• Create the Client-Server protocol– Listen to clients on the Internet

– Create a socket for each client-server connection to establish the communication channel

– Create a CS (computational session) thread as an instance of Engine Builder for the client to build the computational engine

Page 21: A Network-based PDE Solving Environment

Engine Builder and Computational SessionEngine Builder and Computational Session

• A CS is an instance of Engine Builder

• A CS is an interactive Control Program:– communicating with the user (through PDE-GUI) via the socket

for input or output

– mapping a PDE-GUI session to the internal system interface

– controlling the computation on the server: to create or update the Domain object, PDE object, Mesh object, Discrete PDE object, Indexing object, and Solution object, or Blackbox-solver object that combines the latter three

• CS is object-oriented based on PDE-API

• CS is multi-threaded

Page 22: A Network-based PDE Solving Environment

Engine Components

• Domain Creator• PDE Creator• Mesh Generator• Discretizer• Indexer• Solver• Blackbox-solver

Page 23: A Network-based PDE Solving Environment

Client-Server Communication

• Java RMI (Remote Method Invocation)– Easy and convenient for developing distributed object-

based applications– Without object transportation and replication– Expensive communication

• Object Serialization– Read/write a full-blown object via byte streams– With object replication– Convenient– Improved communication performance than RMI, yet

still expensive for BIG objects

Page 24: A Network-based PDE Solving Environment

Client-Server Communication (continued)

• Parameter-based object transmission– Passing defining information and re-creating/updating the object

– More efficient

– Tedious low-level socket data manipulation

– Hash table-based Key-Value parameter array• Creator key for identifying a creator to invoke

• Object key for identifying an object to create/update, such as shape key for domain objects, type key for PDE object, …

– Event-driven CS

Page 25: A Network-based PDE Solving Environment

PDE-LIB

• A collection of computational and utility supporting software parts for developing PDE-oriented PSEs

• Self-developed or ported from existing systems for software re-use

• Most of the computationally intensive software parts are fine-tuned and mature native codes

• Challenge: software integration with multi-language and multi-source native codes into an object-oriented Java platform

Page 26: A Network-based PDE Solving Environment

Computational Flow in PDE SolutionComputational Flow in PDE Solution

• Descriptive objects

• Processing objects

Page 27: A Network-based PDE Solving Environment

Application Programmer Interfaces

• BLAS: API for numerical linear algebra

• API for FFT

• PDE-API– PDE-oriented API

– Descriptive objects

– A standard set of methods for the specification of geometry, PDE, initial/boundary/interface conditions, domain discretization, PDE discretization, indexing, solution

– A protocol of behavior for a group of classes that implement the interface

Page 28: A Network-based PDE Solving Environment

PDE-API

• Domain Interfaces– Domain2DInterface– Domain3DInterface

• PDE Interfaces– PDEEllipticInterface– PDEParabolicInterface– PDEHyperbolicInterface– ……

• Mesh Interfaces– Mesh2DGridInterface– Mesh2DFEInterafce

– ……• Discrete Interfaces

– DiscreteLinearInterface– DiscreteNonlinearInterface

• Indexing Interface• Solution Interface

Page 29: A Network-based PDE Solving Environment

API-based Framework for Software Integration

• A processing class expects certain input from the descriptive objects on the argument list

• A processing class has its application range• Java interface can be used as a reference

data type– Only an instance of a class that implements the

interface can be assigned to a reference variable whose type is an interface name

Page 30: A Network-based PDE Solving Environment

Uniform Structure of Processing Class in PDE-LIB

• PDE-API interfaces, instead of class names, are used as reference data types to declare the input arguments for descriptive objects– The descriptive objects implementing the interfaces

offer the promise to provide all the necessary information expected by the underlying numerical procedure

– The interface data types ensure the application limitation of the numerical procedure

• PDE-API defines a protocol of proper communication among the PDE-LIB objects

Page 31: A Network-based PDE Solving Environment

Example of Processing Class

Page 32: A Network-based PDE Solving Environment

Multi-layer Wrapper FrameworkMulti-layer Wrapper Framework

• Direct implementation of the numerical procedure is possible• Native method invocation is more practical

– Software re-use– Numerical efficiency

• The general class structure is reduced to a Java wrapper• JNI (Java Native Interface) supports native method invocation• Native codes are ported from existing packages

– Self-contained systems and Own data structures– Control program (main program)

• Memory declaration• Data structures allocation: global variables, common blocks• User-supplied routines• Native method invocation

– Preprocessor• Determine memory size• Generate control program

Page 33: A Network-based PDE Solving Environment

Java WrappersJava Wrappers

• Lack of preprocessor and control program– MemoryAllocator

• Calculate the dimension sizes of all the arrays associated to each numerical procedure

• Allocate the required memory of the data structures

– GlobalControl• encapsulate the global control information necessary in a PDE computation, but

not available from other descriptive objects such as domain, PDE, mesh, etc

• Wrapper structure extended from the general structure– Native method declaration– Descriptive objects plus GlobalControl object are passed to the argument list

due to object-orientation– Numerical procedure implementation

• Memory allocation• Native method invocation

Page 34: A Network-based PDE Solving Environment

Example of Java Wrapper

Page 35: A Network-based PDE Solving Environment

C++ WrappersC++ Wrappers

• The official Java technology only supports the JNI interface to C/C++

• Technology for interfacing Java with Fortran or others is not mature and standard yet

• The arguments to a native method in a Java wrapper are passed by objects

• So, all native methods declared in Java wrappers are implemented in C++

• If the target native code is not in C++, the C++ code is again reduced to a C++ wrapper

Page 36: A Network-based PDE Solving Environment

Structure of C++ WrappersStructure of C++ Wrappers

• Declare the external native routine;

• Decode the information encapsulated in the argument objects passed from the Java side;

• Invoke the native routine for passing the decoded information to input arguments and returning the computed information from the output arguments;

• Encode the output from the native code to the target object for returning back to the Java side through the output argument of the C++ wrapper.

Page 37: A Network-based PDE Solving Environment

Fortran/C WrappersFortran/C Wrappers

• The technology for calling routines between C++ and Fortran is mature and stable

• Fortran routine declared in a C++ wrapper is usually still not the target native code due to the lack of control program– To invoke a library module, the control program contains a segme

nt of statements for the setup– Global variables cannot appear in an argument list

• A Fortran wrapper basically replaces part of the Fortran control program corresponding to the given numerical procedure.

Page 38: A Network-based PDE Solving Environment

Structure of Fortran/C WrappersStructure of Fortran/C Wrappers

• Pass the input data from the C++ wrapper to the Fortran side through the argument list to the Fortran wrapper

• Set up the global data structures, mostly in common blocks, as required by the Fortran routines involved in the native invocation

• Invoke the target Fortran native method together with the necessary setup

• Return the generated output to the C++ wrapper through the argument list to the Fortran wrapper

Page 39: A Network-based PDE Solving Environment

Call-back WrappersCall-back Wrappers

• Some native methods need to invoke methods available on the Java side– ELLPACK

• Built-in routines for problem specification are available in the control program

• Used by Domain processor, Discretization modules, …

– Available from Java methods defined in PDE-API

• Integrate ELLPACK into PDE.Mart– Five Fortran call-back wrappers Q1BDRY Q1PCOE R1PRHS Q1BCOE

R1BRHS of the same names in ELLPACK for the missing built-in routines

– Five C++ call-back wrappers DomBdryCpp, PDECoeCpp, PDERhsCpp, BCCoeCpp, BCRhsCpp

Page 40: A Network-based PDE Solving Environment

Multi-layer and Two-way Wrapper FrameworkMulti-layer and Two-way Wrapper Framework

Page 41: A Network-based PDE Solving Environment

PDE.Mart Packages

• PDEMart

– PDEMart.GUI

– PDEMart.SERVER

– PDEMart.LIB• PDEMart.LIB.Geometry

• PDEMart.LIB.PDE

• PDEMart.LIB.Mesh

• PDEMart.LIB.Discretization

• PDEMart.LIB.Indexing

• PDEMart.LIB.Solver

• PDEMart.LIB.Util

Page 42: A Network-based PDE Solving Environment

PDE-LIB: Geometry PackagePDE-LIB: Geometry Package