STREAMLINING OF RELAP5-3D - PowerPoint PPT Presentation

Loading...

PPT – STREAMLINING OF RELAP5-3D PowerPoint presentation | free to download - id: 5898d6-ODUwO



Loading


The Adobe Flash plugin is needed to view this content

Get the plugin now

View by Category
About This Presentation
Title:

STREAMLINING OF RELAP5-3D

Description:

Title: Slide 1 Author: George L Mesina Last modified by: George L Mesina Created Date: 9/26/2007 10:24:14 PM Document presentation format: On-screen Show – PowerPoint PPT presentation

Number of Views:95
Avg rating:3.0/5.0
Slides: 24
Provided by: GeorgeL54
Learn more at: http://www.inl.gov
Category:

less

Write a Comment
User Comments (0)
Transcript and Presenter's Notes

Title: STREAMLINING OF RELAP5-3D


1
STREAMLINING OF RELAP5-3D
Dr. George L Mesina (INL) Joshua Hykes (PSU),
Riley Cumberland (UMR) Donna Guillen (INL)
  • RELAP5 International User Seminar
  • Nov 4-6, 2007

INL/CON-07-13373
2
Outline
  • Motivation and overview of Streamlining
  • History of RELAP5-3D developments
  • Impact of these developments
  • Streamlining Algorithm
  • Valuation of Streamlining

3
Motivation for Streamlining
  • Something you do BEFORE verification or
    validation
  • Improves source code and shortens time for VV

Source code
Streamline
Validation
Verification
Improved code
DA
Code implements what documents say.
Code calculations are correct.
4
Streamlining for Legacy Codes
  • Legacy codes
  • Successful applications, in active use, developed
    over the course of many years or even decades.
  • Some examples
  • RELAP5, TRAC/TRACE, CATHARE, RETRAN, COBRA,
    CONTAIN, MELCOR, MCNP
  • Model (portion or whole) nuclear plant
  • In use for over a decade
  • Most still undergoing development

5
Some Legacy Code Common Issues
  • Extension of applicability beyond original design
  • Many adaptations for operating systems/compilers
  • Optimizations for computer architectures
  • New features with very different data structures
  • Imported/subsumed library subprograms
  • Numerics improvements often complicate coding
  • Multiple different programming styles
  • Use of conditional coding

6
Legacy Code Common Difficulties
  • Difficult to read and understand
  • Especially for new/next-generation developers
  • Difficult to maintain and develop
  • Maintain
  • Adapt to computing industry changes
  • Solve reported problems and issue fixes
  • Develop - add features needed by code users
  • These difficulties can impact cot and chedule

7
Purpose of Streamlining
  • Increase code readability and understandability
  • Reduce time and cost of maintenance and
    development
  • This will increase code/team longevity
  • Adapt to computer industry continual changes
  • Add new/young programmers to team

8
RELAP5-3D Development History
  • At its inception RELAP5 was designed to analyze
    large break LOCA in a PWR

Version Capability Added Affects
MOD1 Small Break LOCA physics code length
  BWR physics code length
  Semi-implicit time step numerics complexity
MOD2 6 governing equations numerics  
  Nearly-implicit time step numerics complexity
  Alternate fluids physics conditional
9
RELAP5-3D Development History
MOD3 Textbook correlations physics numerics
  Offtake CCFL models physics length
  vectorize architecture complexity
MOD3.2 NESTLE 3D kinetics physics conditional
  3D Hydrodynamics physics conditional
  multi-D heat transfer physics conditional
10
RELAP5-3D History, DOE funded
Realtime Parallel processing architecture complexity
(simulators) Vector-parallel solver numerics code length
  SIMPORT (GUI) hook architecture complexity
3D PVM coupling architecture complexity
  RGUI (3D visualization) architecture code length
  Models, components, fluids physics complex,
  • Much more in 3D including SCDAP, proprietary
    coding, optimizations, architectural upgrades,
    etc.

