Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Notice
The information contained in this document is subject to change without notice.
UNLESS EXPRESSLY SET FORTH IN A WRITTEN AGREEMENT SIGNED BY AN AUTHORIZED REPRESENTATIVE OF STRATUS
COMPUTER, INC., STRATUS MAKES NO WARRANTY OR REPRESENTATION OF ANY KIND WITH RESPECT TO THE
INFORMATION CONTAINED HEREIN, INCLUDING WARRANTY OF MERCHANTABILITY AND FITNESS FOR A PURPOSE. Stratus
Computer, Inc., assumes no responsibility or obligation of any kind for any errors contained herein or in connection with the furnishing,
performance, or use of this document.
Software described in Stratus documents a) is the property of Stratus Computer, Inc., or the third party, b) is furnished only under license, and
c) may be copied or used only as expressly permitted under the terms of the license.
This document is protected by copyright. All rights are reserved. No part of this document may be copied, reproduced, or translated, either
mechanically or electronically, without the prior written consent of Stratus Computer, Inc.
Stratus, Continuous Processing, StrataNET, FTX, and the Stratus logo are registered trademarks of Stratus Computer, Inc.
Continuum, XA, XA/R, StrataLINK, RSN, SINAP, and the SQL/2000 logo are trademarks of Stratus Computer, Inc.
IBM is a registered trademark of International Business Machines Corporation.
MC68000 is a registered trademark of Motorola, Incorporated.
i860 is a trademark of Intel Corporation.
PA-RISC is a tradmark of Hewlett-Packard, Incorporated.
ORACLE7 is a trademark of Oracle Corporation.
Preface
The Purpose of This Manual
The manual Migrating VOS Applications to Continuum Systems (R407) documents how to
migrate applications from XA2000-series modules or XA/R-series modules to
Continuum-series modules.
Audience
This manual is intended for application programmers and system administrators who are
migrating applications to Continuum systems.
Before using the manual Migrating VOS Applications to Continuum Systems (R407), you
should be familiar with the VOS Commands Reference Manual (R098) and the VOS
Subroutines manuals.
Revision Information
This is the first edition of this manual. For information on which release of the software this
manual documents, see the Notice page.
Manual Organization
This manual consists of 11 chapters and 2 appendixes.
Chapter 1 summarizes the Continuum features affecting migration.
Chapter 2 is a step-by-step guide to the migration process, from initial planning through
implementation, including some separate procedures for migrating applications from 68K
systems and i860 systems.
Chapter 3 discusses data alignment, including how to specify data alignment for an entire
source module and for individual data elements, and how to handle various data alignment
issues you are likely to encounter while migrating applications to Continuum systems.
Chapter 4 explains how to correct programs that may have worked on earlier Stratus hardware
platforms despite non-standard programming practices but may produce errors on
Continuum-series modules due to the larger number of registers.
Chapter 5 explains a number of coding practices that jeopardize the portability of programs
and describes how to correct the code.
iii
Preface
Chapter 6 describes how to improve memory access by specifying the memory pool to which
a process is assigned.
Chapter 7 explains how to use the high-performance cache on a Continuum-series module
efficiently.
Chapter 8 explains how to upgrade to the machine-independent locking mechanism available
with VOS Release 13 and later releases.
Chapter 9 explains how to set virtual memory limits for a process or command, and how to
set module default command limits.
Chapter 10 gives instructions on upgrading to the microjiffy Time-of-Day clock.
Chapter 11provides information on troubleshooting paging space problems, performance
problems, and problems related to process or command virtual memory limits.
Appendix A describes how to migrate Forms Management System (FMS) applications to
Continuum systems.
Appendix B discusses several commands and VOS System Analysis subsystem requests for
finding and diagnosing runtime alignment faults.
Notation Conventions
This manual uses the following notation conventions.
Monospace represents text that would appear on your display screen (such as
commands, subroutines, code fragments, and names of files and directories).
For example:
In VOS COBOL, you can specify the longmap or shortmap attribute for a
record with the using longmap or using shortmap clause.
Monospace italic represents terms that are to be replaced by literal values. In the
following example, the user must replace the monospace-italic term number with a
literal value.
If you use the update_disk_label command to increase paging space, give
the command with the -pagepart_size number argument.
Monospace bold represents user input in examples and figures that contain both user
input and system output (which appears in monospace). For example:
as: where 8208
00008208 at customer_accounts+208, line 48
iv
Preface
Preface
V101
V102
V103
ASCII
V103
EPC
IBM or IBMCompatible PC
CANCEL
<F17>
<F20>
<F18>
CYCLE
<F16>
<F19>
<F17>
<F12>
<Alt>-<C>
<SHIFT>-<F16>
<F16>
<Shift>-<F17>
<Shift>-<F12>
<Alt>-<B>
<F18>
<F21>
<F19>
HELP
<SHIFT>-<F8>
<SHIFT>-<F8>
<Shift>-<F8>
<Shift>-<F2>
<Shift>-<F2>
INSERT DEFAULT
<SHIFT>-<F11>
<SHIFT>-<F11>
<Shift>-<F11>
<Shift>-<F10>
<Shift>-<F10>
<F11>
<F11>
<F11>
<F10>
<F10>
INTERRUPT
<CTRL>-<F0>
<SHIFT>-<F22>
<Shift>-<F20>
<Shift>-<Delete>
<Alt>-<I>
NO PAUSE
<SHIFT>-<F17>
<F17>
<Shift>-<F18>
<Shift>-*
<Alt>-<P>
VOS Function
CYCLE BACK
DISPLAY FORM
INSERT SAVED
Keypad character
Preface
Related Manuals
Refer to the following Stratus manuals for related documentation.
Online Documentation
You can find additional information by viewing the systems online documentation in
>system>doc. The online documentation contains the latest information available,
including updates and corrections to Stratus manuals and a master glossary of terms.
Ordering Manuals
You can order manuals in the following ways.
If your system is connected to the Remote Service Network (RSN), issue the
maint_request command at the system prompt. Complete the on-screen form with
vi
Preface
Preface
Reference Manual (R098). There are two ways you can use this command to send your
comments.
If your comments are brief, type comment_on_manual, press <Enter> or <Return>, and
complete the data-entry form that appears on your screen. When you have completed
the form, press <Enter>.
If your comments are lengthy, save them in a file before you issue the command. Type
comment_on_manual followed by -form, then press <Enter> or <Return>. Enter this
manuals part number, R407, then enter the name of your comments file in the
-comments_path field. Press the key that performs the CYCLE function to change the
value of -use_form to no and then press <Enter>.
Note: If comment_on_manual does not accept the part number of this manual (which
may occur if the manual is not yet registered in the manual_info.table file), you
can use the mail request of the maint_request command to send your comments.
Your comments (along with your name) are sent to Stratus over the RSN.
Stratus welcomes any corrections and suggestions for improving this manual.
vii
Preface
viii
Preface
Contents
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
1-1
1-1
1-2
1-3
1-3
1-3
1-4
1-4
1-5
1-5
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
2-1
2-1
2-1
2-1
2-2
2-3
2-3
2-4
2-4
2-5
2-5
2-6
2-6
2-7
2-9
.
.
.
.
.
.
.
.
.
.
3-1
3-2
3-2
3-4
3-4
3-5
3-5
3-6
3-6
3-8
ix
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Contents
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
3-8
3-8
3-9
3-9
3-9
3-10
3-10
3-11
3-11
3-11
3-12
3-12
3-13
3-14
3-15
3-16
3-16
3-17
3-18
3-18
3-19
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
4-1
4-1
4-2
4-2
4-3
4-4
4-5
4-6
4-7
4-7
4-8
4-8
4-8
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
5-1
5-1
5-2
5-2
5-2
5-3
5-3
5-4
Contents
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Contents
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
6-1
6-1
6-2
6-2
6-3
6-3
6-4
6-4
6-4
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
7-1
7-1
7-2
7-3
7-4
7-5
7-5
7-5
7-6
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
9-1
9-1
9-3
9-5
9-5
10-1
10-1
10-1
11. Troubleshooting . . . . . . . . . . . . . . . . . . . . . .
Diagnosing and Correcting Paging Space Problems . . . . . . . .
Avoiding Inefficient Cache Usage . . . . . . . . . . . . . . .
Checking for Alignment Faults Causing Uneven Performance . . . .
Correcting Problems Related to Process and Program Limits . . . .
Setting Limits Too High . . . . . . . . . . . . . . . .
Setting Limits Too Low . . . . . . . . . . . . . . . .
Setting Inconsistent Limits . . . . . . . . . . . . . . .
Running Programs on Modules with Insufficient Default Limits.
11-1
11-1
11-3
11-3
11-4
11-4
11-4
11-5
11-5
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
xi
Contents
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
A-1
A-1
A-1
A-2
A-3
A-4
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
. B-1
. B-2
. B-3
. B-4
. B-5
. B-6
. B-7
. B-7
. B-8
. B-9
. B-10
. B-11
Index. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Index-1
xii
Contents
Figures
Figure 9-1. Program Address Space on Continuum-Series Modules . . . . . . . . . . . . .
9-2
xiii
Tables
Table 7-1. Cache Sizes on Continuum-Series Models . . . . . . . . . . . . . . . . . . .
Table 8-1. Additional Access Modes for Connecting a Processs Virtual Memory to a File . . . .
xiv
Tables
7-2
8-2
Chapter 1:
Continuum Features Affecting Application Migration
1-
This chapter describes the features of a Continuum-series module and its PA-RISC
processor that affect what users or system administrators must do to migrate applications to
the Continuum platform. The following features affect application migration.
data alignment rules that, for optimal performance, require a data item to be aligned on
a boundary congruent to its size
a larger number of registers than other processors used by previously released Stratus
modules
the absence of extended precision registers, causing the results of some complex
floating point calculations to differ in the low-order bits from identical calculations on
a processor in the MC68000 processor family
memory residing on each CPU/memory board rather than on separate memory boards,
and an interface that allows you to specify which memory a process uses
an interface that lets you restrict the virtual memory allowed for a program or process
a Time-of-Day Clock that provides greater accuracy than previous Stratus clocks
1-1
Number of Registers
performs the access at a much greater performance penalty than if the compiler had
performed it.
If the application was written, compiled, and bound for one of the MC68000 family of
processors (one of the XA2000-series models), check for and correct alignment problems, as
described in Chapter 3, Addressing Alignment Issues.
If the application you are migrating was written, compiled, and bound for an i860 processor,
it should already have correct data alignment for recompilation, with longmap alignment
rules, so you should not need to address alignment issues.
If the application you are migrating was originally an MC68000-based application that was
subsequently migrated to the i860 platform, recompile it with longmap alignment rules if it
was recompiled with longmap for the i860 migration. However, you may have recompiled the
application for the i860 platform using shortmap alignment rules and then corrected only
those misalignments that seriously impacted performance. In this case, you can migrate the
application to the Continuum platform in either of the following ways:
Recompile the application again, using shortmap alignment rules and addressing
misalignments that significantly degrade performance.
Recompile the application using longmap alignment rules, fully addressing alignment
issues necessary to use longmap and therefore taking full advantage of the performance
gains that using longmap entails.
See Chapter 2, Migrating Applications: a Step-by-Step Summary, for information on
choosing an alignment strategy and Chapter 3, Addressing Alignment Issues, for more
information on data alignment issues.
Number of Registers
Since the PA-RISC processor has many more registers than any processor in the MC68000
processor family, the compilers can keep the values of more variables in registers than they
could on the MC68000 processors. Keeping variables in registers reduces accesses to main
memory when a program needs to reference a variable. Fewer accesses to memory means a
performance gain.
Some improperly coded applications that worked without error on processors in the
MC68000 family may not work on the PA-RISC processor because the values of more
variables are kept in registers. In some cases, an application fails because it accesses a
variable in a register, but the variables value has been changed in memory by another process
or device. In other cases, when you use VOS PL/I based storage inappropriately, an
application fails because it uses a value in memory, but a new value in a register has not been
flushed to that memory address.
Furthermore, because of the large number of registers, when a program calls a subroutine,
parameters are generally passed in registers rather than on the stack. Therefore, any routine
that directly accesses the stack or has knowledge of stack frame data layouts must be
modified.
1-2
See Chapter 4, Correcting Programs to Work with a Large Register Set, for information on
how to check for and modify your applications to avoid problems resulting from the PA-RISC
processors large register set.
1-3
to add paging files without a module reboot, or by using the -pagepart_size argument of
update_disk_label command to increase the paging partition size of a non-boot disk at
the next module reboot.
Arguments added to the bind command enable you to specify such limits on a
per-program basis.
limits for all processes and commands that run on the module.
1-4
Time-of-Day Clock
See Chapter 9, Restricting the Memory Used by Programs or Processes, for more
information on these commands and subroutines. For full command descriptions, see the VOS
Commands Reference Manual (R098) for the general user commands and VOS System
Administration: Administering and Customizing a System (R281) for the system
administration commands. For full subroutine descriptions, see the VOS Subroutines
manuals.
Time-of-Day Clock
Continuum-series modules have a Time-of-Day clock that is more precise than clocks on all
previous Stratus modules except the XA/R Model 300. While previous clocks measured time
to the precision of a jiffy, which is 1/65,536 of a second, the Continuum-series and XA/R
Model 300 clocks measure time to the precision of a microjiffy, which is 1/65,536 of a jiffy.
Two subroutines, s$read_clock and s$clock_date_time, provide the user interface to
the Time-of-Day clock. See Chapter 10, Upgrading to the Microjiffy Time-of-Day Clock,
for more information on these subroutines, and see the VOS Subroutines manuals for full
subroutine descriptions. You can use these subroutines on any Stratus platform, but the
precision of the date/time values they return will depend on the precision of the platforms
clock.
ORACLE7 Support
Continuum-series modules support ORACLE7 databases, but no earlier releases of
ORACLE. For information on migrating ORACLE Release 6 database files to
Continuum-series modules, see Migrating ORACLE Databases to Continuum-Series
Modules in Chapter 2.
1-5
ORACLE7 Support
1-6
Chapter 2:
Migrating Applications: a Step-by-Step Summary
2-
This chapter provides a step-by-step description of the tasks you perform to migrate
applications to the PA-RISC architecture. It refers you to other chapters in this manual and to
other manuals for detailed information on particular tasks.
Read through the entire chapter for an overview of the migration procedure. Then follow the
steps, referring to the cross-referenced information as needed.
2-1
To display information about current paging space on one or more modules, use the
display_paging_usage command. The display_paging_usage command reports
paging space in blocks (units of physical disk space 4096 bytes in size). The number of
physical blocks of paging space is equivalent to the number of pages (units of virtual memory,
also 4096 bytes in size). The output is similar to the following.
Paging usage for module %s1#m2: 16174 blocks out of 110000 (14%)
The output shows total paging space, paging space currently in use, and the percentage of
usage for each specified module. Paging space usage is shown for the paging partitions and
also for any dynamic paging files that were allocated with the add_paging_file command.
Note: The display_disk_info command with the -long argument displays a list
of the disks on the current module and the size of their partitions, including their paging
partitions. However, this command does not provide information on paging space
available in dynamic paging files allocated with the add_paging_file command.
See Chapter 11, Troubleshooting, for information on how to use either
add_paging_file to add dynamic paging files without a reboot or update_disk_label
to increase the paging partition size on a disk at the next reboot. For complete command
descriptions of these two commands, see the manual VOS System Administration: Disk and
Tape Administration (R284).
Checking the Default Mapping Rules Value
For VOS Release 13 and later releases, the default mapping rules (alignment rules) for
compiling programs is set to shortmap data alignment, unless your system administrator
has changed that default. If your site has previously upgraded its applications to use
longmap data alignment when migrating from the MC68000 to the i860 platform, your
system administrator may find it useful to change the default mapping rules.
Caution: Recompiling a working program with the default mapping rules set to a
value you did not intend can require a significant amount of work to correct your
error.
Default mapping rules determine the data alignment of a program if you do not specify
longmap or shortmap alignment rules, as described in Chapter 3, Addressing Alignment
Issues, or if you use the default or default/check value for the -mapping_rules
argument of one of the compiler commands.
If you are not sure whether the system administrator has reset the default mapping rules, type
the following command and press <Return>.
display_error m$default_mapping
The command returns a message code and a one-word message indicating whether the default
mapping rules are shortmap or longmap. For example:
Code 4991. shortmap
2-2
268,435,456 bytes (256 MB) for total virtual memory used by a process, 134,217,728
bytes (128 MB) for a processs total heap space, and 134,217,728 bytes (128 MB) for
a processs total stack space
67,108,864 bytes (56 MB) for the initial total virtual memory limits for a command (a
program module), 67,108,864 bytes (56 MB) for the heap and 8,388,608 bytes (8 MB)
for the stack. You can use subroutine calls within a program to reset these limits up to
the maximum for your process.
As you plan to recompile applications for the PA-RISC platform, you may want to check to
be sure a system administrator has not reset the default command limits for the module. To
check these limits, use the list_default_cmd_limits command.
If you find the current default command limits for the module too restrictive, and you are a
system administrator, you can change these limits with the command
update_default_cmd_limits. To avoid possible problems when running the same
programs on different modules, see Running Programs on Modules with Insufficient
Default Limits in Chapter 11.
For more information on default command limits, see Chapter 9, Restricting the Memory
Used by Programs or Processes.
You can manage process command limits with VOS commands and subroutines. You can use
VOS commands to display and set process maximum command limits and process initial
command limits from command level or from within a command macro. You can use VOS
subroutines to set and get the calling programs maximum and current command limits while
a program runs. See Chapter 9 for information on these commands and subroutines. For
information on avoiding problems caused by the stack size restricting the dynamic allocation
of heap space, see Setting Inconsistent Limits in Chapter 11.
2-3
However, you can make an application compiled with shortmap data alignment work
effectively on a PA-RISC processor. Using shortmap data alignment, you will not benefit
fully from the performance advantage of the PA-RISC processor. But after you diagnose and
fix the major instances of misaligned data affecting performance, in most cases, the
performance penalty for choosing shortmap alignment will not be noticeable.
Choosing between Longmap and Shortmap for Migrating MC68000 Applications
Use the following guidelines to choose a data alignment strategy for migrating
MC68000-based applications to the PA-RISC processor.
If you developed your application on a processor in the MC68000 processor family and used
it only on that platform, it is currently shortmap aligned. In this case, do the following:
For an understanding of the tasks you must perform to convert the application to
longmap alignment, read all of Chapter 3, Addressing Alignment Issues, and
Appendix B, Finding and Correcting Runtime Alignment Faults. Appendix B
provides a summary of the options and tools available for tracking and correcting
alignment faults that may noticeably slow the performance of your application.
For an understanding of the tasks you must perform if you compile the application
using shortmap alignment rules, read Understanding Shortmap and Longmap Data
Alignment and Specifying Data Alignment in Chapter 3. Alignment faults are
uncommon in shortmap-aligned applications. If, however, you plan to use compiler
directives to specify certain data elements as longmap, but compile using shortmap
alignment rules, you must understand how mixed data alignment is handled. Read
Handling Mixed Shortmap and Longmap Data in Chapter 3 for information on how
to avoid data misalignment when using shortmap and longmap in the same application.
If you do encounter alignment faults at runtime, refer to Appendix B, Finding and
Correcting Runtime Alignment Faults.
Choose the alignment strategy best suited to your current needs. Remember, your
decision is reversible. Keep copies of your original source modules. If you decide to
compile all your applications using shortmap alignment rules to complete the migration
work quickly, you can later decide to upgrade applications to longmap on a
case-by-case basis over time to further improve performance.
Choosing between Longmap and Shortmap for Migrating i860 Applications
Use the following guidelines to choose a data alignment strategy for migrating i860-based
applications to the PA-RISC processor.
If you originally developed your application on an i860 processor with longmap data
alignment, you should experience very few or no instances of misaligned data when
recompiling for the PA-RISC platform. In this case, definitely choose longmap data
alignment for the migration to PA-RISC.
If you developed your application on one of the MC68000-based processors and subsequently
migrated it to an i860 processor, do the following:
If you selected longmap data alignment for the MC68000 to i860 migration, you should
experience very few or no instances of misaligned data when recompiling for the
PA-RISC platform. In this case, definitely choose longmap data alignment for the
2-4
migration to PA-RISC, since most of your work with regard to data alignment is already
done.
If you selected shortmap data alignment for the MC68000 to i860 migration and
thoroughly tracked and fixed instances of misaligned data at that time, you can either
retain the shortmap alignment or upgrade to longmap for the i860 to PA-RISC
migration. Retaining shortmap alignment should work without causing
alignment-related performance problems, since you fixed most instances of misaligned
data in the previous MC68000 to i860 migration. However, Stratus recommends that
you upgrade to longmap data alignment to take full advantage of the performance gains
of the PA-RISC processor, either at the time of your initial application migration to
PA-RISC, or on an application-by-application basis over time.
General user commands and subroutines for setting process initial virtual memory
limits and process maximum command virtual memory limits are documented in
Chapter 9, Restricting the Memory Used by Programs or Processes. You can set and
manage such limits by using VOS subroutines in your source module, bind command
options when you bind a program, and VOS commands at command level or within
command macros.
2-5
alternatives to using defined storage in VOS PL/I in certain cases, avoiding the frequent
memory accesses required by defined storage
changes in how to use VOS Standard C functions that access variable length argument
lists
instructions on replacing the now obsolete VOS PL/I arglistptr built-in function
Before migrating any MC68000 or i860 application to the PA-RISC platform, read Chapter 5,
Correcting Coding Practices That Jeopardize Portability. Since the problematic coding
practices described in Chapter 5 are not related to data alignment, read the chapter regardless
of whether you plan to use longmap or shortmap alignment rules in migrating your
application. If you already migrated your application from the MC68000 platform to the i860
platform, you probably already encountered and corrected the programming errors and
inefficiencies described in Chapter 5. However, the chapter provides some new information,
not documented in Migrating VOS Applications to the Stratus RISC Architecture (R288), on
alternative coding to correct the practices described. Therefore, the information may be
helpful in further improving the performance of your applications.
2-6
information. Also see the VOS Subroutines manuals for full subroutine descriptions, and the
VOS Commands Reference Manual (R098) for a full description of the start_process
command.
To implement the machine-independent locking mechanism available on the PA-RISC
platform, recode calls to s$connect_vm_region with new access_mode values, and
replace the existing spin lock routines with the new virtual memory locking subroutines. See
Chapter 8, Upgrading to Machine-Independent Locks, for descriptions of the access
modes and brief descriptions of the new subroutines and their purposes.
Note: If you do not explicitly implement the machine-independent locking
mechanisms, your application will invoke a fault handler at every instance of one of the
existing spin lock routines in order to emulate the now obsolete StrataBUS-style
locking mechanism.
For full descriptions of the new virtual memory locking subroutines and the usage changes to
s$connect_vm_region, see the VOS Subroutines manuals.
To manage the program or process limits of your application, use the VOS subroutines
s$set_current_cmd_limit and s$get_current_cmd_limit in your applications
source modules, and the command update_process_cmd_limits in your applications
command macros. You can also manage program and process limits at bind time with options
to the bind command, and you can monitor program and process command limits from VOS
command level with the command list_process_cmd_limits. Chapter 9, Restricting
the Memory Used by Programs or Processes, summarizes these subroutines and commands.
For full descriptions of the subroutines, see the VOS Subroutines manuals, and for full
descriptions of the commands, see the VOS Commands Reference Manual (R098).
In any context where time accuracy to the microjiffy level (1/65,536 of a jiffy or 232.83
picoseconds) would be useful, replace your applications calls to the subroutines
s$int_date_time and s$jiffy_date_time with calls to s$clock_date_time. Also
replace calls to s$read_jiffy_clock with calls to s$read_clock. See Chapter 10,
Upgrading to the Microjiffy Time-of-Day Clock, for information on using these
subroutines to access the Continuum-series Time-of-Day clock that measures time in
microjiffies. For full descriptions of the subroutines, see the VOS Subroutines manuals.
2-7
1. For the compiler command you are using, choose the longmap/check value for the
-mapping_rules argument, and use the -cpu_profile argument (or, for VOS
Standard C, the -qc argument).
2. Where compiler messages indicate that padding has been added to correct misaligned
data, reorganize data structures where possible to place the longest data elements first,
thereby reducing the padding required.
3. Where padding remains necessary, add the padding explicitly in your source module
rather than letting the compiler add the padding. Explicitly added padding makes a
program easier to understand and therefore easier to maintain.
4. Explicitly declare as shortmap any data elements that must remain shortmap, such as
structures that contain elements longer than two bytes and that are passed to operating
system subroutines, user-interface structures of many VOS Communications Software
products, and data structures or records that overlay existing shortmapped database
records.
5. If you want the application to recompile with longmap data alignment for all future
recompilations, insert a longmap compiler directive (or in VOS COBOL, a language
statement) in the source module. Such directives override any value specified with the
-mapping_rules argument.
6. Rebind your application, using the -profile_alignment_faults argument of the
bind command and any arguments (or equivalent binder control file directives) you
choose to control program, stack, heap and fence size.The -size,
-max_program_size, -load_point, -stack_size, -stack_fence_size,
-max_stack_size, and -max_heap_size arguments (or equivalent binder control
file directives) control overall address space and stack and heap growth for your
program module. Controlling stack and heap growth is a safety measure, especially for
processes that contain recursive algorithms that can use much stack or heap space. The
result of such uncontrolled growth can be an application failure or module interruption.
See the description of the bind command in the VOS Commands Reference
Manual (R098) for information on how these arguments or directives interact and when
to use them rather than rely on default values.
7. Run the application. The system generates a program_name.profile file.
8. Use the profile command to generate a file named program_name.plist.
9. Check the ALIGN FLTS column in the .plist file for the number of alignment faults
per second. If the .plist file indicates more than one hundred alignment faults per
second, look for major problem areas and fix their alignment. If you have between 10
and 100 alignment faults per second and the program performance is satisfactory, you
may decide to leave the remaining misaligned data, realizing that you are not taking full
advantage of the high performance of the PA-RISC platform. If your alignment faults
are 10 or fewer per second, any further minor performance gain you could achieve is
probably not worth the effort necessary to find and correct the faults. These guidelines
are general and are recommendations only. Your own experience with your application
is your best guide.
2-8
Note: The alignment fault level for an application varies according to which lines
of code are executing. Therefore, factors such as transaction type and even time
of day may affect the number of alignment faults and consequently the
applications performance. If performance is unsatisfactory in particular
circumstances, you may want to use the profile command to generate a new
program_name.plist file so that you can check the alignment fault level
again.
10. See Appendix B, Finding and Correcting Runtime Alignment Faults, for
information on tools to track, diagnose, and correct runtime alignment faults. These
include analyze_system requests that locate alignment faults and display alignment
fault information and the command set_alignment_fault_mode that stops your
programs execution, for debugging purposes, at each runtime alignment fault.
11. Correct alignment faults until you succeed in reducing the number to an acceptable
level that does not noticeably degrade application performance. You may want to
recompile, rebind, and run the application again, as described earlier in this list, so that
you can recheck the number of alignment faults per second to help you decide when
you have corrected enough of the runtime alignment faults.
If you are recompiling an application with shortmap alignment rules, perform the following
tasks:
1. Compile your code with shortmap alignment rules, using the -cpu_profile
argument for the compiler command or, for VOS Standard C, the -qc argument.
2. Bind your application using the -profile_alignment_faults argument of the
bind command and any arguments you select to control program, stake, heap, and
fence size. (See step 6 in the preceding list for information on the arguments for
controlling program, stack, heap, and fence size.)
3. Run the application. The system generates a file named program_name.profile.
4. Use the profile command to generate a file named program_name.plist.
5. Check the ALIGN FLTS column in the .plist file for the number of alignment faults
per second. It is unlikely that a shortmap-aligned program will have a large number of
alignment faults. However, if the .plist file indicates 10 or more alignment faults per
second, follow the recommendations in step 9 in the preceding list for longmap data
alignment. If you decide to find and correct the faults, perform steps 10 and 11 from the
preceding list.
2-9
1. Run the ORACLE Export Utility (EXP) on the XA2000-series or XA/R-series module
on which the ORACLE Release 6 database files reside.
2. Run the ORACLE Import Utility (IMP) on your Continuum-series module to
repopulate the database files for your ORACLE7 database.
Do not attempt to move an ORACLE database from an XA2000-series or XA/R-series
module to a Continuum-series module except by using the EXP and IMP utilities. Attempting
to move the files directly from one module to another, rather than by means of the dump file
created by the EXP utility, will fail unless the full path names of the database files and the
module name itself on both modules are identical.
For information on using the IMP and EXP utilities, see the Oracle Corporation manual,
ORACLE7 Server Utilities Users Guide (R3602-70-1292), and the Stratus manual,
ORACLE7 Administration and Tools Guide (R401).
2-10
Chapter 3:
Addressing Alignment Issues
3-
This chapter briefly explains shortmap and longmap data alignment, discusses how to specify
data alignment for entire source modules and for individual data elements, and addresses
important alignment issues.
Use the information in this chapter in any of the following circumstances:
You are revising an application and need a summary of data alignment issues for the
new coding.
The following data alignment issues are addressed in the chapter.
ensuring correct alignment of based variables when using pointers in VOS PL/I.
ensuring correct alignment when using untyped storage sharing
ensuring correct alignment of aligned string data
rearranging structure elements to minimize alignment padding when converting to
longmap alignment
ensuring correct alignment when simulating, in VOS Standard C or VOS Pascal, the
VOS PL/I dec 15 or dec 18 data types for passing arguments to certain subroutines
3-1
longmap. Data items are aligned on boundaries congruent to their size. Two-byte items
are aligned on mod2 boundaries (that is, addresses divisible by 2), four-byte items on
mod4 boundaries (addresses divisible by 4), and so forth, up to mod8.
shortmap. The compilers generally align data elements two bytes or longer on two-byte
boundaries. Shortmap alignment is the default for the compilers for compatibility with
existing programs, although your system administrator can change this setting, as
described in the manual VOS System Administration: Administering and Customizing
a System (R281).
The structure itself is aligned on a mod8 boundary because longmapped structures must begin
on a boundary congruent to the size of the largest element (up to mod8). The size of the entire
structure is 20 bytes, and 6 bytes of padding are introduced between
longmapped_struct.model and longmapped_struct.value.
3-2
Alignment
Offset
Size
model
mod2
0 bytes
2 bytes
value
mod8
8 bytes
8 bytes
size
mod4
16 bytes
4 bytes
Example
The following example shows the same VOS PL/I structure shown in the first example, but
with the alignment declared as shortmap.
declare 1 shortmapped_struct shortmap,
2 model fixed bin (15),
2 value float dec (8),
2 size fixed bin (31);
The structure itself is aligned on a mod2 boundary. The size of the entire structure is 14 bytes.
The members are stored as follows:
Variable
Alignment
Offset
Size
model
mod2
0 bytes
2 bytes
value
mod2
2 bytes
8 bytes
size
mod2
10 bytes
4 bytes
Example
The following example shows the same VOS PL/I longmap structure shown in the first
example, but with the structure members rearranged to eliminate the padding.
declare 1 longmapped_struct longmap,
2 value float dec (8),
2 size fixed bin (31),
2 model fixed bin (15);
The structure itself is aligned on a mod8 boundary. The size of the entire structure is 14 bytes,
and no padding is introduced.
3-3
Alignment
Offset
Size
value
mod8
0 bytes
8 bytes
size
mod4
8 bytes
4 bytes
model
mod2
12 bytes
2 bytes
The offsets of the individual elements would be the same as shown for the VOS PL/I example
in the preceding section. However, there would be an additional 4-byte pad at the end of the
structure.
For more information on data elements, their sizes, and alignment issues, see the users guide
for the VOS programming language you are using.
Use the -mapping_rules compiler argument to specify the alignment for an entire
source module.
Use compiler directives (or, in VOS COBOL, language statements) to specify the
alignment for an entire source module. A compiler directive or language statement
overrides the -mapping_rules argument.
Use the longmap and shortmap attributes (or, in VOS Standard C, $longmap and
$shortmap) to specify in the source module the alignment for individual data
elements. Using these attributes to specify alignment for individual elements overrides,
for those elements, any alignment specified for the entire source module.
3-4
The command displays a message code number followed by the default setting on the current
module. For example, if the settings of default and default/check are the same as
shortmap and shortmap/check, the command has the following output.
4991. shortmap
For VOS Standard C, VOS COBOL, VOS Pascal, VOS PL/I, or VOS FORTRAN, if you
specify one of the alignment/check values, the compiler issues messages when it inserts
padding in an aggregate to satisfy alignment requirements. For example, if you compile a
VOS Standard C program containing the structure shown in Language-Specific Alignment
Differences earlier in this chapter, and you specify -mapping_rules longmap/check,
the compiler issues the following messages:
2096 8: A gap of 6 bytes has been found between "value" and the
previous member within "struct(longmapped_struct)"
structure.
2010 8: Extra "4" bytes have been allocated for
struct(longmapped_struct) due to alignment requirements.
Note that if you specify a compiler directive (or, in VOS COBOL, the object-computer
paragraph), only the specified alignment attribute is overridden, not the checking for
alignment padding. See the next section, Using Compiler Directives, for more information.
3-5
VOS PL/I and VOS Standard C each have a compiler directive that causes the compiler to
warn you about every structure that has not been explicitly declared as shortmap or longmap.
In VOS PL/I, the compiler directive is %options no_default_mapping, and in VOS
Standard C, the compiler directive is #pragma no_default_mapping. You can use this
directive to make sure you have examined all structures in a program.
In the declaration of a function type, the alignment attribute applies to the functions
return type and not to the function itself.
3-6
The following examples illustrate correct and incorrect usage of the $longmap attribute in
the declaration of a union tag and union object.
union $longmap u_type1
{
.
.
.
} union1;
union u_type1 union2; /* union2 inherits longmap alignment from tag */
union $shortmap u_type1 union3; /* INVALID: alignment associated */
/* with a tag cannot be changed */
Once the u_type1 tag is declared, all subsequent union declarations that use the u_type1
tag are aligned according to longmap rules. Thus, union3 cannot be redefined as shortmap.
To indicate the alignment rules for a function return type or an object other than a structure,
union, or enumeration, specify the $shortmap or $longmap attribute anywhere before the
declarator.
With a pointer type, an alignment specifier can be within the declarator. When you use an
alignment specifier with a pointer type, the syntax and semantics are similar to those used for
type qualifiers. The following examples illustrate how to use the $shortmap specifier in the
declaration of a pointer type.
int $shortmap *i_ptr;
int * $shortmap i_ptr1;
/*
/*
Example 1
Example 2
*/
*/
In Example 1, i_ptr is declared to be a pointer to an int. The int, not the pointer, is aligned
using the shortmap alignment rules. In Example 2, i_ptr1 is also declared to be a pointer to
an int. However, in this case, the pointer, not the int, is aligned using the shortmap
alignment rules.
You cannot specify the $shortmap or $longmap attribute in a typedef unless it is a type
definition for a structure, union, or enumeration type, and the contents of struct, union, or
enum are defined within the type definition. For example, the following is invalid:
typedef SM_LONG_INT $shortmap long int; /* INVALID */
If you specify an alignment attribute for a bit field or a function that returns void, the
compiler ignores the attribute.
For more information and examples on specifying data alignment in VOS Standard C, see the
VOS Standard C Reference Manual (R363).
3-7
record1
02
x
02
y
02
z
using
usage
usage
usage
longmap.
is comp-4.
is comp-2.
is comp-5.
For more information and examples on specifying data alignment in VOS COBOL, see the
VOS COBOL Language Manual (R010).
VOS Pascal Usage
In VOS Pascal, you can specify the longmap or shortmap attributes for any array, record,
set, or file.
For example, the following shows a record declared with the longmap attribute.
type a_record_type = longmap record
fieldone: integer;
fieldtwo: real;
end;
For more information and examples on specifying data alignment in VOS Pascal, see the VOS
Pascal Language Manual (R014).
VOS PL/I Usage
To specify the alignment for a particular data item in VOS PL/I, you can use the longmap or
shortmap attribute. If either attribute is specified for a structure, then all members for which
neither attribute is specified inherit that attribute. The following example illustrates a simple
use of the longmap attribute.
declare 1 struct longmap,
2 model fixed bin (15),
2 value float dec (8),
2 size fixed bin (31);
The structure itself is aligned on a mod8 boundary. The size of the entire structure is 20 bytes,
and 6 bytes of padding are introduced between struct.model and struct.value.
For more information and examples on specifying data alignment in VOS PL/I, see the VOS
PL/I Language Manual (R009)
3-8
/ struct(longmap) /
model,
value,
size
The operating system subroutines must remain compatible with existing applications,
and thus must accept shortmapped structures.
structures that contain elements longer than two bytes and are passed to operating
system subroutines
structures or records that are already defined as shortmap externally to the program,
such as structures that overlay existing shortmap-aligned database records
3-9
With VOS Standard C, VOS COBOL, VOS Pascal, VOS PL/I, or VOS FORTRAN, one way
to determine whether a structure needs to be shortmapped is to compile the program with the
value longmap/check for the -mapping_rules argument. When you specify
longmap/check, the compiler warns you when it adds padding to any structures. If the
structures for which warnings are issued are being passed to system subroutines, declare the
structures to follow shortmap alignment rules.
Optionally, you can specify the shortmap attribute for all system subroutine structures. For
system subroutine structures for which padding would not be added under longmap alignment
rules, adding the shortmap attribute has no effect.
In VOS Release 11.0 and later releases, the VOS Subroutines manuals show which subroutine
structures must remain shortmapped, and the include files in >system>include_library
have been updated to use shortmap alignment where required.
The requirement for shortmap alignment applies only to subroutine structure arguments.
The operating system subroutines take several types of scalar argument, and these can be
longmap- or shortmap-aligned, depending on the alignment rules you are using to compile
your program. Chapter 1 of each of the VOS Subroutines manuals provides tables listing the
scalar data types that occur as system subroutine arguments and showing the alignment and
amount of storage space the compiler allocates for longmap and for shortmap alignment of
each of those data types.
,
char(22),
fixed bin(31);
Each disk record is 26 bytes long: 22 bytes for the name and 4 bytes for the ID number.
However, if you compile the program with longmap alignment rules, the compiler inserts a
2-byte pad before the idnum field to align it on a mod4 boundary. You can no longer read and
write this structure by overlaying it with a char(26) buffer because the structure no longer
corresponds to the record format on disk. Therefore, you must specify shortmap for this
structure.
using the include files supplied by Stratus ensures that your application always has the latest
updates to structures.
3-11
You can define another structure that includes an element of type struct struct_1:
struct $shortmap struct_2
{
unsigned short one;
unsigned long two;
struct struct_1 three;
};
The containing structure is defined as $shortmap, so no error or padding occurs for element
two, a 32-bit variable defined on a mod2 boundary. However, the compiler inserts two bytes
of padding before element three because struct_1 is defined as a longmap structure. A
longmap structure must start on a mod4 boundary, since a structure is aligned on the boundary
determined by the member with the most stringent boundary requirement, in this case a long
int. A structure defined as longmap always is aligned as longmap, even if used in a structure
defined as shortmap, and the longmapped structure remains longmap-aligned internally. In
this example, element b is located on a mod4 boundary, with two bytes of padding before it.
Example
If you define a structure to follow shortmap alignment rules and then include it as part of a
structure defined as longmap, the shortmapped structure remains shortmap-aligned.
struct $shortmap struct_1
{
unsigned short a;
unsigned long b;
unsigned short c;
};
struct $longmap struct_2
{
unsigned short one;
unsigned long two;
struct struct_1 three;
};
In this example, element three remains shortmapped. Element b, for example, remains at an
offset of two from the beginning of the struct_1 structure. The structure three itself is
located at a mod2 offset, since the alignment requirement of a structure is determined by the
maximum alignment of any element, in this case mod2 because the structure is shortmapped.
Internally, element three remains shortmapped, and no padding is inserted before three.b,
which remains mod2- aligned.
VOS PL/I Usage
In VOS PL/I, by using the like or the type attribute, you can explicitly mix structure
elements with different data alignment or have the alignment of one data structure or element
inherit the alignment of another. The following rules and restrictions apply.
Using the like Attribute
You can define a structure template and then define other data elements (including
substructures) based on that template using the like attribute. If you define a template and
3-12
include an alignment attribute as part of that template, the specified alignment is maintained
unless you explicitly override it for the element declared using like. This behavior is
non-standard for PL/I.
The following example illustrates how alignment attributes work with like.
%options longmap;
declare 1 struct1 shortmap based,
2
a
fixed bin(15),
2
b
fixed bin(31);
declare 1 struct2,
2
one
fixed bin(15),
2
two
like struct1; /* two remains shortmapped */
declare 1 struct3 longmap,
2
one
fixed bin(15),
2
two
like struct1; /* two remains shortmapped */
declare 1 struct4,
2
one
fixed bin(15),
2
two
like struct1 longmap; /* two becomes longmap */
The substructure two remains shortmapped in both struct2 and struct3 because
the alignment for that substructure is not explicitly overridden.
The longmap specification of struct3 does not override the internal alignment in the
substructure two, which remains shortmapped.
For struct4, the alignment for the substructure two is explicitly declared as
longmap, so the compiler adds two bytes of padding before substructure two and adds
two bytes of padding after element a within substructure two.
In mixing shortmap and longmap data alignment in VOS PL/I, also be aware that the size as
well as the alignment of structure members may change when you change the alignment
specification of the member you declare using like. For example, the size of bit(16)
aligned data is 2 bytes when declared as shortmap, but 4 bytes when declared as longmap.
For more information, see the tables showing alignment and size for VOS PL/I data types
with longmap and with shortmap alignment in the chapter Data Types in the VOS PL/I
Language Manual (R009).
Using the type Attribute
VOS PL/I also provides a type attribute that enables you to declare a user-defined data type
by referencing the type of another structure or member. A structure or member declared with
the type attribute inherits the size and most of the attributes of the referenced structure or
member, including the shortmap or longmap attribute. Only the internal, external,
builtin, automatic, static, based, and defined attributes are not inherited. In the
3-13
following example, struct2 inherits the shortmap alignment of test_struct, even if you
compile the source module using longmap alignment rules.
declare 1 test_struct shortmap based,
2 a
fixed bin(15),
2 b
char(30);
declare struct2
type (test_struct);
If you declare a typed structure or member with an alignment attribute different from the
referenced variable, the alignment attribute declared for the typed structure or member
overrides the one declared for the referenced structure or member, and the compiler issues a
warning. In the following example, the longmap attribute specified for the typed structure
struct2 overrides the shortmap attribute of the referenced structure test_struct.
declare 1 test_struct shortmap based,
2 a
fixed bin(15),
2 b
char(30);
declare struct2
type (test_struct) longmap;
The compiler issues the following message, indicating the mismatch and informing you that
it is using the specified longmap attribute for struct2.
ERROR 2664 SEVERITY 2 BEGINNING ON LINE n
The explicitly specified mapping attributes of struct2 and
the type reference symbol do not match.
(Using the newly specified attribute.)
my routine
entry (fixed bin(31));
1 my_struct shortmap,
2a
fixed bin(15),
2b
fixed bin(31);
call my_routine(my_struct.b);
3-14
Because the argument and the corresponding parameter are not compatibly aligned, the
compiler generates the following warning, indicating that the argument is being passed by
value, not by reference.
WARNING 94 SEVERITY 1 BEGINNING ON LINE line_number
"b" has been passed by-value because its
attributes did not match those of the corresponding parameter.
Enclose the argument in parentheses to suppress this warning.
If the parameter is being used strictly as an input parameter, enclose the argument in
parentheses to eliminate the warning message. When enclosed in parentheses, the argument
is treated as an expression, which is always passed by value.
call my_routine((my_struct.b));
If the parameter is to return a value, eliminate the warning message by declaring a temporary
variable and assigning my_struct.b to it before calling my_routine:
declare
temp
fixed bin(31);
temp = my_struct.b;
call my_routine(temp);
my_struct.b = temp;
The program now compiles with no warning messages and no alignment violations.
See the discussion of parameters and arguments in Chapter 3, Procedures and Blocks, in
the VOS PL/I Language Manual (R009) for more information
An argument aligned using longmap rules can be passed to a parameter aligned using
shortmap rules, if both the argument and the parameter are nonstructure data types and
not arrays of aligned strings, or if both the argument and the parameter are structure
data types of the same size and shape.
An argument aligned using shortmap rules can be passed to a parameter that is aligned
using longmap rules without generating a compiler warning if the data type of both the
argument and the parameter is fixed bin(15), bit (an unaligned bit string only),
char (an unaligned character string only), or char varying.
3-15
The following example shows an attempt to pass a structure as a argument when there is an
alignment mismatch.
main: procedure;
declare 1 struct1
shortmap,
2 s_1
fixed bin(15),
2 t_1
fixed bin(31);
.
.
.
call w(struct1);
w: procedure(struct2);
declare 1 struct2
longmap,
2 s_2
fixed bin(15),
2 t_2
fixed bin(31);
.
.
.
end w;
end main;
In the preceding example, struct2 is declared with the longmap attribute and is expected to
be on a mod4 boundary as required by its largest member; of its members, s_2 is expected to
be on a mod2 boundary and t_2 is expected to be on a mod4 boundary, so there are two bytes
of padding between s_2 and t_2. The two structures do not have the same data alignment
and therefore are not compatible, so the compiler issues a warning.
For more information on arguments and parameters, see Chapter 3, Procedures and Blocks,
in the VOS PL/I Language Manual (R009).
You can assign an address of a storage location to a pointer by using the addr built-in
function or the allocate statement.
3-16
However, an alignment mismatch can cause the program to fail. If the declaration of the based
variable uses an alignment specification that does not match the alignment of the storage
address, the program compiles with errors. In the following example, the addr built-in
function returns the address of a variables storage and assigns that address to a pointer.
declare
declare
declare
p
pointer;
x(5) float bin(24) shortmap;
y
float bin(24) based longmap;
.
.
.
p = addr(x(k));
p -> y ...
In the preceding example, the addr built-in function returns the address of x(k) and assigns
it to the pointer p. The second assignment statement uses the locator qualifier symbol to
associate the pointer p with the based variable y. However, because the storage address
returned by addr is shortmap-aligned and the based variable y is longmap-aligned, the
program will not run correctly, although it may compile without error.
3-17
,
bit(8),
char(4);
declare 1 struct2
2 st2_a
defined (st1_b),
fixed bin(31);
st2_a = 5;
if st2_a > 0
then put skip list ('st2_a');
end untyped_ex;
In the preceding program, the storage of st1_b, and hence of st2_a, is aligned on an odd
byte. XA2000-series compilers allow odd boundary addressing, but Continuum-series
modules disallow it in most cases, including this case, in which a misaligned variable is used
in a relational expression. On Continuum-series modules, the reference to st2_a causes an
addressing error, and the error condition is signaled. To avoid this type of error, correct the
declaration of struct_2 so that st2_a is no longer aligned on an odd byte.
See Using Untyped Storage Sharing in Chapter 4 of this manual for information on using
untyped storage sharing and for some constraints on its use. In the VOS PL/I Language
Manual (R009), see Chapter 4, Data Types, and Appendix B, Internal Storage, for the
alignment requirements of each data type, and Chapter 6, Storage Classes, for a discussion
of storage sharing.
3-18
If compiled using longmap alignment, this structure begins on a mod8 boundary and uses 24
bytes. The char data element uses 1 byte, followed by 7 bytes of padding. The double data
element uses 8 bytes, and the long int data element uses 4 bytes. At the end of the structure,
the compiler adds 4 bytes of padding, since in VOS Standard C the structure must also end
on a mod8 boundary. In VOS PL/I, a structure with similarly-sized data elements uses 20
bytes because the padding at the end is not needed.
If compiled using shortmap alignment, the VOS Standard C structure would use 14 bytes:
1 byte for the char data element, 1 byte of padding so that the next data element begins on a
word boundary, 8 bytes for the double data element, and 4 bytes for the long int data
element.
If the VOS Standard C structure is rearranged to place the double element first and the long
int element second, it uses only 16 bytes:
struct $longmap good_order
{
double a_double;
long int an_int;
char a_char;
};
In some cases, you may not be able to rearrange the elements of a structure. In such cases,
explicitly add pad elements:
struct $longmap with_padding
{
char achar;
char pad1[3];
long int longint; /* must start on a mod4 boundary */
};
Also, do not rearrange elements of a structure if the rearrangement destroys the logical
ordering of the structure and saves only several bytes of memory. For example, if a structure
has several logical substructures, moving elements among the substructures could make the
code much harder to maintain. However, within each substructure, you may want to rearrange
elements so that the largest element is first.
If the elements of a structure or union cannot be rearranged, pad the structure or union
explicitly, rather than allowing the compiler to pad it. The resulting code will be the same, but
the contents of structures, unions, and arrays of structures will be obvious for the purpose of
debugging and maintaining the program.
3-19
When you create a structure or record simulating one of these two data types, and the structure
or record is not a member or a containing structure or record declared as shortmap-aligned,
you must do the following to avoid the occurrence of an alignment violation at compilation.
In VOS Standard C, include the structure in a union that contains a data element of the
type double.
In VOS Pascal, include in the record a field of the type real, or use a variant record
with a variant field of the type real.
Unions, structures, and records are aligned according to the data item having the most
stringent alignment requirements. Therefore, the double data element (in VOS Standard C)
or the real field (in VOS Pascal) causes the entire structure or record to be aligned on a mod8
boundary, avoiding an alignment violation.
The following examples show VOS Standard C and VOS Pascal usage.
In this example, the union dec_15_aligned type contains the structure and a double,
forcing the structure to be aligned on a mod8 boundary. Otherwise, an alignment fault may
result.
For more information, see Chapter 1, Using the Operating System Subroutines, in the VOS
C Subroutines Manual (R068).
3-20
decimal_18_type = record
high: integer;
low: integer
end;
aligned_dec_18 = record
seed1: decimal_18_type;
for_alignment_only : real
end;
In this example, the aligned_dec_18 record contains a record (seed1) and a real, forcing
seed (and seed1) to be aligned on a mod8 boundary. Otherwise, an alignment fault may
result.
For more information on this approach to simulating the 18-digit fixed-decimal scalar data
type, see Chapter 1, Using the Operating System Subroutines, in the VOS Pascal
Subroutines Manual (R021).
To use a variant record instead, see the information on variant records in Chapter 3, Data
Types, in the VOS Pascal Language Manual (R014).
3-21
3-22
Chapter 4:
Correcting Programs to Work with a Large Register Set
4-
Continuum-series modules, with their PA-RISC processors, have a much larger set of
registers than XA2000-series modules have. Therefore, when an application runs on a
Continuum-series module, values that would be flushed frequently to memory on a XA2000
module are often kept in registers instead. This chapter explains how to correct coding in
applications that may not run correctly on Continuum-series modules because of the large
register set.
This chapter applies mainly to migrating applications from the MC68000 platform to the
PA-RISC platform, but contains some information relevant to i860 to PA-RISC migration. If
you already migrated your applications from the MC68000 platform of XA2000-series
modules to the i860 platform of XA/R-series modules, you should have already encountered
and corrected the errors described in this chapter. However, this chapter provides some new
information, not documented in Migrating VOS Applications to the Stratus RISC
Architecture (R288), on ways to correct the coding practices described, including some
changes required for VOS Release 13.0 and later releases.
4-1
the value, that other program access a value in memory that is no longer correct.
For shared data to be accessed consistently by simultaneously running programs, you must
ensure two things:
that the programs use and modify the current copy of the shared data
that only one program at a time can change the shared data
The following sections explain two separate methods for ensuring that programs do not
access outdated copies of shared data and describe two locking policies for ensuring that only
one program at a time can change shared data. Stratus recommends and supports only these
methods.
4-2
Declaring a variable as volatile ensures that the value in memory and not the value in a
register is always referenced. Use the volatile attribute to instruct the compiler to read a
variable from memory whenever it needs its value, and to store the current value in memory
whenever that value is modified by the program.
Note: The way type qualifiers apply to pointer types changed beginning in VOS
Release 11. Their use now follows the ANSI standard. The position of the qualifier
determines the object that it qualifies. For example, in the two VOS Standard C
declarations that follow, the volatile qualifier modifies the int type specified, not the
pointer.
volatile int *ptr;
int volatile *ptr;
4-3
To use this method, do not declare shared data as volatile, but instead ensure that shared
data is declared only as one of the following storage types:
to shared data. Stratus does not recommend attempting to reference or update shared data
without using one of these two locking policies.
The exclusive-use locking policy allows only one program at a time to reference or modify
shared data in a region of virtual memory. References to shared data are collected into
regions. Each region is preceded by a call to either s$lock_vm_lock or s$try_vm_lock
and followed by a call to s$unlock_vm_lock. By using the subroutine s$lock_vm_lock
or s$try_vm_lock, the calling program acquires a lock, and can proceed to use and modify
the protected shared data. On the first reference to any shared virtual memory variable in the
locked region, the compiler loads the variable from memory. Subsequent references may
again use a copy in a register. When the computation is complete, the program calls
s$unlock_vm_lock, which stores in physical memory any shared virtual memory variables
from the locked region and releases the virtual memory lock. For efficiency, VOS supports
multiple locks, so that each particular class of data can have its own lock.
The multiple-reader/one-writer locking policy allows multiple programs to simultaneously
read shared data, but allows only one program at a time to modify the shared data. VOS does
not provide subroutines to implement this policy. To use this policy on VOS, you must
provide your own locking subroutines.
A third locking policy, implemented by StrataBUS-style locks, is documented in
>system>doc>spin_lock.doc, but is no longer recommended by Stratus. Because this
4-5
code optimization. In addition, the resulting executable program must access physical
memory more frequently when referencing variables.
Compiling a program with the -table argument (consequently at optimization level 1)
should be an interim step, used in debugging your application during the migration process.
The performance of a program compiled with optimization level 1 is not at a level suitable to
be used in a production environment.
Instead, use the -production_table compiler argument to produce executable code that
is suitable for a production environment but also can be debugged using the VOS Symbolic
Debugger. The -production_table argument sets the optimization level to 3 by default,
resulting in code that executes more quickly than code compiled with the -table argument.
However, code optimized at level 3 may not reload registers for every statement, so the set
and continue requests of the debug command may produce unpredictable results.
Additionally, at optimization level 3 on Continuum-series module, many values will remain
in registers rather than be stored in memory, especially for local automatic variables, so the
debugger may give unpredictable output for these values.
See the description of the cc, cobol, pascal, or pl1 command in the VOS Commands
Reference Manual (R098) for more information on the -table and -production_table
arguments. See also the debug command description in that same manual.
the variable is local to the function containing the invocation of the corresponding
setjmp call
variables as volatile not only currently ensures correct operation of an application that
relies on them, but also safeguards the application from future problems if the coding is
revised in a way that changes the value of one or more automatic variables between the
setjmp and longjmp calls.
p pointer;
k fixed bin(31);
i fixed bin(15);
fb31 fixed bin(31) defined p;
bit32 bit(32) aligned defined k;
char2 char(2) defined i;
With these declarations, the compiler requires every reference to p, k, and i to access
memory as if p, k, and i had been declared as volatile. This negates much of the
performance gain of having a large register set on a PA-RISC processor.
In many cases, you can avoid the performance penalty by using alternatives to defined
overlays.
4-7
4-8
Continuum-series modules. See Chapter 13, Built-in Functions, in the VOS PL/I Language
Manual (R009) for more information on the paramptr built-in function.
4-9
4-10
Chapter 5:
Correcting Coding Practices That Jeopardize Portability
5-
This chapter describes some coding practices that may produce working code on the Stratus
MC68000 platform, but which may cause errors when an application is migrated to the
PA-RISC platform.
If you already migrated your applications from the MC68000 platform to the i860 platform,
you should have already encountered and corrected these errors. However, this chapter
provides some new information on alternative coding that may be helpful in further
improving the performance of your applications.
and limitations:
Code compiled with the -table argument runs more slowly than is suitable for a
production environment, and the -table argument creates a symbol table, for use by
the VOS Symbolic Debugger, that greatly increases the size of the object module. The
-table argument also sets the optimization level to 1.
5-1
5-2
You cannot specify extended precision variables or constants on either platform, but the
extended floating-point registers of the MC68000 family of processors allow VOS compilers
to store intermediate values of a calculation in extended floating point precision. Because
such intermediate values are rounded on a PA-RISC processor, the result of a complicated
floating point calculation in a program may differ in the low-order bits, depending on whether
the program is compiled on an XA2000-series module or a Continuum-series module. If the
result of a complicated floating point calculation is then used as input to other calculations,
an insignificant difference in result may be magnified by those subsequent calculations.
If it is important that complicated floating-point calculations yield absolutely identical results
when your application is compiled and run on each of the two platforms (MC68000 and
PA-RISC), you may need to revise your source code. You can ensure the rounding of
intermediate values in calculations by breaking up big expressions into smaller ones and
assigning intermediate values to variables.
If you enable an exception handler for the fault and disable the exception handler soon
after the floating-point calculation that causes the exception, the exception handler may
not catch the fault.
If the default exception handler catches the fault, and you invoke the debug command
to investigate it, the floating-point exception may appear to have occurred later in the
code than where it actually occurred.
It is very difficult to avoid entirely programming practices that cause floating-point
exceptions, so you probably will have to rely on the default exception handler or an exception
handler that you enable. An exception handler you enable can be for the floating-point
exception itself or for the error condition generated by the floating-point exception. To assure
that the exception handler catches and handles the fault when it occurs and does not defer the
signalling of the fault, store all floating-point results before you either exit the procedure with
the handler or you disable the handler. Assigning a floating-point value to an external
variable, based variable, or reference parameter is the best way to accomplish this storing, and
such an assignment cannot be removed by the optimizer.
Alternatively, you can avoid these problems by compiling at an optimization level of 2 or
lower, but applications compiled at optimization levels lower than 3 (the default) generally
do not have the best performance possible.
5-3
release, or even when you run the same application at different times on the same VOS release
as process or task memory usage varies.
If you specify the -check_uninitialized argument when compiling your program at an
optimization level of 3 or higher, the compiler issues a warning for every uninitialized
variable. The -check_uninitialized argument in some cases also issues warnings where
no problem exists, for example, when a program may take multiple paths of execution before
using a variable, and in at least one of those paths the variable has not been set.
Compiling at optimization level 3 or higher without the -check_uninitialized argument
also checks for uninitialized variables, but skips checking variables that are in conditional
code paths. Therefore, when using this default checking for uninitialized variables, you can
be certain that every warning concerning an uninitialized variable is a valid warning, but you
can not be sure that you have found every uninitialized variable.
Certain system subroutines require their arguments to be initialized. For example,
s$write_device requires certain fields in its bcs_write_device_info argument to be
initialized to zero values. The compiler, however, does not detect input-output arguments that
are uninitialized when they are passed to subroutines or functions. You must check to make
sure that you are adhering to all interface requirements documented in the subroutine
descriptions in the VOS Subroutines manuals.
using a VOS FORTRAN CHARACTER function with a return value whose maximum
length is less than or equal to 8 characters
using a VOS FORTRAN STRING function with a return value whose maximum length
is less than or equal to 6 characters
the source code of the other programming language. If the maximum length of a return value
is less than the required length, cited earlier in this section, for interoperability of VOS
FORTRAN with other VOS programming languages, you must do one of the following:
5-5
5-6
Chapter 6:
Improving Memory Access by Specifying Memory Pools
6-
When any process is created, VOS associates it with a particular memory pool by
assigning it to a CPU/memory board. For its duration, the process runs only on CPUs
on that board.
When a user creates a process, if the user specifies no memory pool, VOS assigns the
process to the memory pool with the most free physical memory.
To optimize CPU cache usage, whenever possible VOS assigns a process to run on the
CPU on which it most recently ran.
In each memory pool, VOS keeps a copy of all code being executed on that board.
VOS attempts to allocate all kernel data memory used by or on behalf of a process from
the same memory pool as the process. (All non-kernel data, except data in shared
virtual memory, is always allocated from the same memory pool as the process.)
6-1
Several related applications share the same regions of virtual memory. Assign such
applications to the same memory pool for best performance.
You are creating a server process and a requestor process and want them to run on
different CPUs. Specifying a different memory pool for each of the two processes
created ensures that they will run on separate CPU/memory boards.
You want to balance the CPU load by not having two large applications run on the same
CPU. Specifying a different memory pool for each of the two applications ensures that
they will run on separate CPU/memory boards regardless of which board has the most
available memory at the time they are started.
6-2
CPU/memory boards, you can use the memory_pool element of the new_process_info
structure to specify that the process will be assigned to a memory pool in any one of the
following ways:
6-3
For more information on the subprocess login command and the start_process
command, see the VOS Commands Reference Manual (R098).
declared as shortmap.
The s$get_processes_info subroutine returns information about a set of processes. The
set of processes is defined by a set of users, a set of process names, and a module name. The
processes_info structure passed to the subroutine includes a memory_pool element. On
a Continuum-series module with two logical CPU/memory boards, the value returned in
memory_pool for each process defined indicates the memory pool, 0 or 1, associated with
that process. On a module other than a Continuum-series module, the value returned in
memory_pool is always 0 because there is only one pool. Note that the processes_info
structure must be declared as shortmap.
See the VOS Subroutines manuals for complete descriptions of the subroutines
s$get_process_info and s$get_processes_info.
6-4
Chapter 7:
Efficiently Using Continuum-Series Caches
7-
7-1
Data caches are either 256 KB or 1 MB in size. Therefore, the number of cache lines
per cache is 8192 for a 256 KB cache (256KB/32 bytes) or 32,768 for a 1MB cache
(1MB/32 bytes). See Table 7-1 for the cache size on each Continuum-series model.
1
Number of Slots
Number of
Logical CPUs
CPU Type
Cache Size
per CPU
Model 610S
72MHz PA-7100
256KB
Model 610
72MHz PA-7100
256KB
Model 620
72MHz PA-7100
256KB
Model 1210
12
72MHz PA-7100
256KB
Model 1215
12
96MHz PA-7100
1MB
Model 1225
12
96MHz PA-7100
1MB
Model 1245
12
96MHz PA-7100
1MB
Cache lines start at addresses that are 0 mod 32, and each cache line continues for 32 bytes.
Therefore, the first cache line begins at address 00000000, the second at address 00000020,
the third at address 00000040, and so on.
7-2
The caches are direct map caches, i. e. they are virtually indexed so that the processor
determines which cache line to reference based on virtual addresses. In hexadecimal format
for a 1 MB cache, virtual addresses are mapped to cache lines as follows:
Range of Virtual Addresses
Start Address
End Address
1F
20
3F
40
5F
FFFE0
FFFFF
32,767
100000
10001F
100020
10003F
100040
10005F
.
.
.
.
.
.
1FFFE0
1FFFFF
32,767
200000
20001F
.
.
.
2FFFE0
2FFFFF
32,767
.
.
.
If a program references two virtual addresses that are indexed to the same cache line, the data
in the cache line is written to memory or read from memory, eliminating the performance
advantage of having data cached.
7-3
reloaded into the other cache. Therefore, the access time for modified data, especially data
that is frequently modified, is much greater than for data that is never modified. It takes more
than twice as long to make a shared memory request as it does to make an unshared request.
Heavily used global variables in shared virtual memory that are updated by every transaction
increase the occurrence of cache line loading and therefore reduce efficiency. Global
statistics, accounting, or timing variables can have just as high a performance cost as program
logic variables or data.
You can increase data caching efficiency in the following ways.
Be sure the data is in different cache lines to avoid false sharing (accessing different
virtual memory addresses in a common cache line, causing frequent flushing of the
cache to main memory). See the preceding section, Determining Cache Line
Boundaries, for information on the addresses of cache line boundaries.
Do not lay out large data structures so that their virtual addresses are separated by some
exact multiple of the cache line size. See Avoiding Inefficient Cache Usage in
Chapter 11 for more information on the performance problems this can cause.
Rearrange data such as array subscripts and nested loops so that data is accessed
sequentially in main memory.
Rearrange data structures to maximize local referencing. Pack data that is referenced
together into as few cache lines as possible.
For automatic and static data, for which it is difficult to determine cache line
boundaries, incorporate the data into structures. The compilers, in most cases, allocate
memory for data structures in a way that fully utilizes each cache line.
Consider allocating large structures on cache line boundaries so that you can control
which variables occupy the same cache line.
7-4
modules, access mode 2 is the only access mode that gives you read/write access to a region
of shared virtual memory. Although this access mode does not require any routines that lock
regions of virtual memory, Stratus strongly recommends that you use locking routines.
There are three access modes available on XA/R-series modules that give you read/write
access to shared virtual memory (access modes 2, 7, and 9), but only access mode 2, which
uses a caching policy called exclusive-sequential, supports memory-ordering. Stratus
strongly discourages using exclusive-sequential caching on XA/R-series modules because,
on those modules, it has the highest performance cost of any of the caching policies available.
On Continuum-series modules, access mode 2 supports memory-ordering without the
performance degradation associated with the exclusive-sequential caching policy
implemented by access mode 2 on XA/R-series modules. However, if the application you are
migrating to a Continuum-series module uses memory-ordering without any virtual memory
locking routines, Stratus recommends that you upgrade to an exclusive-use locking policy
that uses the machine-independent locking mechanism (s$connect_vm_region access
mode 10) described in Chapter 8, Upgrading to Machine-Independent Locks.
7-5
7-6
Chapter 8:
Upgrading to Machine-Independent Locks
8-
8-1
of 10 invokes the StrataBUS locking mechanism, the same interlock memory access invoked
by an access_mode value of 3 on those systems.)
The s$query_vm_lock subroutine, designed for use in debugging applications, requires
that an application specify an access_mode value of 8 in the s$connect_vm_region
subroutine call.
Table 8-1 describes access_mode values 8 and 10. For a complete description of
s$connect_vm_region and all the access modes, see the VOS Subroutines manuals.
1
Table 8-1. Additional Access Modes for Connecting a Processs Virtual Memory to a File
Code
Access Mode
I/O Type
Locking Mode
update
implicit
10
update
implicit
A program can use the machine-independent locking subroutines to perform the following
locking-related tasks:
VOS Release 13.0 supports Continuum-series modules only. However, with Release 13.1 and
later releases that support modules released prior to the Continuum series, you will be able to
use the machine-independent locking subroutines on all Stratus platforms.
The subroutines for using the machine-independent locking mechanism replace the existing
operating system library routines try_spin_lock, lock_spin_lock,
unlock_spin_lock, and spin_lock_size and provide some enhanced functionality. The
s$init_vm_lock and s$query_vm_lock subroutines have no equivalent existing
operating system library routines. Users of the existing routines had to initialize a lock by
explicitly setting the sign bit of the lock word to a negative value. Since any reading of the
lock word would reset the sign bit, users could not check the status of a lock without changing
that status. The s$init_vm_lock and s$query_vm_lock subroutines provide a
subroutine interface for initializing a lock and for checking the status of a lock.
8-2
The s$vm_lock_size subroutine returns the number of bytes of lock memory that are
used for a single lock on the current processor.
For complete descriptions of all subroutines mentioned in this chapter, see the VOS
Subroutines manuals.
See the s$init_vm_lock subroutine description in the VOS Subroutines manuals for
information on, and a brief coding example of, conditional precompilation. You can use
8-3
For information on the existing operating system library routines, see the file
>system>doc>spin_lock.doc.
8-4
Chapter 9:
Restricting the Memory Used by Programs or Processes
9-
how address space is handled on Continuum-series modules and on VOS Release 13.0
and later releases
what kinds of virtual memory limits exist for a program or process and how you get
information about and adjust those limits from command level, at bind time, and with
subroutine calls in the source code
how you can further manage a programs virtual memory allocation using three
additional bind command arguments
how you can use bind directives to create a shared virtual memory database that avoids
duplicative use of physical disk space by multiple program modules using the database
For complete descriptions of the commands and subroutines referred to in this chapter, see
the following manuals:
commands.
For information on problems you might encounter if limits are inadequately or inaccurately
set, see Correcting Problems Related to Process and Program Limits in Chapter 11.
9-1
lowest address to the highest address, and heaps grow down. This change is specific to
Continuum-series modules, not to the VOS Releases that support them.
VOS Release 13.0 (and for XA2000 and XA/R-series modules, VOS Release 13.1) and later
releases handle address space differently from earlier releases. Each static task has its own
fence, which prevents tasks from overwriting each other, and the last tasks stack always has
a fence of at least 32K. In addition, program address space contains an area of dead space,
which is space that can be used as stack space, heap space, or shared-memory space.
Figure 9-1 shows the layout of a programs address space on Continuum-series modules.
1
Code Region
Lowest
Address
Unshared
Static Region
Shared
Static Region
Symbol Table
(Symtab)
Program
Address
Space
Maps
Stack
Fence
Dead Space
Heap
Process Space
Highest
Address
9-2
Use the s$get_current_cmd_limit subroutine to return the current setting for the
process maximum command limits for a specified memory category.
Display process maximum command limits for all three memory categories with the
list_process_cmd_limits command.
Change process maximum command limits for a specified memory category with the
s$set_current_cmd_limit subroutine or for one or more specified memory
categories with the update_process_cmd_limits command. Only a privileged
9-3
Process initial command limits determine the virtual memory initially allocated for a program
module that does not itself specify different values for these limits. Unless otherwise
specified, the process initial command limits are set to the initial total limit, initial heap limit,
and initial stack limit of the module default command limits. You can override these limits at
bind time by using arguments to the bind command or equivalent binder control file
directives to specify the size of a programs address space, heap, and stack. You can display
or change the process initial command limits as follows:
In a source module, set the current command limit for a specified memory category
with the s$set_current_cmd_limit subroutine.
At bind time, set the current command limit for a specified memory category with the
bind commands -max_program_size, -max_stack_size, and
-max_heap_size arguments or equivalent binder control file directives.
Module default command limits determine the maximum and initial virtual memory limits for
any new process started on the current module. If you are a system administrator, you can
display or change the module default command limits as follows:
9-4
The -size argument specifies the size of the address space for which the binder is to
bind the object modules.
The -load_point argument assigns a lowest address for the object modules being
bound.
The -stack_size argument controls the maximum stack size for each static tasks
stack in a program with one or more static tasks.
If you omit any of these four bind command arguments, the binder uses default values
appropriate for the processor family of the module on which you are binding the program. In
most cases, the default settings for a Continuum-series module are adequate for programs you
are migrating to the Continuum architecture.
For information on bind command arguments and equivalent binder control file directives,
see the bind command description in the VOS Commands Reference Manual (R098).
9-5
9-6
Chapter 10:
Upgrading to the Microjiffy Time-of-Day Clock
10-
This chapter describes the Time-of-Day clock used on Continuum-series modules and on
XA/R Model 300 modules and the programmatic interfaces to it.
The subroutine s$read_clock returns the time in microjiffies since the module was
booted.
10-1
To upgrade your applications to make full use of the microjiffy Time-of-Day clock, do the
following:
10-2
Chapter 11:
Troubleshooting
11-
This chapter explains some problems you may encounter in the migration process and how
to correct them. It covers the following topics:
Note that paging space problems are usually related to the size of the largest block within a
source program. It is unusual that procedures or functions in a typical modularly designed
program will be large enough to cause paging space problems.
The following diagnostic from the compiler indicates that there was insufficient free paging
space to accommodate virtual memory requirements:
FATAL ERROR 2533 SEVERITY 4
Implementation restriction: there was insufficient virtual memory for
this compilation. To eliminate this error you can break up this
compilation unit, procedure, or function; or the system administrator
can add a paging file or increase this modules paging partition size.
Paging space problems can occur when a number of concurrent compilations are performed
on the same module, and at least one compilation unit consumes excessive virtual memory.
11-1
During concurrent compilations, a relatively small compilation unit may be affected because
of the virtual memory usage of another compilation unit.
If you experience paging space problems, make one of the following modifications before
recompiling:
Increase the paging partition size with the system administration command
update_disk_label, which takes effect at the next reboot of the module.
If you use the add_paging_file command to dynamically increase paging space, also be
sure to include the add_paging_file command in the module_start_up.cm file. Giving
the add_paging_file interactively adds the specified paging file for the current bootload,
and inserting the same command line into the module_start_up.cm file ensures that the
paging file continues to be recognized as a paging file following the next reboot of the
module. See VOS System Administration: Disk and Tape Administration (R284) for the
argument values to use for the create_file command to create a paging file and for more
information on the add_paging_file command.
If you use the update_disk_label command to increase paging space, give the command
with the -pagepart_size number argument. The number you give in this argument will
be set at the next bootload. The default value is 6000. You can change the paging partition
size only in multiples of eight blocks. For example, if the current paging partition size is
256 blocks and you specify 516 blocks, the actual size will be 512 blocks. When you increase
the size of the paging partition, VOS takes blocks from the file partition. Use the
display_disk_info command to make sure there are enough free blocks in the file
partition that can be given to the paging partition. See the manual VOS System
Administration: Disk and Tape Administration (R284) for more information about the
update_disk_label command.
For each simultaneous large compilation, the module needs approximately 16,000 pages of
paging partition. For example, 32,000 pages of paging partition allows the compiling of two
large applications simultaneously, or the compiling of a large application and a number of
small applications simultaneously. (This estimate also applies to i860XR and i860XP
processors.) You also need to allow an additional number of pages per user on the module.
That number is site-specific, depending on what applications users are running and how much
virtual memory those applications are known to use.You will need one page of paging
partition for every page of virtual memory used by a process, excluding pages containing
executable code.
From command level, you can monitor paging space availability by using the
display_paging_usage command. Use this command instead of the
display_disk_info command for such monitoring purposes. Using
11-2
paging partition space remains available, but it does not include information on paging space
available in paging files. The display_paging_usage command reports on paging space
available both in the paging partition and in any paging files.
You can also monitor paging space availability by using the s$get_paging_usage
subroutine. Use this subroutine instead of s$get_disk_info for such monitoring purposes.
The s$display_disk_info subroutine returns information on paging space in the paging
partition only, but s$get_paging_usage returns information on paging space available
both in the paging partition and in any paging files. See the VOS Subroutines manuals for
information on both of these subroutines.
11-3
11-4
If you are running a particularly large program, and your current command limits, your
process maximum command limits, or the module default command limits are not set high
enough, your program or other user programs may be unable to dynamically allocate enough
memory for successful operation.
For example, in VOS Standard C, the return value of the malloc function indicates whether
the functions attempt to dynamically allocate memory was successful. When the malloc
function successfully allocates memory of the size specified, the function returns a pointer to
the first byte of allocated memory, but if the attempted allocation fails because the specified
amount of memory is not free to be allocated, the function returns the NULL pointer constant.
When you are debugging the failure of a large program, check the pointer value returned by
malloc. If it is the NULL pointer constant, use s$get_current_cmd_limit to return the
setting of each category of current command limits, and then use
s$set_current_cmd_limit to increase those settings as needed. See Chapter 9,
Restricting the Memory Used by Programs or Processes, for information on current
command limits, and see the VOS Subroutines manuals for information on these two
subroutines.
If any other user programs on the module are unable to allocate sufficient memory to run, the
module default command limits for the module may also need to be increased. You must be
a system administrator to use the update_default_cmd_limits command to reset these
limits, as described in Chapter 9.
If your current heap size limit is too small, your program may use the entire heap. In such a
case, the program fails, and the system may generate a large program_name.kp file. To
correct the problem, you need to increase your current command limit for heap size.
In setting any of the virtual memory limits, remember also that the amount of memory a
program uses can be affected by runtime events, such as user input or the amount of data in
a file. Do not set process maximum limits based only on the anticipated current run of the
program, but allow for runtime variability for different runs of the same program.
11-5
Because the default limits are settable by a system administrator, they may differ from
module to module. Do not assume that a program that runs successfully on one
Continuum-series module will run successfully on another unless you are sure that the default
process command limits are set to an adequate value on the other module.
You can display, update, or override module default command limits as follows:.
You can use the list_default_cmd_limits command with the module argument
to display the default command limits for a module.
If you are a system administrator, you can update the default command limits for the
module, using the update_default_cmd_limits command.
If you are a privileged user, you can override the default limits, including the process
maximum limits, by explicitly setting limits of your own with the
update_process_cmd_limits command or the s$set_current_cmd_limit
subroutine.
Note: If you are a general non-privileged user, you can increase any of your own
processes initial command limits but only within the bounds of the maximum module
default command limits, and you cannot increase any of your processes maximum
command limits. Regardless of how you are registered (as a privileged user or a
member of the SysAdmin group), you cannot override the default command limits for
the module by using bind command arguments or binder control file directives. At
bind time, you can specify current command limits, but only within the bounds set by
the default limits for the module.
11-6
Appendix A:
Migrating Forms Management System (FMS) Applications
A-
This appendix describes how to edit, recompile and rebind Forms Management System forms
using an FMS Forms Editor. It assumes that you are familiar with the VOS Forms
Management System manuals and the descriptions of the nls_edit_form and edit_form
commands in the VOS Commands Reference Manual (R098)
If your application uses Forms Management System (FMS) forms, you must recompile and
rebind the forms for the PA-RISC processor.
For best performance, Stratus recommends that you also edit the .form files to use longmap
data alignment. However, you can recompile the forms without editing them in the following
cases:
you created the .form files using longmap data alignment on an i860 processor
you migrated your applications from a processor in the MC68000 family to an i860
processor, and edited them to use longmap alignment at that time
your forms are currently shortmap-aligned and you choose to retain shortmap
alignment. In this case, if you experience unsatisfactory performance later, you can edit
and recompile the forms for longmap alignment at that time.
A-1
If you are changing the .form files to longmap data alignment, use the nls_edit_form
command or the edit_form command interactively to edit each .form file, to recompile the
form, and to produce new object and include files. Give only the input_file argument and
the -processor processor_name argument from the command line, specifying pa7100
as the value for processor_name. Do not give other arguments from VOS command level.
Many of the command arguments given from VOS command level work only when you are
creating new forms. Because you are working with existing forms, VOS ignores most other
arguments you specify on the command line (so that any abbreviations you might have in
your abbreviations file do not change existing forms in ways you do not intend). After
you invoke the command, use <Menu> S, and choose options on the Form Options form.
Many of these options provide the same choices available in the command line arguments.
If you are changing the .form files to longmap data alignment in applications that have many
.form files, write a command macro that edits each file by means of the editing requests of
the line_edit command. Then use the nls_edit_form or edit_form command with the
-no_edit argument to recompile each form and produce new object and include files.
The following sections briefly explain how to migrate an FMS application to the PA-RISC
platform using the Form Options form or a VOS command macro.
The input_path argument is the path name of a form definition input file.
The value pa7100 indicates that the forms are being compiled to run on the PA-RISC
processor.
After executing the command line to invoke the Forms Editor, use <Menu> S to display the
Form Options form. In the Form Options form, use default values or cycle any field to
the value you want.
Cycle the PRODUCE INTO field to yes to create a new include file for each language specified
in the language options.
Cycle the LONGMAP field to yes to cause the include files generated by the Forms Editor to
follow longmap alignment rules and to cause the object files produced to expect
longmap-aligned data.
How the value you select for the LONGMAP field affects include files depends on the language
you are using.
In VOS Standard C, VOS C, and VOS Pascal, the include files created contain explicit
longmap or shortmap keywords in the field-values structures.
In VOS PL/I, these keywords are generated only if the value for the TEMPLATE field in
the Form Options form is the default value, yes. If you cycle the value in the
TEMPLATE field to no, you must add the appropriate keywords manually.
A-2
VOS COBOL and VOS FORTRAN do not allow the definitions of structure templates.
In VOS COBOL and VOS FORTRAN, the Forms Editor generates an include file for
the body of the structure, which you include in your program under the definition of the
structure itself, such as in this VOS COBOL example:
01
my_structure.
copy 'struct_info.incl.cobol'.
Note that, in VOS COBOL, the Forms Editor cannot insert the longmap or shortmap
keywords for you. You must add the longmap or shortmap keywords manually.
Cycle one or more of the COBOL, PASCAL, PL/I, C, or FORTRAN fields to yes to specify the
language or languages for which you want to produce new include and object files.
Select a value for the FLAG WORD SIZE cycle field, available for nls_edit_form only, not
for edit_form. The FLAG WORD SIZE field specifies the size of the bit flag words in the
field-values file. The Forms Editor organizes the VOS Pascal boolean data type, the VOS
PL/I bit(1) data type, and the VOS Standard C and VOS C bit data type into bit flag words.
The possible values are 32, 16, and 8. The default is 32. Binary fields that are larger than the
flag word size are not allowed in any language. In VOS Standard C programs, always use 32,
the default. In VOS C programs, eight-bit flag words are not supported. If you use 16-bit flag
words in VOS C, the compilation unit must include the following options:
#options bit_field_size short;
#options bit_field_align short;
Select a value in the SORT BY ALIGNMENT cycle field. By default, the Forms Editor
rearranges the elements of a structure to minimize the amount of padding that has to be added
when following longmap rules. If you do not want the elements of structures rearranged in
this manner, cycle the value in the SORT BY ALIGNMENT field to no.
A-3
When you complete editing the .form files with the command macro, use the
nls_edit_form or edit_form command with the -no_edit argument to recompile the
forms.
A-4
Appendix B:
Finding and Correcting Runtime Alignment Faults
B-
This appendix briefly describes how to use VOS commands and VOS System Analysis
subsystem requests to detect and diagnose runtime alignment faults and how to use
information in the program_name.list file to further investigate the cause of a runtime
alignment fault.
Even if an application compiles and binds without error, in a few cases it may generate
runtime alignment faults that the compiler could not find. For example, a misaligned pointer
is a common cause of a runtime alignment fault, such as when a VOS Standard C application
uses an integer that is not mod4-aligned to increment a pointer that points to a longmap long
int integer.
The CPU detects such runtime alignment faults and invokes a VOS fault handler that corrects
the access with no user intervention. However, the fault handler may have to generate
hundreds, and perhaps thousands, of extra instructions to correct a runtime alignment fault
and therefore may noticeably affect the performance of your application.
This appendix describes the following commands for detecting and diagnosing runtime
alignment faults.
the profile command, which includes alignment fault information in the data it
generates about a program
The appendix also describes the following VOS System Analysis subsystem requests
the process, match, and who requests, which provide information you can use to
identify the program that is generating runtime alignment faults
the use_file and where requests, which let you analyze a non-running program for
the cause of alignment faults
the disassemble request, which displays the assembly language instructions for
source code associated with an alignment fault
B-1
The last section of the appendix, Using Information in the .list File, explains how to
use information in the listing file, generated at compilation when you give the -list
argument, to further diagnose and track the cause of a runtime alignment fault.
During program execution, when an alignment fault occurs, the program goes to break level
with a message similar to the following.
An attempt has been made to access unaligned data.
Error occurred in procedure customer_accounts, line 48.
Command was customer_accounts.pm.
In the message, the term procedure refers to the object module in which the error occurred.
In this case, the object module is customer_accounts.obj.
You are then prompted for a break-level request. Choose debug. At the db? prompt, give the
src debugger request. The debugger displays the line number and the source code on that
line of customer_accounts.c
Request? (stop, continue, debug, keep, login, re-enter) debug
Entering debug.
New language is c.
db? src
48
temp = *arg;
db?
You can then give additional debugger requests to further trace the fault by determining, for
example, where arg is used as an argument and what values are passed.
B-2
To turn off alignment fault mode, issue the set_alignment_fault_mode command with
the -no_fault argument.
set_alignment_fault_mode -no_fault
See the VOS Commands Reference Manual (R098) for command descriptions of the debug
command and the set_alignment_fault_mode command.
2. Bind your object modules with the bind command, using the
-profile_alignment_faults argument. When you use the -qc or the
-cpu_profile compiler argument without the bind commands
-profile_alignment_faults argument, code coverage, time and page fault
information is tracked. The -profile_alignment_faults argument overrides
page fault tracking and tracks alignment faults instead. The following example binds
the object modules customer_accounts.obj and overdue.obj and tracks
alignment faults rather than page faults.
bind customer_accounts overdue -processor pa7100
-profile_alignment_faults
Because the example omits the -pm_name argument, the program module created has
the same name as the first object module specified, but has the suffix .pm instead of
.obj.
3. Run your program module. For example:
customer_accounts
B-3
5. Use the VOS display command or one of the VOS text editors to view the .plist
file. For example
emacs customer_accounts.plist
The ALIGN FLTS column gives the number of alignment faults generated, and the
program listing to the right of that column shows the line number and source code
associated with the fault. (The COUNT column shows the number of statements
executed, and the CPU(ms) column shows the CPU time used, in milliseconds.)
COUNT
.
.
.
2000
105.57
1000
48
temp = *arg;
For more information on the profile command, its several modes, and its other arguments,
see the profile command description in the VOS Commands Reference Manual (R098).
B-4
Make a note of the process number and PTEP (process table entry pointer) of your current
process for later use.
At request level, indicated by the as: prompt, you can use any of the analyze_system
requests.
Choose a time of low usage on the module, when other programs are not likely to be
generating frequent alignment faults that will fill the log display buffer with unrelated
log entries.
Confirm that no other user is currently using information in the alignment fault log.
Since there is only one alignment fault log per module, you need to be sure that
resetting the log or restricting its contents does not interfere with alignment fault
tracking by another user.
Alert other users on the module that you are using the log so that they do not
inadvertently interfere with your alignment fault tracking by resetting or restricting the
logs contents.
To determine if alignment fault logging is taking place on the current module, invoke the
display form of the log_alignment_faults request.
as: log_alignment_faults -form
In this example, the -mode argument is set to on, which means that alignment faults are
currently being logged.
B-5
Leave the -reset argument value as yes to delete all current log entries. If you want to log
alignment fault information only about programs run by your current process, specify the
PTEP number of your current process. Press <Enter> to start and reset the log.
If -mode is set to off instead, alignment faults are not currently being logged. Cycle the
value to on, specify the PTEP number of your current process if you want to log alignment
fault occurrences only for that process, and press <Enter> to start and reset the log.
Now run your application. The occurrence of any runtime alignment faults are logged.
If you did not restrict logging to one process by specifying a PTEP when you issued the
log_alignment_faults request, the output of display_alignment_faults
-no_brief is similar to the following:
10001 alignment faults have been logged. Up to 256 will be displayed.
ptep
# of times
818ED2E0
11
8197DAC0
22
818EEB40
22
813FCC40
117
823C6920
8
81E7FC60
75
Fault instruction
pc: 80631D30 (object_module_name+320)
pc: 80631D30 (object_module_name+320)
pc: 80631D30 (object_module_name+320)
pc: 00008208 (analyze_system+208)
pc: 8043EA2C (object_module_name+186C, line 464)
pc: 00006848 (user address in another process)
Trace complete.
as:
The preceding output shows alignment faults for system and user processes. (System
processes can generate alignment faults when misaligned argument data is passed by user
programs to kernel routines.) The output contains the following information.
the PTEP (Process Table Entry Pointer) for each process generating alignment faults
the number of times an alignment fault occurred for each process
the hexadecimal address of the program counter (pc: address), which is the address
where the fault occurred. User programs occupy addresses between 800x and
3FFFFFFx; the other programs are system programs
in parentheses, the name of the object module generating the fault, and the statement
offset
for user programs still running in the current process (even if they are not currently
using CPU time), the source code line number associated with the fault. If you use the
process request to set a different process to be analyzed, the output of
display_alignment_faults -no brief also shows line number information for
programs currently running in that process. See the discussion of the process request
B-6
in Using analyze_system from a Process That Did Not Run the Program later
in this chapter for information on designating a process to be analyzed.
for alignment faults generated by other user processes not specified as the process to be
analyzed, the message user address in another process instead of the object
module name, statement offset, and line number
In the preceding example, your current process is process number 236, with a PTEP number
of 815C9000.
Next give the display_alignment_faults request with the -no_brief argument. The
log entries displayed include an entry similar to the following.
ptep
# of times
.
.
.
815C9000
117
Fault instruction
pc: 00008208
(analyze_system+208)
Because the program module has run to completion and is no longer loaded, the fault is
B-7
attributed to the analyze_system command you are using to track the fault. To correctly
identify the log entry to use, you must be sure of the following:
The PTEP number in the displayed log entry must match the PTEP of your current
process. The PTEP number of the log entry in the preceding example is 815C9000.
Your current process must not have run another program module that may have
generated the fault since you reset the log. When analyzing a program that has already
run to completion, you need to be familiar with what other program modules your
process may have run. You may need to examine source code or command macros of
a multi-program application to determine what program modules it uses.
If the PTEP number in the log entry matches the PTEP number of your current process, and
your current process has not run other program modules since you reset the log, you have
identified the correct log entry to use.
Using analyze_system from a Process That Did Not Run the Program
You can view alignment fault log entries from a process other than the process that runs your
program. For example, if you are working in a Window Terminal environment, you can run
your program from one process and then, from another process in a different window, invoke
analyze_system to display the alignment fault log entries.
When you display alignment faults from a different process from the one that is already
running your program, use the process request to indicate which process to analyze, and
then give the display_alignment_faults request. See the process request description
in the VOS System Analysis Manual (R073) for information on how to specify any of the
following to set the process to be analyzed:
If you invoke analyze_system from a different process and do not indicate the process to
analyze, any alignment fault log entry your program generates is of limited usefulness and
may be very similar to other entries in the log. For example, the output of
display_alignment_faults -no_brief would show a log entry similar to the
following, containing the words user address in another process rather than the
program name and line number associated with the fault occurrence.
ptep
# of times
.
.
.
8240B700
199
Fault instruction
To obtain the information necessary to indicate the process to be analyzed, use the who
request to list information about the processes running on the module. If you already know
the PTEP of the process you want to analyze, first give the match request, specifying that
B-8
PTEP. The match request limits the output of the subsequent who request to information
about the process associated with the PTEP you specify.
as: match 82470B700
as: who
1914 82470B700 person_name.group_name, on CPUnumber
as:
The first number in the output is the process number. You can then use that process number
to set the process to be analyzed.
as: process 1914
After you set the process to be analyzed and then invoke display_alignment_faults
-no_brief, a displayed log entry for that process contains the object module name and
source code line number associated with an alignment fault occurrence.
For example, the output of display_alignment_faults -no_brief would include an
entry similar to the following.
ptep
# of times
.
.
.
82470B700
117
Fault instruction
Note: the process request loads symbol table information for a program running in
the specified process at the time you give the process request, not at the time you
start the program running. Therefore, always run the program first, then set the process
to be analyzed, and then display the log by using display_alignment_faults
-no_brief.
If your program has run to completion and is no longer loaded, the command
display_alignment_faults, with the -no_brief argument, displays no object module
or line number information about the fault. (Note that this also occurs if you compiled the
program without using the -table argument.) For example:
ptep
# of times
.
.
.
82470B700
117
Fault instruction
pc: 00008208
(8208)
If the program is no longer loaded, use the use_file request described in the next section
to load the program into user address space so that you can examine the code at the address
associated with the fault.
B-9
The use_file request has no output except a line of VOS and analyze_system release
information, followed by the as: prompt.
At the as: prompt, give the where request with the address of the alignment fault, as listed
in the earlier output of the display_alignment_faults request. The output identifies the
line number associated with the alignment fault in the source module.
as: where 8208
00008208 at customer_accounts+208, line 48
as:
You can then give the VOS display command, preceded by two periods, from within the
subsystem to display the source module line associated with the fault. The following example
assumes the source module is in your current directory.
as: ..display customer_accounts.c -first_line 48 -last_line 48
path_name>customer_accounts.c 95-01-21 08:47:57 EST
temp = *arg
B-10
In the following example, specifying the source module line number associated with the fault
produces output showing, in assembly language and hexadecimal format, the particular
assembly language instructions for that entire line.
as: disassemble customer_accounts@48
/* Line 48
00008204 14610011 ld.l
+16(r3),r1
00008208 14210001 ld.l
+0(r1),r1
0000820C 1C7F0FE5 st.l
r1,-28(r3)
In the output of both examples, ld.l and st.l access a longword (4-byte item). If this 4-byte
item is misaligned, an alignment fault is the result. While not providing conclusive evidence
for the cause of the fault, a look at this assembly language code identifies a possible cause to
be explored further.
The output of the VOS System Analysis disassemble request is similar to the assembly
language information provided in the listing file when you use both the -list and -full
compiler arguments, and also to the output of the VOS Symbolic Debuggers disassemble
request.
Use the VOS display command to check the listing file to find all the instances where arg
is accessed.
display customer_accounts.list -match arg -no_header
Suppose that the relevant portions of the display commands output are the following:
36
void report ( long $longmap *arg )
48
temp = *arg;
.
.
.
Prototype Arguments: arg
->long
arg
parameter
4 4 0010 ->long
at 36
From this output, you know that arg is longmapped, but you also know that arg is an
argument to the function report. You therefore might need to use the display command
with its -match argument several more times to investigate the fault further. For example,
you might first display all instances of the function report to see what argument values are
being passed. If members of several different structures were found to be the argument values
for the report function, you might then display all instances of each of those structure
B-11
members to see how each is declared, what values are assigned to them, and how they are
used.
A possible finding might be a misalignment of one of the structure members. For example,
the following excerpts from a listing file show that the offset of member_b is 4 (the value in
the A column) and the offset of member_d is 2, suggesting that member_d is shortmapped.
NAME
STORAGE
SIZE A
.
.
.
member_b
.
.
.
member_d
LOC
TYPE
4 4
long
4 2
long
You would then check the source code to confirm that member_d is shortmapped.
To correct such an alignment fault, use the information on data alignment in Chapter 3,
Addressing Alignment Issues. Some options to correct the fault might include the
following:
B-12
Index
Index-
A
Access modes
e$invalid_access_mode error
code, 8-3
s$connect_vm_region modes
for debugging with
s$query_vm_lock, 8-2
for exclusive non-sequential
caching, 7-6
for exclusive-sequential caching, 7-5
for exclusive-use locking, 7-6
for machine-independent locking, 8-2
for memory-ordering support, 7-5
for shared non-sequential caching, 7-6
add_paging_file command, 1-4, 11-2
Address space layout, 9-2
Aliased values with defined storage, 4-7
aligned attribute, 3-17
Alignment
argument and parameter compatibility in
VOS PL/I, 3-15
checking for inserted padding, 3-5
checking structures not explicitly
aligned, 3-6
correcting mismatches in subroutine
arguments, 3-14
deciding on a strategy, 2-4
for migrating i860-based
applications, 2-4
for migrating MC68000-based
applications, 2-4
inheritance, 3-11
VOS Pascal usage, 3-11
VOS PL/I usage, 3-12
VOS Standard C usage, 3-11
longmap definition, 3-2
padding in VOS Standard C, 3-4
performance penalties for misalignment, 1-1
sample longmapped structure, 3-2
sample shortmapped structure, 3-3
shortmap definition, 3-2
sorting structure elements by alignment in
FMS, A-3
specifying
for FMS include files, A-2
in communications-based
applications, 3-10
with alignment attributes, 3-6
with compiler command arguments, 3-5
with compiler directives, 3-5
string data, 3-17
using longmap rules, 1-2
using shortmap rules, 1-2
with untyped storage sharing, 3-18
Alignment faults at runtime
finding and correcting, B-1
identifying source module line
number, B-10
identifying the correct log entry, B-8
interpreting log entries, B-6
logging, B-5
recommended maximum number, 2-8
variation when different code paths
execute, 11-3
analyze_system requests, 2-9, B-4
disassemble
interpreting output of, B-11
with use_file request, B-10
display_alignment_faults, B-6
log_alignment_faults, B-5
match, B-7, B-8
preparing to use, B-4
process, B-8
to select the process to analyze, B-8
using after a program runs, B-9
use_file, B-9
where, B-10
who, B-7, B-8
arglistptr obsolete built-in function, 4-8
Assembly language code analysis, B-10
Asynchronous data modification, 4-2
Attributes
like in VOS PL/I, 3-13
specifying data alignment
for aggregate data types, 3-6
for scalar data types, 3-6
Index-1
Index
type in VOS PL/I, 3-13
volatile, 4-2
alternatives to, 4-3
using with locks, 4-3
Automatic variables after longjmp function
call, 4-6
B
Based storage
avoiding for overlays of incompatible data
types, 4-7
compatible alignment when referenced by
pointers, 3-17
bind command
arguments specifying virtual memory
limits, 1-4, 9-4
-load_point argument, 9-5
-max_heap_size argument, 9-4
-max_program_size argument, 9-4
-max_stack_size argument, 9-4
overriding module default command
limits, 11-5
-profile_alignment_faults
argument, 2-8, 2-9, B-3
-size argument, 9-5
-stack_fence_size argument, 9-5
-stack_size argument, 9-5
-table argument, B-4
Bind directives for shared virtual memory
database
define, 9-5
high_water_mark, 9-5
Bit field overlays, 4-8
Bit flag word size in FMS, A-3
Bit-string data
aligned, 3-17
length, 3-17
BREAK condition, 4-2
Built-in functions
paramptr, 4-8
rel, 4-8
unspec, 4-8
C
C language. See VOS Standard C
Caches
cache lines, 7-1
determining boundaries of, 7-2
virtual address indexing to, 7-3
cache misses, 7-1
cache sizes on Continuum, 7-2
caching policies
exclusive non-seqential, 7-6
Index-2
exclusive-sequential, 7-5
shared non-seqential, 7-6
supporting memory-ordering, 7-5
data, 7-5
default VOS behavior, 6-1
direct map, 1-3
efficiently using
avoiding duplicate programs, 11-3
avoiding false sharing, 7-4
avoiding faulty data layout, 7-4, 11-3
fully packing cache lines, 7-4
minimizing data sharing, 7-3
improving performance with, 7-1
instruction, 7-5
virtually indexed, 1-3
cc command
-qc argument, 2-8, 2-9, B-3
CHARACTER functions in VOS FORTRAN, 5-4
Character-string data alignment, 3-18
Clocks
subroutine interfaces to, 10-2
Time-of-Day, 1-5, 10-1
Command macros
specifying memory pools in, 6-3
to edit multiple FMS forms, A-3
Command virtual memory limits. See Virtual
memory limits, command
Commands
add_paging_file, 1-4, 11-2
analyze_system, 2-9, B-4
bind
arguments specifying virtual memory
limits, 1-4, 9-4
-load_point argument, 9-5
-max_heap_size argument, 9-4
-max_program_size
argument, 9-4
-max_stack_size argument, 9-4
overriding module default command
limits, 11-5
-profile_alignment_faults
argument, 2-8, 2-9, B-3
-size argument, 9-5
-stack_fence_size
argument, 9-5
-stack_size argument, 9-5
cc
-qc argument, 2-8, 2-9, B-3
compiler
-check_uninitialized
argument, 5-4
-cpu_profile argument, 2-8, B-3
-mapping_rules argument, 3-5
Index
-production_table
argument, 4-6, 5-1
-table argument, B-4
create_file to create paging files, 11-2
debug
continue request, 4-6, 5-2
set request, 4-6, 5-2
with floating-point exceptions, 5-3
display
tracing an argument in .list
file, B-11
using from System Analysis
subsystem, B-10
display_disk_info, 2-2, 11-2
display_error, 3-5
display_paging_usage, 1-3, 11-2
edit_form, A-1
line_edit, A-2, A-3
list_default_cmd_limits, 1-4, 2-3,
9-4, 11-6
list_process_cmd_limits, 1-4, 2-7,
9-3, 9-4
list_users for memory pool
information, 6-4
login
-memory_pool argument
error message with one memory
pool, 6-4
for subprocess login, 6-3
nls_edit_form, A-1
profile, 2-8, 2-9, 11-4, B-3
set_alignment_fault_mode, 2-9,
B-2
break-level requests, B-2
turning off the mode, B-3
start_process
error message with one memory
pool, 6-4
-memory_pool argument, 2-7, 6-3
update_default_cmd_limits, 1-4,
2-3, 9-4, 11-5, 11-6
update_disk_label, 1-4, 11-2
update_process_cmd_limits, 1-4,
2-7, 9-3, 9-4, 11-4
Communications-based applications
alignment of structures, 3-10
using latest include files, 3-11
Compiler commands
-check_uninitialized
argument, 5-4
-cpu_profile argument, 2-8, 2-9
-mapping_rules argument, 3-5
-production_table argument, 4-6, 5-1
-table argument, 4-5, 5-1
Compiler directives
no_default_mapping, 3-6
to specify data alignment, 3-5
Compiler options
for specifying alignment, 3-5
untyped_storage_sharing, 4-8
Compiling
FMS .form files, A-1
multiple large applications, 2-1, 11-1
with longmap mapping rules, 2-7
with shortmap mapping rules, 2-9
Conditional precompilation, 8-3
Continuum features affecting migration, 1-1
Converting structures to longmap, 3-18
Correcting incorrect or inefficient coding, 2-6
CPU/memory boards, 6-1
create_file command to create paging
files, 11-2
Current command limits, 9-4
D
Data alignment
See Alignment
Data caches, 7-5
Dead space, 9-2
debug command
continue request, 4-6, 5-2
set request, 4-6, 5-2
with floating-point exceptions, 5-3
Debugging
floating-point exceptions, 5-3
runtime alignment faults, B-2
virtual memory locks, 8-2
with -table compiler argument, 4-5
define bind directive, 9-5
Defined storage
avoiding performance penalty for defined
overlays, 4-7
using for overlays of incompatible data
types, 4-7
Direct map cache, 1-3, 7-1
disassemble System Analysis request
interpreting output of, B-11
with use_file request, B-10
display command
tracing an argument in .list file, B-11
using from System Analysis
subsystem, B-10
display_alignment_faults System
Analysis request, B-6
display_disk_info command, 2-2, 11-2
display_error command, 3-5
display_paging_usage command, 1-3,
Index-3
Index
11-2
E
edit_form command, A-1
Editing FMS forms, A-3
Exception handlers in floating-point
calculations, 5-3
Exclusive-use locking, 4-4
Expressions
breaking up big expressions to avoid
rounding, 5-3
misaligned variables in relational
expressions, 3-18
F
Fault handlers for runtime alignment faults, B-1
Fences, 9-2
Files
.list, B-1
displaying all instances of a data
item, B-11
interpreting, B-11
.plist
generating, B-3
viewing, B-4
.profile, B-3
Flag words size in FMS, A-3
Floating-point values
exception-handling, 5-3
precision on different platforms, 5-2
FMS. See Forms Management System
.form files, A-1
editing with a command macro, A-2
Form Options form required for
revising, A-2
Form Options form in FMS, A-2
Forms Management System, A-1
Form Options form required for revising
forms, A-2
object library for NLS, A-4
FORTRAN language. See VOS FORTRAN
Functions
VOS PL/I parampter, 4-8
VOS PL/I rel, 4-8
VOS PL/I unspec, 4-8
VOS Standard C
longjmp, 4-6
malloc, 11-5
setjmp, 4-6
G
Gaps in structures, 3-5
Index-4
H
Heap space
controlling growth of heaps, 9-3
correcting inconsistent limits, 11-5
default per-command limit, 2-3
default per-process limit, 2-3
different address space usage on
Continuum, 9-2
setting limit too small, 11-5
high_water_mark bind directive, 9-5
I
Include files
generated by the FMS Forms Editor, A-3
using for accurate structure
declarations, 3-10, 3-11
Increasing paging space, 1-4
Inheritance of alignment, 3-11
Instruction caches, 7-5
J
Jiffies, 1-5, 2-7, 10-1
K
.kp files, 11-5
L
like attribute
alignment rules for, 3-13
used with mixed structures, 3-12
Limits
correcting inconsistent limits, 11-5
current command limits, 9-4
module default command limits
differing among modules, 11-6
displaying and setting, 9-4
process initial command limits, 9-4
process maximum command limits, 9-3
setting too high, 11-4
setting too low, 11-4
virtual memory limits for commands, 1-4
virtual memory limits for processes, 1-4
line_edit command, A-2, A-3
.list file, B-1
displaying all instances of a data item, B-11
interpreting, B-11
list_default_cmd_limits
command, 1-4, 2-3, 9-4, 11-6
list_process_cmd_limits
command, 1-4, 2-7, 9-3, 9-4
list_users command for memory pool
Index
information, 6-4
Loading a program for alignment analysis, B-9
Local memory, 1-3, 6-1
Locking mechanisms
emulation of StrataBUS mechanism, 1-4,
2-7
performance penalty, 8-1
using for compatibility, 8-1
ensuring consistency of sets of variables, 4-4
machine-independent, 1-4, 2-7
performance advantage, 8-1
upgrading to, 8-1
used with volatile variables, 4-3
Locking policies
exclusive-use, 4-4, 7-6
multiple-reader/one-writer, 4-4
Locking subroutines, 1-4, 7-5, 8-2
checking lock status, 5-2
creating your own, 4-5
required to be external calls, 4-4
log_alignment_faults System Analysis
request, B-5
Logging alignment faults, B-5
identifying the correct log entry, B-6
identifying the log entry to use, B-8
viewing the log from another process, B-8
login command
-memory_pool argument
error message with one CPU/memory
Board, 6-4
for subprocess login, 6-3
longjmp function, 4-6
Longmap attributes, 3-6
VOS COBOL usage, 3-8
VOS FORTRAN usage, 3-9
VOS Pascal usage, 3-8
VOS PL/I usage, 3-8
VOS Standard C usage, 3-6
Longmap mapping rules, 3-2
as recommended rules, 2-3
compiling with, 2-7
Loops removed by compiler optimizations, 5-2
M
Machine-independent locking. See Locking
mechanisms, machine-independent
malloc function in VOS Standard C, 11-5
Mapping rules
checking the default, 2-2, 3-5
longmap
as recommended mapping rules, 2-3
compiling with, 2-7
where disallowed, 3-9
-mapping_rules compiler
argument, 3-5
shortmap
as a Continuum option, 2-4
compiling with, 2-9
where required, 3-9
-mapping_rules compiler argument
specifying alignment rules, 3-5
checking for padding, 3-5
match System Analysis request, B-7, B-8
Memory limits
current command limits, 9-4
module default command limits
different settings among modules, 11-6
displaying and setting, 9-4
overriding, 11-5
process initial command limits, 9-4
process maximum command limits, 9-3
setting too high, 11-4
setting too low, 11-4
Memory pools
controlling allocation to, 6-2
default allocation to, 6-1
getting information about assignment of, 6-4
local, 1-3, 6-1
remote, 1-3, 6-1
specifying, 2-7, 11-3
in command macros, 6-3
to solve caching conflict, 11-3
Memory-ordering, 7-5
Microjiffies, 1-5, 2-7
as unit of time measurement, 10-1
precision of Time-of-Day clock, 10-1
Migrating applications
effects of Continuum features, 1-1
FMS applications, A-1
ORACLE databases, 2-9
planning, 2-1
Mixing shortmap and longmap data, 3-11
Module default command limits, 9-4
different settings among modules, 11-6
displaying and setting, 9-4
overriding, 11-5
module_start_up.cm to add paging
file, 11-2
Multiple-reader/one-writer locking, 4-4
N
nls_edit_form command, A-1
nls_fms_object_library directory, A-4
O
object-computer paragraph to specify
Index-5
Index
alignment, 3-6
Optimization
effects on older applications, 5-1
eliminating redundant loading and
storing, 4-2
introducing risk of outdated shared data, 4-2
limited by volatile variables, 4-3
with -production_table compiler
argument, 4-6
with -table compiler argument, 4-5
ORACLE databases
migrating from Release 6 ORACLE, 2-9
ORACLE7 support on Continuum, 2-9
Overlays
bit field, 4-8
of incompatible data types, 4-7
P
Padding, 3-4
checking for inserted padding, 3-5, 3-10
explicitly padding a structure or union, 3-19
minimizing by rearranging elements, 3-18,
A-3
Paging space
adding dynamically, 11-2
adding for next bootload, 11-2
guidelines, 2-1
increasing, 1-4, 11-1
problem-solving, 11-2
usage
displaying current usage, 11-2
warning messages, 11-1
Parameter lists of varying length, 4-8
paramptr built-in function, 4-8
Pascal Language. See VOS Pascal
PL/I language. See VOS PL/I
.plist file
generating, 11-4, B-3
viewing, B-4
Pointers
alignment issues with based storage, 3-17
misalignment causing runtime fault, B-1
relational comparisons on pointer
values, 4-8
using alignment specifiers with, 3-7
Precision of Time-of-Day clock, 1-5
Precompilation, 8-3
Privileged process for updating command
limits, 9-3, 9-4
Process initial command limits, 9-4
Process maximum command limits, 9-3
allowing for memory usage variability, 11-5
setting too high, 11-4
Index-6
R
Registers
increased number on Continuum, 1-2
storing values in, 4-1
rel built-in function, 4-8
Remote memory, 1-3, 6-1
Runtime alignment faults. See Alignment faults at
runtime
S
s$clock_date_time subroutine, 1-5, 2-7,
10-1
s$clone subroutine, 6-3
s$connect_vm_region subroutine
access_mode values, 2-7
for debugging with
s$query_vm_lock, 8-2
for exclusive non-sequential
caching, 7-6
for exclusive-sequential caching, 7-5
for exclusive-use locking, 7-6
for machine-independent locking, 8-1
for memory-ordering support, 7-5
for shared non-sequential caching, 7-6
e$invalid_access_mode errror
code, 8-3
s$get_current_cmd_limit
subroutine, 1-4, 2-7, 9-3, 9-4, 11-5
s$get_disk_info subroutine, 11-3
s$get_paging_usage subroutine, 1-3, 11-3
s$get_process_info subroutine, 6-4
Index
s$get_processes_info subroutine, 6-4
s$get_vm_lock_word subroutine, 8-3
s$init_vm_lock subroutine, 8-3
s$int_date_time subroutine, 2-7, 10-2
s$jiffy_date_time subroutine, 2-7, 10-2
s$lock_vm_lock subroutine, 4-5, 5-2, 8-3
s$query_vm_lock subroutine
access mode for, 8-2
checking lock status with, 8-3
s$read_clock subroutine, 1-5, 2-7, 10-1
s$read_jiffy_clock subroutine, 2-7, 10-2
s$set_current_cmd_limit
subroutine, 1-4, 2-7, 9-3, 9-4, 11-4,
11-5, 11-6
s$sleep subroutine, 5-2
s$start_new_process subroutine, 2-6
on modules with one memory pool, 6-3
specifying a memory pool, 6-2
s$start_process subroutine, 2-6, 6-2
s$try_vm_lock subroutine, 4-5, 8-3
s$unlock_vm_lock subroutine, 8-3
declaring lock_storage argument, 8-3
releasing a virtual memory lock, 4-5
s$vm_lock_size subroutine, 8-3
set_alignment_fault_mode
command, 2-9, B-2
break-level requests, B-2
turning off the mode, B-3
setjmp function, 4-6
Setting up the migration environment, 2-1
Shared virtual memory
accessing outdated variable values, 4-1
conflicts with compiler assumptions, 4-2
ensuring consistency of sets of variables, 4-4
performance cost of cache line loading, 7-4
updates by multiple processes or
devices, 4-2
Shortmap attributes, 3-6
VOS COBOL usage, 3-8
VOS FORTRAN usage, 3-9
VOS Pascal usage, 3-8
VOS PL/I usage, 3-8
VOS Standard C usage, 3-6
Shortmap mapping rules, 3-2
as optional rules, 2-4
compiling with, 2-9
Specifying memory pool assignment, 2-7
Spin lock routines
lock_spin_lock, 8-2
spin_lock_size, 8-2
try_spin_lock, 8-2
unlock_spin_lock, 8-2
Stack fences, 9-2, 9-5
Stack space
Index-7
Index
s$get_disk_info, 11-3
s$get_paging_usage, 1-3, 11-3
s$get_process_info, 6-4
s$get_processes_info, 6-4
s$get_vm_lock_word, 8-3
s$init_vm_lock, 8-3
s$int_date_time, 2-7, 10-2
s$jiffy_date_time, 2-7, 10-2
s$lock_vm_lock, 4-5, 5-2, 8-3
s$query_vm_lock
access mode for, 8-2
checking lock status with, 8-3
s$read_clock, 1-5, 2-7, 10-1
s$read_jiffy_clock, 2-7, 10-2
s$set_current_cmd_limit, 1-4, 2-7,
9-3, 9-4, 11-4, 11-5, 11-6
s$sleep, 5-2
s$start_new_process, 2-6
on modules with one memory pool, 6-3
specifying a memory pool, 6-2
s$start_process, 2-6, 6-2
s$try_vm_lock, 4-5, 8-3
s$unlock_vm_lock, 8-3
declaring lock_storage
argument, 8-3
releasing a virtual memory lock, 4-5
s$vm_lock_size, 8-3
subroutines that require arguments initialized
to zero, 5-4
System Analysis subsystem, B-4
displaying source module lines from, B-10
invoking, B-5
T
Time-of-Day clock, 1-5, 2-7, 10-1
Troubleshooting
faulty data layout affecting cache
usage, 11-3
inconsistent memory limits, 11-5
insufficient module default command
limits, 11-6
paging space problems, 11-1
problems from running duplicate
programs, 11-3
process and command limit settings, 11-4
runtime alignment faults, 11-3
two programs heavily accessing the same
virtual addresses, 11-3
type attribute in VOS PL/I, 3-13
typedef used with alignment specifiers, 3-7
U
Unaligned bit strings, 3-18
Index-8
V
Variables
accessing outdated values in shared
memory, 4-1
after longjmp function call, 4-6
global variables and cache line loading, 7-4
removed by optimization when
unreferenced, 5-2
uninitialized causing applications
failure, 5-4
using with extended floating-point
calculations, 5-3
volatile, 4-3
impeding optimizations, 4-3
preventing optimization of unreferenced
variables, 5-2
with locking subroutines, 4-3
with setjmp function call, 4-6
Varying length parameter lists, 4-8
Virtual memory limits
command
default, 2-3
retrieving, 2-7
setting, 2-7
process
default, 2-3
retrieving, 2-7
setting, 2-7
volatile attribute, 4-2, 4-3
volatile variables, 4-3
impeding optimizations, 4-3
in loops, 5-2
preventing optimization of unreferenced
variables, 5-2
with locking subroutines, 4-3
with setjmp function call, 4-6
Index
VOS C, FMS usage, A-2
VOS COBOL
FMS usage, A-3
using longmap clause, 3-8
using shortmap clause, 3-8
VOS FORTRAN
compiler directives, 3-6
FMS usage, A-3
interoperability restriction on
Continuum, 5-4
(longmap) attribute, 3-9
(shortmap)attribute, 3-9
VOS Pascal
aligning dec 15 and dec 18
simulation, 3-20
alignment inheritance with, 3-11
FMS usage, A-2
longmap attribute, 3-8
%options alignment compiler
directive, 3-6
shortmap attribute, 3-8
VOS PL/I
accessing varying length parameter lists, 4-8
alignment specifier used with structures, 3-8
argument and parameter alignment
mismatches, 3-15
based storage, 4-7
compiler directives, 3-6
defined storage, 4-7
FMS usage, A-2
like attribute, 3-13
longmap attribute, 3-8
overlaying incompatible data types, 4-7
shortmap attribute, 3-8
structures as elements of other
structures, 3-12
type attribute, 3-13
VOS Standard C
accessing varying length parameter lists, 4-8
aligning dec 15 and dec 18
simulation, 3-20
alignment inheritance with, 3-11
alignment specifiers used with pointers, 3-7
FMS usage, A-2
longjmp function, 4-6
$longmap attribute usage, 3-6
malloc function, 11-5
#pragma compiler directive, 3-5
-qc argument, 2-7, 2-9, B-3
setjmp function, 4-6
$shortmap attribute usage, 3-6
W
where System Analysis request, B-10
who System Analysis request, B-7, B-8
Index-9
Index
Index-10