Upload
ibm-ims
View
55
Download
0
Embed Size (px)
Citation preview
© 2015 IBM Corporation1
Automatic Binary Optimizer for z/OS
Roland KooOffering Manager, Compilers on z [email protected]
© 2015 IBM Corporation2
Value of IBM Compilers on z Systems
Reduce CPU utilization by improving performance of applications
• Exploitation of z/Architecture (z10, z196, zEC12, zBC12, z13, z13s)
• Advanced Optimization
Support next-generation Applications
• Modernize business critical System of Record applications to support new System of Engagement applications (e.g. web, mobile, cloud…)
• Support latest IBM Middleware (CICS, IMS, DB2…)
Improve Productivity
• New programming features
• New problem determination features
2
© 2015 IBM Corporation3
COBOL - Exploiting z/Architecture
3
zEC12/zBC12 Arch(10)• Decimal-
Floating-Point Zoned-Conversion Facility…
z13/z13s Arch(11)• Decimal-Floating-
Point Packed-Conversion Facility
• SIMD instructions…
z10EC/z10BC Arch(8)• Decimal Floating
Point (DFP)• Wider immediate
data
z196/z114 Arch(9)• Distinct Operand• Conditional Load• High Word
Instructions
Default ARCH level is now ARCH 7 - IBM System z9EC (2094-xxx models) IBM System z9 BC (2096-xxx models)
© 2015 IBM Corporation4
COBOL Offerings on z Systems
Two complementary offerings designed to improve performance of business critical COBOL applications
• Enterprise COBOL for z/OS
Compile and Optimize COBOL source code
• Automatic Binary Optimizer for z/OS
Optimize existing program modules; No need to recompile source
© 2015 IBM Corporation5
ARCH(0)
ARCH(…)
ARCH(11)
z13/z13s
Architecture Exploitation
5
V4 COBOL and below generates base ESA/390 level code
ABO generates code up to z13/z13s ARCH(11)
• Using ABO on modules compiled by COBOL v4 and below allows applications to access over 600 new hardware instructions already on clients’ machines
Original Compiled Programs
Optimized Programs
© 2015 IBM Corporation6
IBM Automatic Binary Optimizer (ABO)
V1.1 GA’d Nov 6, 2015 (z/OS v2.2); Feb 19, 2016 (z/OS v2.1)
V1.2 Announced on Oct 4. 2016; GA Nov. 11, 2016
Highlight:
• Optimizes load modules compiled with COBOL v4 and below
• Target latest z Systems (e.g. zEC12,zBC12 & z13, z13s)
• No recompilation, source migration or options tuning required
• Requires significantly less testing resource compared to re-compiling source
• System verification and performance tests only (no need for full regression test)
• Code optimized by ABO would run faster and behave the same as the original program
ABO
Original Program Binaries(Base ESA390)
Optimized Program Binaries(Latest z Systems)
http://www-03.ibm.com/software/products/en/z-compilers-optimizer
© 2015 IBM Corporation7
• Unbind• Binary � IR*
Verify
• Optimize• Optimize• Optimize…
Verify• IR �Binary• Rebind
Done
ABO Technology Overview
Original
Executable
CSECT1 … CSECTN
*IR - Intermediate Representation
ABO
Optimized
Executable
CSECT1 … CSECTN
© 2015 IBM Corporation8
Compatibility and Testing
ABO optimizes the original binary so exact behavior of
the original program is known.
No compile options (performance or otherwise) are being changed
Optimized program would run faster
and would behave the same as the
original program.
Strong compatibility guarantee for the modules produced by ABO
Requires System Verification and Performance Tests Only
If something goes wrong, revert to using original programTesting
Inter-
operability
Options
UnchangedBinary As
Input
Users can optimize objects in test environment and to deploy executable to production environment
© 2015 IBM Corporation9
What’s new in ABO v1.2 Announce: Oct 4, GA: Nov 11
• Optimization coverage • Includes program modules compiled with
• VS COBOL II V1.3 & 1.4 (LE enabled)• COBOL/370 1.1• COBOL for MVS & VM V1.2• COBOL for OS/390 & VM V2.1 & v2.2• Enterprise COBOL V3 and V4
• Includes program modules containing CICS HANDLE ABEND & CICS HANDLE AID syntax
• Link Libraries - Partially bound program modules
• Scalability - Reduced ABO CPU usage by up to 9X and memory up to 35%
• Usability - Allows selection of objects to optimize
• IBM tooling support• Compiler listings, SYSDEBUG or LANGX side files of original programs can be used
along with ABO Listings to create new side files to work with IBM DevOps tools (ADFz, Debug for z, FA, APA)
© 2015 IBM Corporation10
ABO Example – Numeric Edited MOVE – 2.35x Faster
01 WS-VAR-1 PIC S9(9)V99 COMP-3.
01 WS-VAR-2 PIC ZZZ,ZZZ,ZZ9.99.
MOVE WS-VAR-1 to WS-VAR-2
Automatic Binary Optimizer
• Decompose edit behavior to a longer but much faster sequence
TP 0(6,R4)
...
UNPK 340(11,R10),0(6,R4)
IIHF R1,1075847200
OI 350(,R10),X'F0'
IILF R1,1797267488
...
ICM R1,X'3',349(,R10)
CDPT FP0,0(6,R4),0x8
STCM R1,X'7',284(,R5)
...
V4 OPT(FULL)
• Uses traditional ED (edit) instruction
MVC 272(15,13),103(10)
L 2,300(0,9
ED 272(15,13),0(2)
MVC 8(14,2),273(13)
10
© 2015 IBM Corporation11
ABO Example – Decimal To Float MOVE – 3.97x Faster
01 WS-VAR-1 PIC S9(7)V99.
01 WS-VAR-2 comp-2.
MOVE WS-VAR-1 to WS-VAR-2
Automatic Binary Optimizer
• Decimal to float conversion is inlined using a more efficient algorithm
CVB R0,340(,R10)
LD FP8,256(,R7)
CXFR FP0,R6
DXR FP4,FP8
...
AXR FP4,FP0
LDXR FP0,FP4
V4 OPT(FULL)
• Library Call for decimal to float conversion
• Runtime path length is > 100 instructions
L 3,92(0,9)
L 15,268(0,3) V(IGZCFPC )
LA 1,227(0,10)
BASR 14,15
MVC 16(8,2),272(13)
11
© 2015 IBM Corporation12
PerformanceABO Reduces Processing Time and CPU
Original ABO onCOBOLV3/V4
ABO onCOBOL V2
ABO onCOBOLV1R2
ABO on VSCOBOL II
35% 25% 27% 29%
ABO 1.2 Reduces CPU Time and Service Units up to 35%
Internal Benchmarks : Mix of Compute and I/O Bound Applications – z13
ABO produced modules perform the same amount of work but consume fewer CPU resources compared to the original module : reduce CPU usage ���� reduce processing costs
Beta/Trial customer results show reductions in CPU time between 5% ���� 40% compared to the original program modules
The CPU time reductions will vary by application but expected to average about 15%• Elapsed time and service units also decrease similarly
*Performance data contained herein was generally obtained in a controlled, isolated environments. Customer examples are presented as illustrations of how those customers have used IBM products and the results they may have achieved. Actual performance, cost, savings or other results in other operating environments may vary.
© 2015 IBM Corporation13
• Increase performance of COBOL applications
• Reduce Processing Time & CPU
• Lowers cost of all MLC software by driving down peak 4HRA workload (MSU)
ABO – Economics
MLC cost is calculated based on peak 4HRA workload (MSU)
COBOL Applications
DB2
CICS
.
.
.
No ABO With ABO
Increasing performance of COBOL Applications lowers peak 4HRA workload (MSU). Lowers overall MLC cost for entire system
Save $
PeakMSU
PeakMSUCOBOL
Applications
With ABO
Increasing performance of COBOL Applications lowers processing time and releases capacity for other workloads
Save Capacity
PeakMSU
COBOL applications drive peak 4HRA
COBOL applications run in “white space”
.
.
.
DB2
CICS
CICS
DB2
COBOL Applications
.
.
.
© 2015 IBM Corporation14
Tools & Middleware Support
IBM Application Delivery Foundation for z (ADFz)Provides Day-1 support
• SYSDEBUG of original programs can be used along with ABO Listings to create new side files to work with
• Fault Analyzer (FA) - Provide ABEND analysis of optimized load modules
• Debug for z - Allows users to step through and debug optimized programs interactively
• Application Performance Analyzer (APA)• Allows users to compare the performance of original programs and
optimized programs
ISVs Tools• Working with Compuware, CA, Macro 4 on ABO support
Middleware• DB2, CICS, and IMS
Debug for z
FA
APA
© 2015 IBM Corporation15
Tooling Support For The Optimized Modules
What is changing in the optimized modules:• New instructions will replace the original instructions
• An additional program literals area is created for use by the new instructions
• New language ID entries, timestamps and other metadata
• ABO IDRL is 5697-AB1
What is not changing in the optimized modules :• All control blocks and data areas (e.g. TGT, DSA, working/local storage, original program
literals) remain unchanged
What ABO provides to support tooling enhancements:• A ‘listing transform’ to map original offsets/instructions to new offsets/instructions
• Retaining original metadata (e.g. language ID, timestamps, info signature bytes) in the optimized module
• New PPA4 section with information about the optimized module
© 2015 IBM Corporation16
COBOL v4.2 compiler listing:
000027 COMPUTE
00042C F247 D110 8000 PACK 272(5,13),0(8,8) TS2=0 WS-
VAR-1
000432 960F D114 OI 276(13),X'0F' TS2=4
000436 F247 D118 8008 PACK 280(5,13),8(8,8) TS2=8 WS-
VAR-2
00043C 960F D11C OI 284(13),X'0F' TS2=12
000440 FA44 D110 D118 AP 272(5,13),280(5,13) TS2=0 TS2=8
000446 F374 8010 D110 UNPK 16(8,8),272(5,13) WS-VAR-3 TS2=0
00044C 96F0 8017 OI 23(8),X'F0' WS-VAR-3+7
Listing Transform:
00042C PACK 272(5,13),0(8,8)
000432 OI 276(13),15
0004C4 ED07 4000 00AA 00042C CDZT FP0,_WSA[0x12c]
0(8,R4),0x0
000436 PACK 280(5,13),8(8,8)
00043C OI 284(13),15
0004CA ED07 4008 10AA 000436 CDZT FP1,_WSA[0x12c]
8(8,R4),0x0
000440 AP 272(5,13),280(5,13)
0004D0 B3D2 1000 000440 ADTR FP0,FP0,FP1
000446 UNPK 16(8,8),272(5,13)
00044C OI 23(8),240
0004D4 ED07 4010 00A8 00044C CZDT FP0, 16(8,R4),0x0
COBOL Program:
000027 COMPUTE WS-VAR-3 = WS-VAR-1 + WS-VAR-2.
Input “source” instructions. Starts at column 1
Optimized Instructions. Starts at column 5
LEGEND:
Source Line number in original program.
CSECT offset of instruction generated by COBOL
4.2 Compiler
CSECT offset of instructions generated by ABO
Each optimized instruction generated is also annotated with the “source” offset that it was generated for
Allows tracking as instructions are re-ordered
Tooling Support For The Optimized ModulesListing Transform Walkthrough
© 2015 IBM Corporation17
ABO and COBOL V6 are complementary
Recommendation : Use both offerings to increase time to value and ROI
Use Case ABO COBOL V6
Improve performance without recompile, migration or options tuning
�
No concerns for Interoperability/Legacy Compatibility – Load modules, program objects, OS/VS COBOL etc…
�
No need to be limited by ARCH setting of DR* machine. Optimize for deployment machine and run original binaries on DR
�
Source code not available �
New COBOL application development or modernize existing applications to work with new infrastructure (e.g. web, mobile….)
�
Need source changes (e.g. defect fixes and/or minor enhancements)
�
Maximize performance improvement �
*DR ���� Disaster Recovery Machine ���� Usually older hardware since it is only used in emergency situation. This limits Compiler ARCH setting used
to compile the application. As a result, the application cannot be fully optimized deployment machine which usually is more current hardware.
© 2015 IBM Corporation18
Summary
• Old COBOL compilers (V4 and below) generates code for very old z/architectures and has limited optimization capabilities
• Only COBOL V5 and V6 have advanced optimization and code generation technologies to optimize and fully exploit z/architectures (z10, z196, zEC12, z13, z13s)
• Most clients do not re-compile 100% of their applications.
• With COBOL V5/V6, they selectively re-compile modules to improve performance.
• Not getting full benefit of z/Architecture
• Use ABO in conjunction to COBOL V5/V6 to increase application performance
• Use COBOL V5/V6 to compile code that needs to be changed
• Use ABO to optimize the parts that are not in recompile plan or reduce migration effort
• IBM ADFz provides full support for ABO
• Fault Analyzer, Debug for z and Application Performance Analyzer • SYSDEBUG file can be used along with ABO Listings to create new side files for
problem determination
© 2015 IBM Corporation19
Automatic Binary Optimizer for z/OS Trial
Zero cost evaluation license for 90 days
Allows clients to assess the value of Automatic Binary Optimizer
• Offer same function as GA product
• Ships with latest PTF
• Code processed by trial versions cannot be used for production
Available as standard ShopzSeries offering or Cloud Service
� Contact your IBM representative for ordering assistance
For more information, visit http://www-03.ibm.com/software/products/en/ibm-automatic-binary-optimizer-trial-for-zos
19
© 2015 IBM Corporation20
ABO Trial Cloud Service
Evaluate ABO - no installation needed
1) Sign on using IBM ID (Intranet ID for IBMers)2) Upload existing tersed dataset 3) Select module in dataset to be optimized and target machine level 4) Download tersed dataset containing optimized module and logs5) Test performance on your local machine
ethttps://optimizer.mybluemix.n
et
© 2015 IBM Corporation21
Resources
Product Page : http://www-03.ibm.com/software/products/en/z-compilers-optimizer
Documentation: http://www-01.ibm.com/support/docview.wss?uid=swg27046990
Technote for running on z/OS V2.1: http://www-01.ibm.com/support/docview.wss?uid=swg21977257
Trial Page: http://www-03.ibm.com/software/products/en/ibm-automatic-binary-optimizer-trial-for-zos
Trial on Cloud: https://optimizer.mybluemix.net
ABO V1.2 blog
RFE community: ABO
ABO Demo: https://youtu.be/xhnhdOQwwSQ