Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 What’s Under the Hood? Michael McLennan HUBzero® Platform for Scientific Collaboration Purdue University This work licensed under Creative Commons See.

Similar presentations


Presentation on theme: "1 What’s Under the Hood? Michael McLennan HUBzero® Platform for Scientific Collaboration Purdue University This work licensed under Creative Commons See."— Presentation transcript:

1 1 What’s Under the Hood? Michael McLennan HUBzero® Platform for Scientific Collaboration Purdue University This work licensed under Creative Commons See license online: by-nc-sa/3.0

2 2 Example: Fermi function tool number curve How does it work?

3 3 Tool Definition File Builder tool.xml Press Simulate to view results. @tool/fermi @driver … … Press Simulate to view results. @tool/fermi @driver … … Info about the tool, how to run it Input objects Output objects skeleton program

4 4 Running produces a driver file Builder Runner tool.xml driver1827.xml

5 5 Running produces a driver file tool.xml driver1827.xml … K 0K 500K 300K eV 0eV … … K 0K 500K 300K eV 0eV … … K 0K 500K 300K 77K eV 0eV 200meV … … K 0K 500K 300K 77K eV 0eV 200meV …

6 6 run12703129102.xml Your Program Running your program Builder Runner tool.xml driver1827.xml

7 7 Program produces a run file driver1827.xml run12703129102.xml … … 77K … 200meV … … … 77K … 200meV … … … 77K … 200meV … 0.999955 -0.25852 0.99995 -0.255935 0.999945 -0.25335… … … 77K … 200meV … 0.999955 -0.25852 0.99995 -0.255935 0.999945 -0.25335…

8 8 Tool Definition File Runner tool.xml ~/data/results/$SESSION Results are moved out of the current working directory to the “results” directory run12703129102.xml Your Program driver1827.xml

9 9 All Together Builder Runner tool.xml driver1827.xml run12703129102.xml Your Program

10 10 Run file is a complete record of the run run12703129102.xml Tool DefnInput ValsOutput Vals tool.xml  driver.xml  run.xml  reload old results rerun an old tool

11 11 How does your program get invoked? Runner tool.xml run12703129102.xml Your Program driver1827.xml Rappture Your Code Rappture Library

12 12 How your program gets invoked Rappture import Rappture import sys from math import * io = Rappture.library(sys.argv[1]) Tstr = io.get('input.number(temperature).current') Efstr = io.get('input.number(Ef).current') … io.put('output.curve(f12).component.xy', xydata) Rappture.result(io) sys.exit() tool.xml Press Simulate to view results. python @tool/fermi.py @driver … Press Simulate to view results. python @tool/fermi.py @driver … python /apps/yourtool/current/fermi.py driver327.xml

13 13 Object names in tool.xml and in your program tool.xml … 300K … 2.102 6.454 … … 300K … 2.102 6.454 … Rappture Your Program … Tstr = io.get('input.number(temperature).current') Efstr = io.get('input.number(Ef).current') io.put('output.curve(f12).component.xy', xydata) … Tstr = io.get('input.number(temperature).current') Efstr = io.get('input.number(Ef).current') io.put('output.curve(f12).component.xy', xydata) … input.number(temperature).current output.curve(f12).component.xy

14 14 Exercise #2: Spriograph tool Spirograph equation: z(t) = e i2  n 1 t + e i2  n 2 t + e i2  n 3 t Where t has 1,000 points along [0,1] Plot: real(z)  x imag(z)  y See theory at http://linuxgazette.net/133/luana.html http://linuxgazette.net/133/luana.html t = linspace(0, 1, 1000); z = exp(i*2*pi*n1*t) + exp(i*2*pi*n2*t) + exp(i*2*pi*n3*t); plot(real(z),imag(z)); In MATLAB/Octave:

15 15 Exercise #2: Build a simple Addition tool Spirograph equation n1 number z curve n2 number n3 number t = linspace(0, 1, 1000); z = exp(i*2*pi*n1*t) + exp(i*2*pi*n2*t) + exp(i*2*pi*n3*t); plot(real(z),imag(z)); In MATLAB/Octave:


Download ppt "1 What’s Under the Hood? Michael McLennan HUBzero® Platform for Scientific Collaboration Purdue University This work licensed under Creative Commons See."

Similar presentations


Ads by Google