An Overview of the Morfeus Project
Damian Rouson
Sandia National Laboratories
Joel Koplik, Karla Morris, Xiaofeng Xu
City University of New York Sponsors: U.S. Office of Naval Research U.S. Department of Energy (OASCR)
An Overview of the Morfeus Project Damian Rouson Sandia National - - PowerPoint PPT Presentation
An Overview of the Morfeus Project Damian Rouson Sandia National Laboratories Joel Koplik, Karla Morris, Xiaofeng Xu City University of New York Sponsors: U.S. Office of Naval Research U.S. Department of Energy (OASCR) Outline
Damian Rouson
Sandia National Laboratories
Joel Koplik, Karla Morris, Xiaofeng Xu
City University of New York Sponsors: U.S. Office of Naval Research U.S. Department of Energy (OASCR)
Introduction Methodology Results Conclusion
Introduction ➢Motivation ➢Objectives ➢Previous work Methodology Results Conclusion
Published OOD patterns in scientific
Conventional wisdom suggests that
To move scientific programmers to
To demonstrate general OOD
To construct an open-source
Positive Outdoor Space Julian Street Inn Shelter for the Homeless San Jose, CA
1995
Mediator
2007
F95: Decyk & Gardner (2006-'07) F03: Markus (2008) F03: Rouson, Adalsteinsson & Xia (2010)
Scientific Software Design: The Object-Oriented Way
Damian W. I. Rouson Jim Xia Xiaofeng Xu
2011
Puppeteer: Climate
Atmosphere Ice Ocean
aggregates
Introduction Methodology ➢ Language selection ➢ Pattern definition Results Conclusion
Scientific programmers rule! Mathematical expressiveness: ➢User-defined operators:
➢Multidimensional arrays ➢Array operations Platform-agnostic parallelism (Fortran 2008) Automatic memory management: ➢Automatic re-sizing of arrays ➢Automatic destruction of dynamically
A common solution to a recurring
Four essential elements: ➢The name ➢The problem ➢The solution ➢The consequences Additional elements: ➢Also known as... ➢Known uses. ➢Related patterns. ➢Sample implementation.
Quantum vortices (red) & classical vortices (blue) in superfluid helium. [Morr is et al., PRL 2008] Optical turbulence in the ABL. [Morris et al., JoT sub. 2010] Particles in liquid metal MHD (red=fastest, blue=slowest) [Rouson et al., PoF 2008] Lattice Boltzman blood flow with & without stent. [Xu & Lee IJNMF 2008]
X 180 190 200 210 220 70 80 90 t=0.4TForTrilinos CTrilinos Trilinos OO Interface Morfeus Application F2003 Interface C Headers Extern “C”{} Abstract class framework. Concrete classes.
Distributed C++ objects
ACM TOMS.
practices for over 50 packages:
Introduction Methodology Results ➢Abstract Calculus ➢Abstract Factory & Factory Method ➢Object & Surrogate Conclusion
Blackboard abstraction
ut=νu xx−uux
Software abstraction class(field),pointer::u,du_dt
un1=unut
nt
call u%boundary(x,0,u0) u%t() u = u + u%t()*dt du_dt = nu*u%xx() – u*u%x() “Software abstractions should resemble blackboard abstractions.” Kevin Long, Texas Tech. U.
du_dt = nu*u%xx() – u*u%x() Purely functional
between task & data parallelism.
Synchronization
➢GoF Philosophy:
➢Abstract classes model interfaces. ➢Opposing force:
The Abstract Factory solution: ➢“Provide an interface for creating
The Factory Method solution: ➢“Define an interface for creating an
Field Periodic6thFactory
returns constructs
Periodic6thOrder Legend
“Implements” Public Abstract Type deferred_binding()
FieldFactory + create() + create() +
program main !... #ifdef HAVE_MPI type(Epetra_MpiComm) :: comm #else type(Epetra_SerialComm) :: comm #endif class(field), pointer :: u class(field), pointer :: u class(field_factory), allocatable :: field_creator allocate(periodic_6th_factory::field_creator)
#ifdef HAVE_MPI call MPI_INIT(ierr) comm = Epetra_MpiComm(MPI_COMM_WORLD) #else comm = Epetra_SerialComm() #endif initial => u_initial u => field_creator%create(initial,resolution) !.. do while t < t_final dt = u%euler_step(nu,grid_resolution) u = u + (nu*u%xx()*nu - u*u%x())*dt t = t + dt end do #ifdef HAVE_MPI call MPI_FINALIZE(rc) #endif call u%force_finalize end program
Robust design requires a degree of
➢Consistent desirable behavior, e.g.
➢Universal referencing. Opposing force: ➢Too much uniformity feels like
The solution: ➢Define a universal parent class
➢Use the Object class hierachy to
implements
Hermetic + cpp_delete() Universal Ref_Counter Multivector Vector Field
extends extends extends aggregates aggregates
Object Pattern Surrogate Pattern
Introduction Methodology Results Conclusion ➢Summary ➢Future work ➢Acknowledgements
Abstract Calculus illuminates a path
Fortran 2003 appears to have the
Several domain-specific and
Implement an Abstract Calculus
Unit testing Performance testing Public release: ➢http://trilinos.sandia.gov Demonstrate a scalable OO
Sandia National Laboratories: ➢Mike Heroux, Nicole Lemaster IBM: ➢Jim Xia