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

Slides:



Advertisements
Similar presentations
SOFTWARE MAINTENANCE 24 March 2013 William W. McMillan.
Advertisements

Chapter 1 - An Introduction to Computers and Problem Solving
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
July 11 th, 2005 Software Engineering with Reusable Components RiSE’s Seminars Sametinger’s book :: Chapters 16, 17 and 18 Fred Durão.
16/13/2015 3:30 AM6/13/2015 3:30 AM6/13/2015 3:30 AMIntroduction to Software Development What is a computer? A computer system contains: Central Processing.
Telescoping Languages: A Compiler Strategy for Implementation of High-Level Domain-Specific Programming Systems Ken Kennedy Rice University.
This set of slides is provided by the author of the textbook1 Introductory Topics l Computer Programming l Programming Life-Cycle Phases l Creating an.
System Design and Analysis
Chapter 1 Principles of Programming and Software Engineering.
Programming Fundamentals (750113) Ch1. Problem Solving
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
BPC.1 Basic Programming Concepts
Data Structures and Programming.  John Edgar2.
Software Reengineering 2003 년 12 월 2 일 최창익, 고광 원.
1 L07SoftwareDevelopmentMethod.pptCMSC 104, Version 8/06 Software Development Method Topics l Software Development Life Cycle Reading l Section 1.4 – 1.5.
Introduction to Systems Analysis and Design Trisha Cummings.
1 Building and Maintaining Information Systems. 2 Opening Case: Yahoo! Store Allows small businesses to create their own online store – No programming.
Comp 245 Data Structures Software Engineering. What is Software Engineering? Most students obtain the problem and immediately start coding the solution.
Design-Making Projects Work (Chapter7) n Large Projects u Design often distinct from analysis or coding u Project takes weeks, months or years to create.
Planning for the Solution
CSC141 Introduction to Computer Programming
CS 425/625 Software Engineering Legacy Systems
Chapter 3: Completing the Problem- Solving Process and Getting Started with C++ Introduction to Programming with C++ Fourth Edition.
Programming Lifecycle
Experimental RELAP5-3D Time Step Improvements Dr. George L Mesina RELAP5 International Users Seminar Nov 18-20, 2008 Idaho Falls, ID.
SE: CHAPTER 7 Writing The Program
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
Lecture 1 Introduction Figures from Lewis, “C# Software Solutions”, Addison Wesley Richard Gesick.
C++ Programming Language Lecture 2 Problem Analysis and Solution Representation By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
CMSC 1041 Algorithms II Software Development Life-Cycle.
Measurements of Version 3.0 (Beta) RELAP5-3D RELAP5-3D International Users Seminar 2010 [insert optional photo(s) here] Sep 20-23, 2010.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Memory: Relocation.
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
Software Development Problem Analysis and Specification Design Implementation (Coding) Testing, Execution and Debugging Maintenance.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
Programming in C++ Dale/Weems/Headington Chapter 1 Overview of Programming and Problem Solving.
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
Software Engineering. Acknowledgement Charles Moen Sharon White Bun Yue.
1 Software Maintenance The process of changing the system after it has been delivered and in operation Software change is inevitable –New requirements.
The Hashemite University Computer Engineering Department
A Level Computing#BristolMet Session Objectives#U2 S3 MUST use/read programme flow charts accurately SHOULD adapt the calculator programme to include a.
RELAP5-3D in Fortran 90 Dr. George L Mesina RELAP5 International Users Seminar Nov 18-20, 2008 Idaho Falls, ID.
Introduction to Computer Programming using Fortran 77.
Evolution of C and C++ n C was developed by Dennis Ritchie at Bell Labs (early 1970s) as a systems programming language n C later evolved into a general-purpose.
Chapter 1: Preliminaries Lecture # 2. Chapter 1: Preliminaries Reasons for Studying Concepts of Programming Languages Programming Domains Language Evaluation.
Software Maintenance1 Software Maintenance.
1 Structured Programming Arab Academy for Science and Technology CC112 Dr. Sherif Mohamed Tawfik The Course.
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
 Problem Analysis  Coding  Debugging  Testing.
Principles of Programming & Software Engineering
Algorithms II Software Development Life-Cycle.
Lecture 1 Introduction Richard Gesick.
Chapter 2- Visual Basic Schneider
Principles of Programming and Software Engineering
Software Maintenance.
Programming Problem steps must be able to be fully & unambiguously described Problem types; Can be clearly described Cannot be clearly described (e.g.
Maintaining software solutions
Understand the Programming Process
Unit# 9: Computer Program Development
Introduction to Systems Analysis and Design
Programming Fundamentals (750113) Ch1. Problem Solving
Programming Fundamentals (750113) Ch1. Problem Solving
Chapter 2- Visual Basic Schneider
Chapter 2- Visual Basic Schneider
Understand the Programming Process
Programming Fundamentals (750113) Ch1. Problem Solving
Programming Fundamentals (750113) Ch1. Problem Solving
Software Development Chapter 1.
Software Re-engineering and Reverse Engineering
Presentation transcript:

INL/CON 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

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

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

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

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

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

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

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

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

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.

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

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)

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

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

05-GA High Level Streamlining Approach

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

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

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

05-GA Valuation of Streamlining Go to statementsBeforeAfterRatio Sub w/ 0 GO TOs Sub w/ 100+ GO TOs919 Total GO TOs Computed GO TOs Backward GO TOs Readability measure: reduction of GOTO statements and labels. –Tangle logic flow paths. Obscure base algorithm.

05-GA Valuation of Streamlining

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

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

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