babel f2003 wrap-up

18
Babel F2003 Wrap-up Stefan Muszala*, Tom Epperly(LLNL), Nanbor Wang* Funded by DOE (TASCS) Grant No DE-FC02-07ER25805, DOE Grant No DE-FG02-04ER84099 and Tech-X FACETS+Babel Update Stefan Muszala*, Scott Kruger*, Srinath Vadlamani* Funded by DOE (TASCS) Grant No DE-FC02-07ER25805 and Tech-X CCA Ecloud Intro Stefan Muszala*, Jim Amundson (FNAL), Paul Lebrun (FNAL), Lois Curfman McInnes (ANL) Boyana Norris (ANL), Peter Stoltz* DOE Grant No DE-FG02-08ER85152 * Tech-X

Upload: raiden

Post on 15-Jan-2016

41 views

Category:

Documents


0 download

DESCRIPTION

Babel F2003 Wrap-up. Stefan Muszala*, Tom Epperly(LLNL), Nanbor Wang*. Funded by DOE (TASCS) Grant No DE-FC02-07ER25805, DOE Grant No DE-FG02-04ER84099 and Tech-X. FACETS+Babel Update. Stefan Muszala*, Scott Kruger*, Srinath Vadlamani*. Funded by DOE (TASCS) Grant No DE-FC02-07ER25805 - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Babel F2003 Wrap-up

Babel F2003 Wrap-upStefan Muszala*, Tom Epperly(LLNL), Nanbor Wang*

Funded by DOE (TASCS) Grant No DE-FC02-07ER25805,

DOE Grant No DE-FG02-04ER84099 and Tech-XFACETS+Babel Update

Stefan Muszala*, Scott Kruger*, Srinath Vadlamani*

Funded by DOE (TASCS) Grant No DE-FC02-07ER25805

and Tech-X

CCA Ecloud IntroStefan Muszala*, Jim Amundson (FNAL), Paul

Lebrun (FNAL), Lois Curfman McInnes (ANL)Boyana Norris (ANL), Peter Stoltz*

DOE Grant No DE-FG02-08ER85152

* Tech-X

Page 2: Babel F2003 Wrap-up

Babel now has a functioning Fortran 2003 Bindingthat supports Structured Data Types.

C

C++

F77

F90

PythonJava

F03

Page 3: Babel F2003 Wrap-up

Babel F2003 functionality supportsthe following SIDL struct definitions.

enum Color { red, blue, green }

struct Empty { bool d_bool; }

struct Simple { bool d_bool; char d_char; dcomplex d_dcomplex; double d_double; fcomplex d_fcomplex; float d_float; int d_int; long d_long; opaque d_opaque; Color d_enum; }

struct Hard { array<double,1,row-major> d_array; }

struct HardRarray { int d_int; rarray<double,1> d_rarrayRaw(d_int); rarray<double,1> d_rarrayFix(3); }

struct Combined { Simple d_simple; Hard d_hard; }

struct CombRarray { Simple d_simple; HardRarray d_hardRarray; }

Page 4: Babel F2003 Wrap-up

Babel F2003 functionality supports the following SIDL function declarations.

Type = {Empty,Simple,Hard,Combined} <Type> return<Type> ();bool passin<Type>(in <Type> s);bool passout<Type>(out <Type> s);bool passinout<Type>(inout <Type> s);<Type> passeverywhere<Type>(in <Type> s1, out <Type> s2, inout <Type> s3);

TypeR = {HardRarray,CombRarray} bool passin<TypeR>(in <TypeR> s);bool passinout<TypeR>(inout <TypeR> s);bool passeverywhere<TypeR> (in <TypeR> s1,

inout <TypeR> s2);

Page 5: Babel F2003 Wrap-up

The Babel F2003 binding generates trueFortran functions for scalar types (bool,int,long,float,double,fcomplex,dcomplex)

function s_StructTest_passinEmpty_mi(self, s, exception)…logical :: s_StructTest_passinEmpty_mi! out…s_StructTest_passinEmpty_mi=.true.

…end function s_StructTest_passinEmpty_mi

complex (kind=sidl_dcomplex) :: func_checkReturn_retDcomplex_mi! Out…! DO-NOT-DELETE splicer.begin(func.checkReturn.retDcomplex) DcomplexVar=DcomplexVar*2.0 DcomplexVar=conjg(DcomplexVar) func_checkReturn_retDcomplex_mi=DcomplexVar

Page 6: Babel F2003 Wrap-up

Tying up loose ends for the F03 Binding(Outstanding issues)

• Some regression tests breaking or failing on non-Tech-X build systems.– Failing on Jaguar

• runC2C• runCxx2C

– Broken on LLNL build box• runCxx2C• runCxx2Cxx

• Adding Tech-X build to Gantlet results.– This is on hold until our new build system is

online.

Page 7: Babel F2003 Wrap-up

Babel F2003 Wrap-upStefan Muszala*, Tom Epperly(LLNL), Nanbor Wang*

Funded by DOE (TASCS) Grant No DE-FC02-07ER25805,