11
Specific Impact of Developments
  • Many sections of conditional code
  • Too many GO TO statements in some subprograms
  • Many subprograms too large (up to 5000 lines
    long)
  • Baggage obsolete language constructs,
    machine-specific code, unused sections of code
  • Many patches (bug fixes, machine adaptations,
    etc.)
  • Styles of 2 dozen programmers

12
Streamlining Method
  • Rework database and source code
  • Database streamlining presented elsewhere
  • Source code streamlining
  • Create and apply consistent programming style
    rules
  • Transform code into structured programming
  • Eliminate unused and obsolete sections of code
  • Simplify complex subprograms
  • Replace programming tricks (workarounds that
    overcome language limitations)

13
Streamlining Approach
  • Apply FOR_STRUCT commercial restructuring tool to
    eliminate GO TOs apply style rules
  • Cannot be done directly
  • No conditional or non-ANSI standard code (Fortran
    77) can be restructured
  • Solution Preprocess transform post-process
  • Replace or comment out non-standard code
  • Preprocessor handles conditional code
  • Afterwards restore non-standard conditional

14
Pre-compiling Conditional Code
  • Example of conditional code Proprietary Code
  • Either proprietary code or generic code used
  • Sections of proprietary code and generic code are
    marked by pre-compiler directives
  • Mark at beginning indicates conditional-kind
  • Another indicates end of section
  • Pre-compiler removes all sections of one
    conditional-kind but leaves the alternate

15
High Level Streamlining Approach
16
Some Difficulties and Workarounds
  • Combinations of different kinds of conditional
    code.
  • N different kinds gt 2N combinations
  • Solution Restructure and carefully recombine
  • Use minimal set of combinations ltlt 2N.
  • If gt 500 lines of source, does not fully
    restructure
  • Solution Use FOR_STRUCT output as new input
  • Iterate three times

17
Automated Streamlining Algorithm
  • Marker a comment placed where a conditional
    section of code (and directives) must be restored
  • Def file specifies a combination of conditional
    code
  • Test and debug
  • Apply process one subprogram at a time

18
Manual Streamlining Necessary
  • Some conditional code directives get misplaced by
    restructuring (automated algorithm).
  • Reposition manually after restoration
  • OR
  • Manually create internal subroutine from section
    of conditional code, including directives.
  • Some subprograms are harder to read/understand
    after restructuring
  • Manually rewrite

19
Valuation of Streamlining
  • Readability measure reduction of GOTO statements
    and labels.
  • Tangle logic flow paths. Obscure base algorithm.

Go to statements Before After Ratio
Sub w/ 0 GO TOs 255 386 0.66
Sub w/ 100 GO TOs 9 1 9
Total GO TOs 6707 3977 1.69
Computed GO TOs 100 7 14.29
Backward GO TOs 822 125 6.32
20
Valuation of Streamlining
21
Valuation of Streamlining
  • Improvements from streamlining
  • Uniform style rules applied
  • Measurable reduction in GO TO statements and
    labels
  • No dead code
  • Use of internal subroutines
  • These result in logic flow paths being easier to
    trace
  • Often reduce the number of logic flow paths
  • Enhance readability and understandability

22
Valuation of Streamlining
  • Streamlining time (relap envrl) About 3/4 year
  • 28 weeks by summer interns
  • 12 weeks (initial work and mentor supervision)
  • Effect on size slightly fewer (0.5) lines of
    code
  • No dead code, shorter rewritten sections
  • Effect on code portability
  • Fewer ANSI-standard obsolescent constructs
  • Effect on code calculations and runtime
  • None

23
Conclusion
  • Streamlining is a process for legacy codes.
  • It improves code readability and
    understandability in measurable ways
  • This can help reduce the time and cost of code
    maintenance and development
  • Should be done before VV, DA
  • It has no effect on code calculations or run time
  • It costs comparatively little to enact
About PowerShow.com