Presentation is loading. Please wait.

Presentation is loading. Please wait.

Unclassified/FOUO Zeta White Noise Hour Presents: NeXtMidas / X-Midas Interoperability 18 Jan 2006.

Similar presentations


Presentation on theme: "Unclassified/FOUO Zeta White Noise Hour Presents: NeXtMidas / X-Midas Interoperability 18 Jan 2006."— Presentation transcript:

1 Unclassified/FOUO Zeta White Noise Hour Presents: NeXtMidas / X-Midas Interoperability 18 Jan 2006

2 Unclassified/FOUO Goal Write primitives once and run them in either framework

3 Unclassified/FOUO Why? Too costly to port existing/working primitives from one language to another Easier to build QRC or proof-of-concept systems Maintenance – Costly to maintain a C/FORTRAN and Java version of a library or primitive

4 Unclassified/FOUO How do we achieve this goal? X-Midas Backwards Compatibility (XBC) Option – Allows FORTRAN primitives to run in the NeXtMidas shell C/C++ TBD – The primitives use the NeXtMidas Java I/O and thus become “web-enabled” nM>newrate http:/localhost/dir/remotefile.tmp localfile.tmp Install NeXtMidas as an X-Midas option tree – Allows NeXtMidas (Java) primitives to run in the X-Midas shell – Single JVM runs all primitives – Loosely modeled after the X-Midas Remote Session Manager (RSM) nm/on/bg …nm plot nga_image …nm/off NOTE: In each case only ONE shell is required!

5 Unclassified/FOUO X-Midas Backward Compatibility Option Tree (XBC) - Concept A collection of m$ replacements written in C/FORTRAN that provide the interface into Java Macros are written in NeXtMidas – Can mix and match X-Midas and NeXtMidas primitives – Uses NeXtMidas intrinsics – Graphics and controls are all NeXtMidas

6 Unclassified/FOUO X-Midas Backward Compatibility Option Tree - Concept (cont) What it is intended for: – Ideal for DSP primitives – File/Pipe Input(s)/ File/Pipe Output(s) style What it is NOT intended for: – Not really meant to run “super-primitives” But…I am trying to get the super-primitive horizon_rt (VISI) to run this way – Not for X-Midas intrinsics or graphics – Not for low-level (ie lowio) or OS calls Matrix of wrapped m$ calls in XBC section of User’s Guide

7 Unclassified/FOUO XBC - Capabilites X-Midas primitives can: – Read/write results from/to the NeXtMidas results table – Aware of NeXtMidas AUX and OPTION list A little tricky since NeXtMidas supports AUX names or numbers but X-Midas only allows AUX numbers – Widgets are available by NAME instead of number – Read/write NeXtMidas pipes via easyio.for functions Not pipeio.for functions – Send and receive messages Full support for CONFIGURED messages (GENNMMSG) NON-CONFIGURED messages without data – http://alice.techma.com/nextmidas/usersguide/XBC.htm

8 Unclassified/FOUO XBC vs Porting to Java What you get: – No code changes – Primitives quickly become “web-enabled” - Can access files as URLs – Get TAG= parameter syntax – X-Midas primitives can access Table results mytable.x or mytable.foo Limitations: – FORTRAN primitives can not access all NeXtMidas features like Complex data types (Objects) Named AUXES and Ids and more – Compiler dependencies – Limited deployment options Applications can not be Webstart or Applets

9 Unclassified/FOUO XBC – Current Support Matrix OS – Linux only Compilers – FORTRAN Portland Group 4+ Intel (7.x - 9.x) – C gcc (comes with Redhat) NeXtMidas Version – Recommend latest NeXtMidas (2.1.1+) More m$ calls wrapped since initial capability X-Midas version independent – Do not even have to install it http://alice.techma.com/nextmidas/usersguide/XBC.htm

10 Unclassified/FOUO XBC – Usage In the NeXtMidas shell: – Add XBC to your path nM> path add xbc – Build XBC (first time only) nM>home mcr xbc nM>%buildopt xbc Default compiler is based on XM_FORTRAN environment variable (default is Portland Group) Compiler and options can be changed with NM_FORTRAN or build.props

11 Unclassified/FOUO XBC – Usage (cont) – Add a link to your X-Midas option tree in $NMROOT/nxm ln –s /midas/opts/visi102 visi – Add desired commands to NeXtMidas commands file (commands.cnf) nM>update Similar to commands.cfg but supports TAG= syntax – Build the option tree nM>make code visi

12 Unclassified/FOUO NeXtMidas as an X-Midas Option Tree (XMNXM) Initially an option tree called XMJVM developed by Warren Knight and Pete Perrino – Each Java programs (primitives) ran in its’ own Java Virtual Machine (JVM) – Could not access pipes – Could not run NeXtMidas primitives directly Worked in 2005 to integrate XMJVM into NeXtMidas and to have primitives run in a single JVM

13 Unclassified/FOUO XMNXM (Continued) What is it? – C code provides access into the X-Midas global sections – Java Native Interface (JNI) code provides NeXtMidas/Java with access to the C wrappers

14 Unclassified/FOUO XMNXM - Capabilites Java primitives can: – Read/write results from/to the X-Midas results table – Share AUX list A little tricky since NeXtMidas supports AUX.NAME but X-Midas only does AUX. – Imports initial X-Midas options Can have NeXtMidas options that X-Midas can not see – Read/write X-Midas pipes

15 Unclassified/FOUO XMNXM vs Porting to FORTRAN or C What you get: – No changes to the Java code – Access to Java graphics (Imagery) – Can run NeXtMidas macros – Can use NeXtMidas tables from an X-Midas macro – The Java primitives can run in independent threads Limitations – Usual X-Midas macro limits Blocking control sections, numeric Ids, file name case- insensitivity,… For example, X-Midas switches uppercase quoted names..nothing we can do about this

16 Unclassified/FOUO XMNXM – Support X-Midas –Version 3.8.3+ Compilers –Fortran (for the host primitives) –C (for the Java Native Interface, JNI) –Java (for NeXtMidas) http://alice.techma.com/nextmidas/usersguide/NextMidasAsXMidasOption. htm#Requirements

17 Unclassified/FOUO XMNXM – Usage Building – Use $NMROOT/nxm/sys (NXM) as any other X-Midas option tree http://alice.techma.com/nextmidas/usersguide/NextMidasAsXMidasOption.htm#Building Running startmacro... nm/on/bg ! Start the JVM xpipe/setup on... ! Run some NeXtMidas commands nm plot nxm.sys.dat.world... xpipe off nm/off ! Stop the JVM endmacro NOTE: All X-Midas switches (/ID, /XS,...) are applied to the nm command not to the NeXtMidas primitive

18 Unclassified/FOUO Demos XGEO.TXT –Replacing XGEOPLOT with PLOT SD360 –With XBC in front of SYS uses FORTRAN waveform command

19 Unclassified/FOUO BACKUP XGEO.TXT – code snippet if /NM GT 0 then nm/on/bg endif xcntrl on if /NM GT 0 then nm shellgui nm/xs=^geopid plot setup=/midas/mapdata/map_setup.tbl else XGEOPLOT/xs=geopid/noexit=2/mtag=(x:mrklon,y:mrklat) " " SITE " " endif XPLOT/xs=prepid/noexit=2/icon/stay/xlab=4/mtag=x:mrktime/xcnt=2 xcntrl off if /NM GT 0 then nm/off endif


Download ppt "Unclassified/FOUO Zeta White Noise Hour Presents: NeXtMidas / X-Midas Interoperability 18 Jan 2006."

Similar presentations


Ads by Google