DOE Grant No DE-FG02-04ER84099 and Tech-XFACETS+Babel Update

Funded by DOE (TASCS) Grant No DE-FC02-07ER25805

and Tech-X

CCA Ecloud IntroStefan Muszala*, Jim Amundson (FNAL), Paul

Lebrun (FNAL), Lois Curfman McInnes (ANL)Boyana Norris (ANL), Peter Stoltz*

DOE Grant No DE-FG02-08ER85152

* Tech-X

Stefan Muszala*, Scott Kruger*, Srinath Vadlamani*

Page 8: Babel F2003 Wrap-up

FACETS-Integrated Fusion simulation (core, edge and wall).

Tokamak:Produce Fusion

Energy

FACETS:Fusion Simulation,

Wall to Core

Page 9: Babel F2003 Wrap-up

Babel is being used to integrate legacyFortran codes into FACETS.

• One of the driving forces for the F2003 Babel binding is the integration of legacy codes into the FACETS* project!

• FACETS is a C++ framework that will call FORTRAN77, Fortran90/95, Fortran 2003, Python and C codes.

* FACETS-(Framework Application for Core-Edge Transport Simulations) is a SCIDAC project led by Tech-X which aims to integrate core, edge and wall fusion simulations.

Page 10: Babel F2003 Wrap-up

The current approach to C++/Fortran structured data type interoperability relies on pre-F2003 features.

Page 11: Babel F2003 Wrap-up

The Babel approach begins with a SIDL definition of existing Fortran derived types

TYPE :: MmmFlags INTEGER :: nroot INTEGER :: npoints INTEGER :: nprout INTEGER :: lprint INTEGER :: lsuper INTEGER :: lreset INTEGER :: nerr INTEGER :: lswitch(8) REAL(kind=r8) :: cswitch(25) REAL(kind=r8) :: fig(4) REAL(kind=r8) :: frb(4) REAL(kind=r8) :: fkb(4) INTEGER :: UnitNumEND TYPE MmmFlags

struct MmmFlags { int nroot; int npoints; int nprout; int lprint; int lsuper; int lreset; int nerr; int lswitch(8); rarray<double,1> cswitch(25); rarray<double,1> fig(4); rarray<double,1> frb(4); rarray<double,1> fkb(4); int UnitNum;}

Page 12: Babel F2003 Wrap-up

The FACETS+Babel implementation simplifies the code structure and provides common interfaces.

Page 13: Babel F2003 Wrap-up

Recent work has involved refactoring FACETS Interfaces for increased usability

• <model> ={Transport Type} = {Anomalous,Neoclassical,Gyrokinetic}– <Anomalous> = {GLF23,MMM95,TGLF*}– <Neoclassical>={NCLASS*,Kapisn*}– <Gyrokinetic> ={Gyro*}

• Separating Fortran derived types into smaller units based on different transport types.

• Calling structure basically remains the same as before.

* currently under development

Page 14: Babel F2003 Wrap-up

Babel F2003 Wrap-upStefan Muszala*, Tom Epperly(LLNL), Nanbor Wang*

Funded by DOE (TASCS) Grant No DE-FC02-07ER25805,

DOE Grant No DE-FG02-04ER84099 and Tech-XFACETS+Babel Update

Funded by DOE (TASCS) Grant No DE-FC02-07ER25805

and Tech-X

CCA Ecloud IntroStefan Muszala*, Jim Amundson (FNAL), Paul

Lebrun (FNAL), Lois Curfman McInnes (ANL)Boyana Norris (ANL), Peter Stoltz*

DOE Grant No DE-FG02-08ER85152

* Tech-X

Stefan Muszala*, Scott Kruger*, Srinath Vadlamani*

Page 15: Babel F2003 Wrap-up

CCA Ecloud is a new Tech-X project that models the Electron Cloud Effect (ECE) using CCA components.

• Electrons bouncing off of beam walls causes the wall to emit more electrons through secondary emission and eventually build into a cloud.

• The ECE is important to particle accelerator simulations since the cloud causes the proton beam to degrade.

Page 16: Babel F2003 Wrap-up

The CCA Ecloud applications are Synergia2 and POSINST/TxPhysics

1) Electron Cloud Generationi. Number of secondary electrons produced in each impact.ii. Energy spectrum of those electrons.

2) Beam Dynamics (calculates x,y,z,vof simulated particles)

2

1

1

Page 17: Babel F2003 Wrap-up

Prior Tech-X SBIR work with Synergia involved adding functionality:

1) Python-based steering interface for Synergia operation.

2) Adding the functionality to merge diagnostics with steering.

3) Using items 1 and 2 to model an accelerator.

Page 18: Babel F2003 Wrap-up

Current work with Synergia involves modifying Synergia and TASCS collaboration.

1) Jim Amundson is refactoring the Synergia code base and providing a newly componentized model.

2) TASCS-COMPASS collaboration for providing1) “high-performance components for

accelerator modeling, with initial emphasis on particle tracking, beam optics, and solvers for space charge models.”

2) “selection and parameterization of accelerator components for CQoS work”