2 DIMENSIONS - Common Component Architecture

Download Report

Transcript 2 DIMENSIONS - Common Component Architecture

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
Babel now has a functioning Fortran 2003 Binding
that supports Structured Data Types.
F03
F77
C
F90
C++
Python
Java
Babel F2003 functionality supports
the 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>
}
struct HardRarray {
int
rarray<double,1>
rarray<double,1>
}
d_array;
d_int;
d_rarrayRaw(d_int);
d_rarrayFix(3);
struct Combined {
Simple d_simple;
Hard
d_hard;
}
struct CombRarray {
Simple
d_simple;
HardRarray d_hardRarray;
}
Babel F2003 functionality supports the following SIDL
function declarations.
Type = {Empty,Simple,Hard,Combined}
<Type>
bool
bool
bool
<Type>
return<Type> ();
passin<Type>(in <Type> s);
passout<Type>(out <Type> s);
passinout<Type>(inout <Type> s);
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);
The Babel F2003 binding generates true
Fortran 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
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.
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
FACETS-Integrated Fusion
simulation (core, edge and wall).
Tokamak:
Produce Fusion
Energy
FACETS:
Fusion Simulation,
Wall to Core
Babel is being used to integrate legacy
Fortran 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.
The current approach to C++/Fortran structured data
type interoperability relies on pre-F2003 features.
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 :: UnitNum
END 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;
}
The FACETS+Babel implementation simplifies the
code structure and provides common interfaces.
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
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
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.
The CCA Ecloud applications are Synergia2
and POSINST/TxPhysics
1
1
2) Beam Dynamics
(calculates x,y,z,v
of simulated
particles)
2
1) Electron Cloud Generation
i. Number of secondary electrons produced in each impact.
ii. Energy spectrum of those electrons.
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.
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 providing
1) “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”