Download presentation
Presentation is loading. Please wait.
Published byBruce Crawford Modified over 9 years ago
1
www.inl.gov Measurements of Version 3.0 (Beta) RELAP5-3D RELAP5-3D International Users Seminar 2010 [insert optional photo(s) here] Sep 20-23, 2010
2
Outline Static Measures Improvements to the 3D capability in RELAP5-3D Dynamic Measures 2
3
Static and Dynamic Measures Dynamic Measures – Metrics that are obtained when the code is run – Coverage analysis, profiling, run speed, etc Static measures – Metrics that apply to the code when it is not running – Code structure, features, user problems, etc. 3
4
Feature Comparison 2.4 and Beta (3.0) CategoryVersion 2.4.3 (Pre-F95)Beta (Post-F95) Direct Access Restart-Plot File AvailableEliminated Pre-run GUIRGUI Launch Station, SNAP RGUI Limited Launch Station, SNAP Runtime GUIRGUI Plant ImageNot converted RGUI ReplayAvailableEliminated SCDAPAvailableNot converted CompilersMany, but older, compilersOnly Intel 9.1, 10.1 Downgrades
5
Upgrades * These are reported in another presentation Feature Comparison 2.4 and Beta (3.0) CategoryVersion 2.4.1.2 (Pre-F95)Beta (Post-F95) DatabaseLinear, index-pointersF95 Modules, derived types MemoryUpper-limitedExpands to fit user’s model CodingExtended F66, F77, F90 and compiler extensions F95 ModularityUnstructuredStructured (strongly modular) Dead CodeMany unused subroutines162 unused files removed
6
Feature Comparison 2.4 and Beta (3.0) CategoryVersion 2.4.1.2 (Pre-F95)Beta (Post-F95) PlatformsWindows, UnixLinux, Windows, Unix Restart-file formCombined restart-plot fileSeparate restart and plot files PortabilityO/S specific bit-, time-, and location-intrinsics Fully portable F95 intrinsic library Ordinary Binary machine dependent rstplt XDR binary machine independent files FluidsBase 2.4.1.2Base + additions* Physical modelsBase 2.4.1.2Base + additions* Upgrades
7
Spaghetti Code to Structured Code Spaghetti Code is code that is hard to read because – Tangled (interwoven) logic paths. Symptom: go-to’s and line labels – Knots (backward jumps). Symptom: backward go to. – Obscure coding (multiple-return, assign-stmt, computed go to, etc.) – Lacks consistent indentation and other helpful programming style Spaghetti code is considered bad practice – Prone to experience errors, – Cause of errors are difficult to locate 7
8
Improvement: Restructured Code Computer Science solution – Apply structured programming Commercial restructuring package applied (between 2.4 and 3.0) – Workaround for pre-compiler directives was created Restructurer actions – Eliminate go-to statements – Pull sections of code together – Enforce consistent style – Eliminate dead code w/in subroutines 8
9
05-GA Static Measure: Readability measures Go to statements2.4%Beta% 2.4 / Beta File w/ 0 GO TOs25546420670.66 File w/ 10+ GO TOs1322465102.03 File w/ 51+ GO TOs417.44.6310.25 File w/ 86+ GO TOs142.51.1614.00 Total GO TOs670732209.793.04 Computed GO TOs100.047.00314.29 Backward GO TOs ** Spaghetti ** 822.345.01618.27 Reduction of GOTO statements Lines of code: 249400 (2.4.1.2), 278100 (3.0.0) Source code files: 554 (2.4.1.2), 630 (3.0.0)
10
05- GA Static Measure: Line Label Reduction
11
Static Measure (Spaghetti) – McCabe Index Complexity 2.4.1.2Beta Maximum cyclomatic number 982460 Files with cyclomatic number >= 100 6813 McCabe Cyclomatic index = industry-standard, code-complexity measure. Number of independent linear paths through code Indicates the number of branches within it. Higher indices => more branches => harder to maintain. Cyclomatic index of 100 or less is generally considered low complexity and good programming Only input processing subroutines have 100+ index
12
Static Measures: Nesting and Documentation Measurement Category 2.4.1.2Beta Maximum Nesting (levels deep) 2015 Best comments to code ratio 6.6432.2 Files w/ comments to code ratio >= 0.3 390954 Nesting is containment of one programming structure (loop, select, or sequence) within another Nesting level is the number of such structures containing a block of code Less nesting is generally easier read and maintain Internal documentation (comments) improves readability Documentation was added. Guidelines were applied.
13
Static Measure: User Problems Solved YearReportsResolved Fixed after 2.4.1.2 Conversion to F95 fixed it 1998853111 1999755011 2000924722 2001866733 2002867200 2003614422 2004623977 20055532302 20067136351 20075127234 20084723185 20094210 0 Total81347813228
14
Dynamic Measure: Coverage Analysis Category Pre-F95 Version 2.4.1.2 F95 Beta Version Test Cases1883130 Product Release188221 PVM Dt Tests02856 DA053 Coverage AnalysisFilesStmtsFilesStmts Relap Directory63.8744.7280.3761.51 Envrl Directory35.4638.9154.2451.91 Beta code is much more heavily tested Beta code’s test suite covers a much higher percentage of files and statements – Reduces the likelihood of error
15
Improvements to 3D Capability of RELAP5-3D Viscosity terms for Cartesian and Cylindrical Coordinates, SI – Beta Version 3.0.0: Liquid momentum equations, 2009 – Version 3.0.1: Gas momentum equations, 2010 – Version 3.0.1: Simple turbulence term, 2010 Would like more grid cells for good turbulence modeling Want more 3D volumes for many modeling purposes Version 2.4 had many 3D restrictions – Could receive message:“Too many parallel connections” E.G. Code stops with that message on a 6x6x6 region. – 2400 junctions upper limit – 999 volumes upper limit 15
16
Improvements to 3D of RELAP5-3D (cont.) Eliminated 3D Limits in Beta and post-Beta – Beta Version 3.0.0: “Parallel connections” overcome by allocation – Version 3.0.1: 2400 junction limit overcome by allocating – Version 3.0.1: 999 (artificial) volume limit removed Up to 9x99x99 volumes possible Enough for many modeling needs Version 2.4 solvers too limited for these large regions – Ver. 2.4 Original default solver, MA-18, too slow – PGMRES is faster but had its own hard-coded size limits – Ver. 2.4 default solver, BPLU, limited by size of FA array Version 3.0.0 removes hard-coded and FA size restrictions 16
17
Dynamic Measure: R5-3D Times on 3D-Region SI Cylindrical 3D region from Loft L2-5 Test 100 Advancements with Semi Implicit Method – Full multi-D (cross derivative terms included) Whole code transient CPU time with solvers PGMRES and BPLU Platform: Sun AMD Opteron, Open Suse 11.2, ifort 10.1 17 MA18 Times 8x8x5 2233.7 8x8x817529. 8x8x1047527. 8x8x1385430. Too slow!
18
Dynamic Measure: R5-3D 3D-Regions Times - NI 18
19
Dynamic Measures: Grind time Grind time is average time taken for one advancement. 19 BPLUPGMRES SemiNearlySemiNearly 6x6x60.0198s0.199s0.0221s0.190s 6x6x240.054s0.82s0.064s3.77s 6x6x960.363s3.64s0.437s76.82s 8x8x80.033s2.44s0.0387s1.46s 8x8x160.072s5.96s0.11s7.97s 8x8x640.47s26.4s0.56s161.s Non-solver RELAP5-3D operations could obscure the solver times.
20
Dynamic Measure: R5-3D Solver Clock Cycles NI BPLU time is O(n), PGMRES time is O(n 2 ) as n increases. 20
21
Conclusions Upside of Beta version vs. version 2.4 Beta version 3.0 has many new features. Beta version expands memory to fit user’s model. Beta version has virtually no spaghetti coding Beta version of RELAP5-3D has much improved 3D capability Beta version has very efficient solvers for 3D regions Downside RGUI mostly unavailable Support fewer compilers 21
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.