Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to JXPL UNCW Grid Group Jeff Brown 11/13/2018.

Similar presentations


Presentation on theme: "Introduction to JXPL UNCW Grid Group Jeff Brown 11/13/2018."— Presentation transcript:

1 Introduction to JXPL UNCW Grid Group Jeff Brown 11/13/2018

2 Outline Language Basics Origin Extensibility Application: OGSA-DAI
Remote Processors Future Work Jeff Brown 11/13/2018

3 XML for Scripting Parsers are already written
Many applications can create or edit scripts XSLT and XPath now available in J2SE and allow easy manipulation XML Schemas for validation Jeff Brown 11/13/2018

4 JXPL Arithmetic Arbitrary precision decimal calculations
Exact integer calculations Exact rational arithmetic Jeff Brown 11/13/2018

5 Arithmetic Example <list xmlns="http://www.jxpl.org/script">
<primitive name="Math"> <property name="operation" value="pow"/> </primitive> <rational numerator="2345" denominator="1234"/> <integer value="21"/> </list> <rational numerator=" " denominator=" "/> Jeff Brown 11/13/2018

6 User-defined Functions
Local variables Support recursion Extend language User-defined functions are treated exactly like built-in primitives Functions can overwrite built-in primitives Jeff Brown 11/13/2018

7 Before JXPL MathBoard Java Applet WYSIWYG mathematical environment
User-defined functions Graphing Symbolic manipulation Jeff Brown 11/13/2018

8 MathBoard Screen Shot Jeff Brown 11/13/2018
Basic formula editing on Getting Started page Bottom of page, sum n=1 to n=20 of n^3 / n! Change size. Change color. F(a,b)=a^b+a/b, F(2,3) and F(2,x). Now define x=6, and reevaluate f(2.x) g(x)=x^x D ctl-j x g ctl-z symbolic diff H(x)=8*sin(x)/x ctl-q drag to graph Jeff Brown 11/13/2018

9 MathBoard Data Structures
Based on LISP Flexible function evaluation Easy symbolic manipulation Simple to string encode and parse Jeff Brown 11/13/2018

10 Saving State MathBoard can write an applet tag that causes it to appear in its present state Example <APPLET ALIGN="MIDDLE" ARCHIVE="jme.jar" CODE="jme.MathBoard.class" WIDTH=346 HEIGHT=127> <PARAM NAME="inline" VALUE="true"> <PARAM NAME="1" VALUE="c:73:76:Serif:0:20: 3 [ 5 ] sup [ 4 ] [ 7 ] / - "> </APPLET> Look at Taylor Polynomial example Applet writes state for presentation purposes Jeff Brown 11/13/2018

11 MathBoard Programming
Functions LISP Cond statement Create simple programs in MathBoard Jeff Brown 11/13/2018

12 BKKC Calendar 1996 Burger King Kid Club activity calendar
Game for September All players put marker on day 1 All players flip coin If heads, move forward If tails, move back, unless on day 1 First player to day 30 wins -- applet to simulate game Jeff Brown 11/13/2018

13 BKKC in MathBoard people.uncw.edu/brownj/mathboard/help/game.html Underlying data structure makes it easy to extend MathBoard Going from mathematics language to general purpose processor is natural Jeff Brown 11/13/2018

14 Origin lf JXPL MathBoard encoded postfix strings
XML structure perfect for LISP XML + MathBoard Engine = JXPL Jeff Brown 11/13/2018

15 JXPL Internal Data XML converted to Java objects
Java objects easier to manipulate than XML DOM elements (may change in future) JxplElement: common super class JxplList JxplSymbol etc Jeff Brown 11/13/2018

16 DOM Level 3 JAX in Java 1.5 supports DOM level 3
Use XPath to query DOM XMLQuery ?? Advances in XML support might make it feasible for JXPL to use DOM internally instead of Java objects. Jeff Brown 11/13/2018

17 Extensibility: Defun JXPL does not provide a way to get the length of a list Use Defun to define function “length” Now you can use “length” just as if it were a built-in primitive Jeff Brown 11/13/2018

18 Extensibility: Primitive Interface
public JxplElement evaluate(JxplElement input) Extend JXPL by implementing simple interface Create class mypackage.MyPrimitive Use name “mypackage.MyPrimitive” just as you would use the name of a built-in primitive JXPL processor searches CLASSPATH for your primitive Jeff Brown 11/13/2018

