














Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!















March, 1990 CM)
Chuck Boeheim
Stanford Linear Accelerator Center Stanford University, Stanford, CA 94309
The Stanford Linear Accelerator Center has recently completed a conversion to IBM’s VM/XA SP Release 2 operating system. (^) The primary physics application had been constrained by the previous 16 megabyte memory limit. Work is underway to enable this application to exploit the new features of VM/XA.
This paper presents a brief tutorial on how to convert an application to exploit VM/XA and discusses some of the SLAC experiences in doing so.
Presented at SHARE 74, Anaheim, CA, March 4-9,199O
Physicists at the Stanford Linear Accelerator Center are attempting to measure the mass of the Z” particle, one of the particles that mediate the weak nuclear force. This project has seen the con- version of the existing two-mile-long linear accelerator into a unique linear collider. Electrons and positrons are accelerated to near the velocity of light, separated and steered around two op- posing arcs to meet head-on in beams six microns in cross-section. Some of these particles col-
lide, and some of these collisions produce the massive ZO particle, which in turn decays into a number.o_f other particles. The ZO exists for such a short time that it can be detected only by de- tecting the particles into which it decomposes.
Each of these “events” is painstakingly recorded by a detector, which will log about 256K bytes per event. In addition, Monte-Carlo simulations of events will log 400K bytes per event. Researchers hope to log around one hundred thousand of each type of event per year. The total data storage needs of this project will be around one terrabyte of data per year.
A complex data-analysis system has been developed for the processing of these events. At around 200,000 lines of MORTRAN, a FORTRAN preprocessor language, it’s a hefty 6 megabytes of object code. It provides for batch data reduction and interactive analysis, including physics simulation, detector simulation, event reconstruction, event display (3D visualization), interactive data analysis (IDA), and a data manager. An additional 4 megabytes of descriptive constants are required, plus at least one megabyte of data for a typical analysis.
Under VM/SP about 10.5 megabytes were available beneath the shared segments for CMS and other programs required for interactive work. The complete program simply couldn’t fit in memory, forcing its use in individual segments. On the VAX/VMS system where this software also ran, workspaces of 40 megabytes were often used. A solution was needed to provide for equivalent address spaces on the IBM equipment where this program did most of its production work.
program that is only XA tolerant, at least in VM/XA SP Release 2, is XEDIT. Even if you have 100 megabytes of virtual storage, you cannot edit any file that will not fit in the available memory below 16 megabytes. You would need to make the same conversions for these pro- grams as for 370-only programs, plus changes because of 370 instructions that are not valid in XA architecture, because the XA PSW has a different format, or because interrupts are handled differently. These changes would most often be found in assembler language programs or subroutines.
XA. exploitation programs take advantage of new XA features, such as larger address spaces. It is possible to write programs that run only in XA architecture and not in 370, but you would rarely find such a program in practice. You would need to worry about the previously- mentioned conversions, in addition the program must handle 31-bit addresses and must use some new CMS services. The last section of this paper will describe how to do that.
The good news is that most of the high-level languages such as FORTRAN, PL/I, and C create object code that is in this third category. If you write entirely in these languages, your programs will be all ready for XA exploitation.
There are many strategies for conversion, and they have been covered well in other SHARE talks, so I’ll just briefly describe the method that SLAC chose. We acquired a used 3083 CPU for the duration of the conversion effort (about 12 months). We brought up VM/XA SP Release 2 on. the 3083, while the 3090/3081 complex continued to run HP0 4.2 and CMS 5.0. The minidisk-sharing component of ISF was installed in HPO, and the CSE SPE was installed in VMKA. This enabled the systems to share all minidisks with protection from multiple write links.
Early in the conversion the 3083 ran only an abbreviated directory, allowing only staff members to log on. After the majority of the system was in place, the full directory was loaded. Users were able, and encouraged, to log on to their accounts on the 3083 to test software.
When converting a program for XA, you can choose either to make a new version of the program that executes only in VM/XA, or to make a version that executes either in the old system or the new. The strategy that you choose will depend on the individual program and the way that it is supplied to the user. If there is only one common disk, you will need to make the program dual-
path; it will need to decide at execution time which system it is running under and which services it can use. If you have separate disks for each system, you can simply make a new, VM/XA- only version. You will need to evaluate this for each program that needs conversion. A few pro- grams may need a major redesign for XA, and it may not be practical to dual-path them.
Subroutine libraries can pose a special problem. You may convert the subroutines in the librar- ies, but unless the users relink their programs with the new library, they will not get the benefit of the change. We found that we not only had to convert the subroutines, but also make them available on the HP0 system as well as the XA system well in advance of the conversion date, to give users an opportunity to relit& their programs. All subroutines had to be dual-path. We did not want users to have to relink their programs when they logged on to the XA system for testing and then to relink again when they logged back on the the HP0 system. We also did not want to force everyone to relink on the morning of the final conversion.
We supplied different Y disks on the two systems, both to accommodate the few program prod- ucts that had VM/XA-only versions, and to avoid massive perturbations of the production system as we obtained and installed new VM/XA-compatible versions of programs.
When your system is running VM/XA, the real machine is using the XA architecture. However, each virtual machine may choose independently to use either 370 or XA architecture. The SET MACHINE command chooses an architecture (see Figure 1). You must re-IPL CMS after a SET MACHINE command, just as you do after DEFINE STORAGE.
which allows you to address up to 2 gigabytes of memory (231 bytes).
Which type of address the program is using is determined by the AMODE bit in the PSW. When your program is started by CMS, it will be started in the AMODE that it requested. There are as- sembler instructions to change AMODE as needed. These are mainly needed when transferring control between programs that need different AMODEs, or when working with data areas or pa- rameter lists passed between unlike programs.
The AMODE attribute of a program designates which AMODE it can execute in. AMODE 24 means that the program is not capable of handling 31 bit addresses and must receive control in AMODE 24. AMODE 31 means that the program is capable of handling 31 bit addresses and must receive control in AMODE 31. AMODE ANY means that the program is capable of han- dling either 31 or 24 bit addresses, and receives control in the AMODE of the calling program.
If you’re having trouble making sense of the preceding paragraph, notice that we’re using AMODE in two different ways. The AMODE attribute of a program tells CMS the addressing mode to use when starting a program. The AMODE of an executing program is determined by a bit in the PSW, and the program can change it as needed. The AMODE attribute of a program is simply a way to get your program started off in the correct AMODE. .*
The AMODE attribute is assigned to a TEXT file by the compiler. Most current compilers such as VS FORTRAN and PIJI assign AMODE ANY to their TEXT files. Some older compilers as- sign AMODE 24. In assembler, the AMODE statement can select any AMODE for the object file. The AMODE of a MODULE defaults to the AMODE of the first TEXT file included in it.
In VM/XA your virtual machine is divided into two areas: the memory less than or equal to six- teen megabytes, and any memory greater than that. The memory below 16 megabytes is that ad- dressable in AMODE 24; all memory is addressable in AMODE 31. This division is so impor- tant that it’s called the sixteen megabyte line.
If a program is AMODE 24, it must execute below the 16 megabyte line; if it is AMODE 31 or ANY, it may execute either above or below the line. (^) CMS itself runs just below the line, but has some of its data areas just above the line (see Figure 3).
Where the program executes is called its Residency Mode or RMODE. There are only two choices: RMODE 24 means the program must execute below 16 megabytes. The program may have any AMODE. RMODE ANY means the program may execute either above or below the line. If sufficient memory is available above the line, it will load there. If not, it will load below. A -program with RMODE ANY cannot have AMODE24. The RMODE of a MODULE defaults to ANY if &I of its components’ AMODEs are 31 or ANY. RMODE is forced to 24 if any included TEXT has AMODE 24.
1000000 (16M)
EOOOOO (14M)
I
14000
EOOO 0 Figure 3: Map of CMS Storage
It can be puzzling at times to determine the AMODEs and RMODEs of TEXT and MODULE files. IBM provides no easy way to determine these attributes, so I wrote two commands, TEX- TINFO and MODINFO, to help out (see Figure 4, page 7). These two commands are available on VMSHARE or from SLAC.
textinfo test Name Length^ Amode^ Rmode TEST OOOOOOB8 Any (^) Any Ready; T=O.Ol/O.Ol 14:50: textinfo fortslac txtlib Name Length Amode^ Rmode A2INT 0000009E 24 24 BLKEST 00000000 Any (^) Any CHK218 00000000 Any (^) Any CONVER7 00000110 24 24
... Ready; T=O.O2/0.06 10:35: modinfo mount Name Origin Length Entry Pt Amode Rmode Arch Attributes MOUNT 00020000 OOOlOBBO 00024AC8 24 24 Any^ Noclean... Ready; T=O.Ol/O.Ol 10:41:
Figure 4: TEXTINFO and MODINFO commands
If you are loading more than one TEXT file, and a subsequent TEXT file has a more restrictive AMODE than the frost, the load will restart below the line. This is almost never what you want. If you change the disk search order between the LOAD command and a subsequent INCLUDE the LOAD would be unable to restart. If you have this situation you should try either to fix the more restrictive AMODE or to specify AMODE 24 explicitly on the LOAD command so that it starts correctly (see Figure 6).
load test Ready; T=0.02/0.18 11:58: &o4-P Name Entry Origin Bytes Attributes TEST31 01021000 01021000 00000008 Amode 31 Non-reloc Ready; T=O.Ol/O.Ol 12:08: include test Restrictive RMODE encountered in CSECT TEST24. LOAD continues below 16Mb. Ready; T=0.01/0.09 12:08: p=ogmap Name TESTi
Entry Origin Bytes Attributes 00014008 00014008 00000008 Amode 24 Non-reloc TEST31 00014000 00014000 00000008 Amode 31 Non-reloc Ready: T=O.Ol/O.Ol 11:58: Figure 6: Restarting a LOAD
A corollary is that a linked program must go either entirelv above or entirelv below the 16 megabyte line. If you must do this, e.g., for a program that won’t fit below the line but must use some subroutines that are AMODE 24, you will have to split the program. You can dynamically load subroutines from TXTLIBs or LOADLIBs and LINK to them, though transferring control in the correct AMODE can be tricky. Dynamically acquired data areas can also be split from the program; these include FORTRAN dynamic commons.
There are two kinds of modules in VM/XA: relocatable and non-relocatable. Relocatable mod- ules load in memory at the highest address appropriate to their RMODE. Non-relocatable mod- -ules load at the fixed address at which they were generated. Non-relocatable modules are the more traditional type of CMS module, and they may be the simplest to use when initially con- verting programs. However, relocatable modules are very important for RMODE ANY mod- ules. If you make an RMODE ANY non-relocatable module in a small or 370 virtual machine, it
will never run above the line, because it always runs at the fixed address below the line. If you make it in a large XA machine, it will never run in a smaller virtual machine.
You may override the AMODE and RMODE attributes on both the LOAD and GENMOD com- mands. Just because you can doesn’t mean you should, however. You can safely downgrade AMODE and RMODE of ANY or 31 to 24, because that is more restrictive. It’s generally not safe to upgrade AMODE or RMODE 24 to ANY or 31. It is possible to have TEXT files marked AMODE and RMODE 24 that you know to be 31-bit capable. However, it’s always worth tak- ing the time to recompile or reassemble the routine to get it marked correctly.
A backwards compatibility note: You can generate modules in VM/XA that execute properly in previous releases of CMS if you watch out for a few “gotchas”. The extra information about AMODE and RMODE etc. is generally ignored by earlier CMSs. However, the meaning and de- fault of the STRiNOSTR option of GENMOD has changed. The result is that a program that uses OS storage macros (including FORTRAN, PL/I, et.al.) that is linked and GENMODed in VM/XA will not work under earlier CMSs if you use the default option. If you explicitly specify the STR option on the GENMOD in VM/XA, the resulting module will execute properly in all CMS releases.
You also have to be careful of the default of SET LOADAREA RESPECT in an XA architecture virtual machine. This will cause modules to be generated at X’14000’. Such a module cannot load properly in earlier releases of CMS. Use SET LOADAREA 20000 or an explicit ORIGIN option to maintain backwards compatibility.
VM/XA now manages programs in memory. Older versions of CMS did not attempt to do this and allowed programs to be overlaid. CMS 5.5 now deletes previously loaded programs that oc- cupy the memory needed by subsequent programs. Programs that depend on the old behavior to produce defacto overlay structures will no longer work.
LOADing a TEXT file also deletes previously loaded programs, unless the PRES option is used. However, even if two programs are simultaneously loaded, they remain two independent entities. In Figure 7, two programs are loaded at non-overlapping addresses. A subsequent PROGMAP command shows that the first program has disappeared. They are loaded again, this time with the PRES option on the second one. This time both programs remain in memory. However, the
Shared segment support is quite different in VM/XA. With large virtual machines, shared segments may have to load within the virtual machine.
Assume that, for example, the VS FORTRAN compiler’s shared segment must load at 11M every time you compile a program. If your virtual machine is smaller than 1 lM, the segment loads above the end of your machine, as it does in VM/SP. If your virtual machine is larger than 1 lM,- CMS makes room for the segment within your virtual machine.
If the memory needed for that segment is already in use when you try to compile, you will receive an error message. To prevent this error, you may
2000000 (32M)
EOOOOO (14M) BOO000 (11M)
14000 EOOO
reserve space for the segment with-the SEGMENT RESERVE command. This should be done in the PROFILE EXEC if possible, or the storage may already be in use.. .“.
SEGMENT RESERVE has several disadvantages, however. Users must know the name of the segment, which may or may not have a meaningful relationship with the product. The SEGMENT RESERVE command also ties up that storage until explicitly released, preventing any overlapping segment from using that space. That can be a disadvantage if several unrelated products share the same address range, or if test and production versions of a program are de- fined to overlap (as they usually are).
Some instructions behave differently depending on the AMODE of the executing program. In general, these differences involve addresses as 24-bit or 3 1 -bit quantities.
In AMODE 24, the Load Address (LA) instruction clears the high-order byte to zero. In AMODE 31, it clears only the high-order bit to zero. If you want to clear a known 24-bit -address, use N Rn,=X’OOFFFFFF’. This works regardless of the current AMODE.
In AMODE 24, the Branch and Link instructions (BAL and BALR) put the program mask in the high-order byte of the 24-bit return address. In AMODE 31 they put the addressing mode in the
high-order bit of the 3 l-bit return address. If you were using these instructions to obtain the pro- gram mask, use the IPM instruction instead. Unfortunately, IPM is an XA-only instruction, so programs that need to do this in any architecture will have to use dual-path code.
A program can switch AMODEs as it executes. It might do this to prepare or process control blocks or parameter lists used by programs in different AMODEs. There are a number of ma- chine instructions that can be used to change AMODE, but the easiest way is to use the AMODESW macro. This macro can also be used to call subroutines or externally-loaded pro- grams, saving, changing, and restoring the AMODE in the process.
._ _ AMODESW SET,AMODE= AMODESW SET,AMODE=3 1
The most frequent change needed to an Assembler program is for SSM (Set System Mask) instructions. This instruction is valid in both 370 and XA architectures, but the mask values are different. If an untested program ends with a specification exception, and the location four bytes before the error address contains X’80’, then the offending instruction is an SSM (see Figure 8).
bomber .e DMSITP141T Specification exception occurred at 80014022 in routine BOMBER CMS #cp display 914016 ROOO14OlE 80 E Figure 8: Detecting an SSM instruction in XA
The ENABLE macro can be used to enable or disable interrupts in any architecture or release of CMS. You do need the new macro libraries to assemble the macro, but once assembled, the re- sulting program will run in any release of CMS.
If you had... Use. u SSM =X’OO’ ENABLE^ INTTYPE=NONE SSM =X’FF’ ENABLE^ INl-I’YPE=ALL
To use memory above the 16 megabyte line, you must also use CMS services that work with 31 bit addresses. Many old services do not, and there are new replacements.
If your program used... Now it should use...
DMSFREE macro DMSFRET macro LINEDIT macro
. _ _ RDTERM macro WRTERM macro DMSKEY, DMSEXS macros svc 202 ASCANN function ATI’N function NUCEXT function S U B C O M f u n c t i o n WAITRD function - DIAG 58 (fullscreen) DIAG 64 (shared segments) DIAG 20 (I/O)
CMSSTOR OBTAIN macro CMSSTOR RELEASE macro APPLMSG macro LINERD macro LINEWRT macro IPK, SPK instructions CMSCALL macro (SVC 204) SCAN macro CMSSTACK macro NUCEXT macro SUBCOM macro LINERD macro _ CONSOLE macro. SEGMENT macro DIAG A
Figure 10: New CMS Services
The new services are all at least functional replacements on the old services; many are substan- tial improvements on the old. However, use of them will prevent your program from running in earlier releases of CMS2. As with the architecture dependent machine instructions, you must sometimes make execution-time choices between instructions or macros (see Figure 11).
kit; CMSPROG,VMSP5 If^ this^ is^ CMS^ 5.0^ (or^ before) BH CMS55 do
... CMS^ 5.0^ dependent^ code. B SKIP1^ end CMS55 DS OH else^ do SKIP1 ;8' OH
CMS 5.5 dependent code. end
... TM NUCMF'LAG,NUCMXA If this is 370 architecture BO XAARCH do ... 370 arch dependent code. B SKIP2 end MC-H DS OH else^ do SKIP2 **' OH
XA arch dependent code. DS end &LEVEL NUCON END Figure I I : Dual paths for programs
The conventions for receiving control in a MODULE from CMS have changed somewhat. They are detailed in Figure 12. The major change is that the calltype flag that was ‘previously passed in the high-order byte of Rl is now in the save area pointed to by R13 instead. This, of course, is to allow the address in Rl to be a 31 bit address.
The conversion effort was moderately disruptive to the user community. Four Systems Programmers were involved over the course of a year. A significant number of people from User Services spent time on the conversion, installing new vendor packages, converting local software, writing documentation and assisting users. An unknown amount of effort was also re- quired by individual users. The experimental groups with complex software had a fair bit of trouble in conversion, and the group that required XA exploitation found that a great deal of ef- fort .was required (and spent quite a bit of time in my office).
As mentioned previously, a number of local programs were left behind, but often because they were functionally replaced by other programs, or because they were little used. We used the CMAP monitoring program from VM*CMS Unlimited to aid in determining which programs to leave behind. No major vendor packages were left behind, and most would even run in XA ar- chitecture virtual machines as well.
In some respects, the conversion was surprisingly easy. Many programs ran with little or no change, even in XA architecture. Most of those that did not convert did not use the standard sys- tem interfaces, or depended on system internals. In a number of cases it was simpler to rewrite an ill-behaved program than it was to change it; I took the opportunity to rewrite several assem- bler programs in C.
SLAC will continue working towards full XA exploitation. The cutover date from HP0 to VM/XA is February 21, 1990. After that, more effort will be directed towards changing pro- grams for XA toleration and exploitation.
More work is needed by IBM to move the system towards maturity. VM/SP and VMKA should be converged towards a common system. VM/XA needs many of the features that VM/SP Release 6 and even Release 5 have. SHARE must continue to work with IBM in defining our requirements for future releases.
Bimodal CMS for VM/XA Systems A very high-level summary of the changes in CMS 5.5. It won’t tell you anything substantive. Co ersion Notebook ThiIitle sounds promising, but I wouldn’t recommend it for most people. Most of the book is concerned with hardware and network planning and with system generation. However, there is one very useful 10 page section that lists all the differences in CP commands and responses between HP0 and XA. VM/XA SP Bimodal CMS Application Programming Considerations This is a well-written and informative manual (it was written by one of the XA system developers). It is mostly for those who write in Assembler, but has some item of interest to Fortran programmers, especially those with complex linking requirements. The topics included are: program handling, program invocation, segment management, storage management, REXX (just a little bit), dual-path code with good examples, migration planning, and loader operation. CMS ADDlication Proma Co ers’o Gu’de This manual surnmarizes~e ckgds Ltween VM/SP and VM/XA-SP in both CMS and CP. There is some overlap with the ‘Programming Considerations’ manual above, but enough different information for it to be worth a read. Again, it is mostly for Assembler programmers. Topics include System/ compatibility, 370-X-A toleration, 370-XA exploitation, VM/XA SP CMS functional changes, and the VM/XA SP CMS programming interface.
CMS ADDliCatiOn Program Development Gu’de This is a detailed guide to developing programs under CMS 5.5. It roughly corresponds to the old (SC24-5286) VM/SP CMS for System Programming manual. It has been totally rewritten and reorganized and has a great deal of useful information about the new architecture. The major topics are using CMS native services, managing CMS programs, and OSFIVS, DOWSE, and VSAM simulation. CMS 1 Jse ‘s Gu’de This is thzcommand-level guide to using CMS. It has not changed a great deal from VWSP release 5. System Product Interpreter tREXX) Use ‘s Gu’de No change from SC24-5238 for VM/SP Releaie 5. Syste Product Editor (XEDIT) Use ‘s Gu’de No chtge from SC24-5220 for VM,&P Rilease 5.
Virtual Machine Operation A guide to running guest operating systems such as MVS or DOS/WE under VM/XA. Not of interest to most people. It does contain the tutorial on how to use the new TRACE command for debugging, however.