Presentation is loading. Please wait.

Presentation is loading. Please wait.

INL/CON-07-13373 Dr. George L Mesina (INL) Joshua Hykes (PSU), Riley Cumberland (UMR) Donna Guillen (INL) STREAMLINING OF RELAP5-3D RELAP5 International.

Similar presentations


Presentation on theme: "INL/CON-07-13373 Dr. George L Mesina (INL) Joshua Hykes (PSU), Riley Cumberland (UMR) Donna Guillen (INL) STREAMLINING OF RELAP5-3D RELAP5 International."— Presentation transcript:

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

2 05-GA Outline Motivation and overview of Streamlining History of RELAP5-3D developments –Impact of these developments Streamlining Algorithm Valuation of Streamlining

3 05-GA Motivation for Streamlining Something you do BEFORE verification or validation Improves source code and shortens time for V&V Verification Source code Validation DA Code implements what documents say. Code calculations are correct. Improved code

4 05-GA 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 05-GA 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 05-GA 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 co$t and $chedule

7 05-GA 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 05-GA RELAP5-3D Development History VersionCapability AddedAffects MOD1Small Break LOCAphysicscode length BWRphysicscode length Semi-implicit time stepnumericscomplexity MOD26 governing equationsnumerics * Nearly-implicit time stepnumericscomplexity Alternate fluidsphysicsconditional At its inception RELAP5 was designed to analyze large break LOCA in a PWR

9 05-GA RELAP5-3D Development History MOD3Textbook correlationsphysicsnumerics Offtake & CCFL modelsphysicslength vectorizearchitecturecomplexity MOD3.2NESTLE 3D kineticsphysicsconditional 3D Hydrodynamicsphysicsconditional multi-D heat transferphysicsconditional

10 05-GA RELAP5-3D History, DOE funded RealtimeParallel processingarchitecturecomplexity (simulators) Vector-parallel solvernumericscode length SIMPORT (GUI) hookarchitecturecomplexity 3DPVM couplingarchitecturecomplexity RGUI (3D visualization)architecturecode length Models, components, fluidsphysicscomplex, “ Much more in 3D including: SCDAP, proprietary coding, optimizations, architectural upgrades, etc.

11 05-GA 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 05-GA 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 05-GA 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 05-GA 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 05-GA High Level Streamlining Approach

16 05-GA Some Difficulties and Workarounds Combinations of different kinds of conditional code. –N different kinds => 2 N combinations Solution: Restructure and carefully recombine –Use minimal set of combinations << 2 N. If > 500 lines of source, does not fully restructure Solution: Use FOR_STRUCT output as new input –Iterate three times

17 05-GA 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 05-GA 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 05-GA Valuation of Streamlining Go to statementsBeforeAfterRatio Sub w/ 0 GO TOs2553860.66 Sub w/ 100+ GO TOs919 Total GO TOs670739771.69 Computed GO TOs100714.29 Backward GO TOs8221256.32 Readability measure: reduction of GOTO statements and labels. –Tangle logic flow paths. Obscure base algorithm.

20 05-GA Valuation of Streamlining

21 05-GA 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 05-GA 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 05-GA 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 V&V, DA It has no effect on code calculations or run time It costs comparatively little to enact


Download ppt "INL/CON-07-13373 Dr. George L Mesina (INL) Joshua Hykes (PSU), Riley Cumberland (UMR) Donna Guillen (INL) STREAMLINING OF RELAP5-3D RELAP5 International."

Similar presentations


Ads by Google