19 Application: OGSA-DAI
DAI: Data Access and Integration Special type of Grid service called Grid Data Service (GDS) Access to databases, relational and XML Transformation of data (example: XSL) Deliver data to a variety of sinks, such as GridFTP, file system, , other GDS Jeff Brown 11/13/2018

20 GDS Scripts GDS is controlled by an OGSA-DAI XML script
OGSA-DAI scripting is not sophisticated enough to manage interaction between services Some GDS scripts need to be created at runtime Jeff Brown 11/13/2018

21 GDS Example GDS named source will query a database
GDS named sink will transform data Source delivers its output to sink OGSA-DAI uses common data format (WebRowSet) for service interaction. Jeff Brown 11/13/2018

22 Managing GDS Interaction
Use factory to create sink instance and store the handle of the instance Run sink service in separate thread so that it can wait for data delivery Create GDS script to control source service, incorporating handle of sink Use factory to create source and submit script Jeff Brown 11/13/2018

23 Managing GDS with JXPL A JXPL script can spawn a new thread for execution JXPL programs can wait for JXPL code in another thread to finish JXPL programs can create new scripts at runtime Many languages could be used to manage GDS interaction, but JXPL can be created in the graphical GridNexus environment Jeff Brown 11/13/2018

24 Remote JXPL Processors
Each JXPL processor has a URI Processors can communicate with each other A processor might send a script to a remote site for evaluation Processors can get/set variables on remote processors Jeff Brown 11/13/2018

25 JXPL URIs ogsa://152.21.222.213/…/instanceName
This uri is used by a JXPL processor whose evaluate method is exposed as a Grid service rmi:// /Jxpl This is the uri of a processor available through Remote Method Invocation (RMI) socket:// :1090/Jxpl Uri of processor accessed via http Jeff Brown 11/13/2018

26 JxplSymbol A symbol is the name of a JXPL variable
Symbols use XML namespaces to indicate the uri of processor where the data is stored When a processor evaluates a symbol it checks the symbol’s namespace. If that namespace is different from it’s uri, it contacts the remote processor for the data. Jeff Brown 11/13/2018

27 Symbol Example <symbol xmlns:fire=“rmi://15.0.0.1/Jxpl”
name=“fire:foo bar”/> When a processor evaluates the symbol “foo bar” it contacts the remote processor. If a processor is directed to store data as that symbol, then it stores it on the remote processor. Sections of a JXPL script can be named in a similar fashion, indicating that they should be executed remotely. Jeff Brown 11/13/2018

28 Future Work: Primality Proving
Given a large integer n, determine whether or not n is prime (cannot be factored in a nontrivial way) Agrawal, Kayal and Saxena have recently proved that there is a polynomial-time algorithm for primality proving. The AKS algorithm is readily parallelizable. Jeff Brown 11/13/2018

29 MIRACL Multiprecision Integer and Rational C/C++ Library
Designed specifically for the type of work needed in AKS, and other cryptography applications. Very efficient. Jeff Brown 11/13/2018

30 AKS Algorithm The algorithm involves modular arithmetic on polynomials over a finite ring. One polynomial must be raised to a very high power (n) and divided by another polynomial. Repeated squaring and dividing. Jeff Brown 11/13/2018

31 JXPL and MIRACL JXPL uses the Java Native Interface (JNI) to access MIRACL functions. It is necessary to create shared libraries for the different platforms that the JXPL processor might run on (libmiracl.so, miracl.dll) Jeff Brown 11/13/2018

32 Parallel AKS Start remote JXPL processors on machines in labs and classrooms on campus. Run a JXPL script on one machine that divvies the work, sends it to remote processors and waits for the results. Jeff Brown 11/13/2018

33 Summary JXPL is flexible enough for a variety of different tasks.
XML format makes it easy for programs to write JXPL scripts. Designed for extensibility Network aware GridNexus makes it possible for non-programmers to use JXPL. Jeff Brown 11/13/2018


Download ppt "Introduction to JXPL UNCW Grid Group Jeff Brown 11/13/2018."

Similar presentations


Ads by Google