[Digital logo]
[HR]

Migrating an Application from OpenVMS VAX to OpenVMS Alpha


Previous | Contents

2.6 Identifying Incompatibilities Between VAX and Alpha Systems

To identify architectural incompatibilities in a module of your application, start by doing a test compile of the module using the Alpha compiler. For information on diagnostic compiler switches, see your language processor documentation.

Many modules will compile and run with no errors. If errors occur, you may have to revise the module.

The DEC compilers can produce messages that are very useful for identifying potential porting problems. For example, the MACRO--32 compiler provides the /FLAG qualifier with 10 options. Depending on which options you include, the compiler reports all unaligned stack and memory references, any run-time code generation (such as self-modifying code), branches between routines, or several other conditions.

The DEC Fortran compiler qualifier, /CHECK, produces messages about any of the various options you specify.


Note

Even if a module runs without error in isolation, there may be latent synchronization problems that will turn up only when the module is run together with other parts of the application.

If a module does not run without error after being recompiled and relinked, you can use the following methods to assess what must be revised to make the program run well on an Alpha system:

Once all the images of the application run without errors on an Alpha system, you must combine the rebuilt images to test for problems of synchronization between images. For more information on testing, see Section 3.3.3.

2.7 Deciding Whether to Recompile or Translate

If both methods are possible for a given image, you must balance the projected performance of native and translated versions of the image on an Alpha system against the effort required to translate the image or to convert it to a native Alpha image.

In general, different images that make up an application can be run in different modes: for example, a native Alpha image can call translated shareable images and vice versa. For more information on mixed-architecture applications, see Section 2.7.2.

The two migration paths are compared in Table 2-2.

Table 2-2 Migration Path Comparison
Factor Recompile/Relink Translate
Performance Full Alpha capability Typically 25-40% of native Alpha potential; equivalent to performance on VAX
Effort required Varies: easy to difficult Easy
Schedule constraints Based on availability of native compilers None: available immediately
Programs supported
--Age Source for VAX/VMS Version 4.0 or earlier accepted Only VAX/VMS Version 4.0 or later supported
--Limitations Privileged code supported Only user-mode code supported
VAX compatibility High: most code will recompile and relink without difficulty Complete by emulation
Ongoing support and maintenance Normal source code maintenance Maintain source code on VAX; recompile and retranslate for each new version

To determine how to proceed with the migration of your application, answer the following questions:

You can remove architectural dependencies in several ways:

Table 2-3 summarizes how the architectural dependencies of a given program can affect which method you use to migrate the program to an Alpha system. For more detailed information, see the following chapters.

Table 2-3 Choice of Migration Method: Dealing with Architectural Dependencies
Recompiled, Relinked VAX Source Translated VAX Image
Data alignment¹
By default, most compilers align data naturally. For information on qualifiers to retain VAX alignment, see Chapter 11. Unaligned data supported, but the qualifier /OPTIMIZE=ALIGNMENT can improve overall execution speed by assuming that data is longword aligned.
Data types
Replace H_floating with X_floating.

For D_floating, if the 15 decimal digits of precision provided by the D53 format are sufficient, replace D_floating with G_floating. If the application requires 16-bit decimal precision (D56 format), translate it.

COBOL packed decimal is automatically converted to binary format for operations.

For more information on data types, see Chapter 7.

To retain 16-bit decimal precision for D_floating, use the /FLOAT=D56_FLOAT qualifier. Performance using this qualifier will be slower than when using the default, /FLOAT=D53_FLOAT.
Atomicity of read-modify-write operations
Support depends on options provided by the individual compiler. (For more information, see Chapter 6.) Use the /PRESERVE=INSTRUCTION_ATOMICITY qualifier. Execution speed may drop by a factor of 2.
Atomicity and granularity of byte and word write operations
Supported using compiler options with appropriate source code changes. (For more information, see Chapter 6.) Use the /PRESERVE=MEMORY_ATOMICITY qualifier. Execution speed may drop by a factor of 2.
Page size
The OpenVMS Linker produces large, Alpha style pages by default. Most 512-byte page images are supported. However, because of the permissive protection assigned by VEST, images that rely on restrictive protection to generate access violations will not execute properly on an Alpha system when translated.
Read/write ordering
Supported by adding appropriate synchronization instructions (MB) to source code, but with a performance penalty. (For more information, see Chapter 6.) Use the /PRESERVE=READ_WRITE_ORDERING qualifier.
Immediacy of exception reporting
Partly supported using compiler options. (For more information, see Chapter 8.) Use the /PRESERVE=FLOAT_EXCEPTIONS or the /PRESERVE=INTEGER_EXCEPTIONS qualifier. Execution speed may drop by a factor of 2.
Explicit reliance on details of the VAX architecture and calling standard²
Unsupported; dependencies must be removed. Supported.


¹Unaligned data is primarily a performance issue. Whereas references to unaligned data were only somewhat detrimental to VAX performance, loading unaligned data from memory and storing unaligned data to memory in an Alpha system can be up to 100 times slower than the corresponding aligned operations.
²Dependencies on details of the VAX architecture and calling standard include explicit reliance on the VAX calling standard, VAX exception handling, the VAX AST parameter list, the format and behavior of VAX instructions, and the generation of VAX instructions at run time.

2.7.1 Translating Your Application

If you are unable to recompile your application, or if it uses features specific to the VAX architecture, you may decide to translate the application. You can choose to translate only some parts of the application, or you can translate parts of it temporarily as a means of staging the overall migration.

Many of the differences that affect recompilation discussed in Section 2.4 can also affect the performance of a translated VAX image. You can use the following methods to increase the compatibility of images that are dependent on the VAX architecture. (For more information, see DECmigrate for OpenVMS AXP Systems Translating Images.)

Table 2-3 includes a summary of ways you can allow for various architectural dependencies in a translated image.

2.7.2 Combining Native and Translated Images

In general, you can combine native Alpha images with translated images on an Alpha system. For example, a native Alpha image can call translated shareable images and vice versa.

In order to run together, native and translated images must be able to make calls between the VAX and Alpha calling standards. No special action is required if the native and translated images meet the following conditions:

When a source procedure that uses one calling standard calls a destination procedure that uses a different calling standard, it does so indirectly through a jacket routine. The jacket routine interprets the procedure's call frame and argument list and builds the equivalent destination call frame and argument list, then transfers control to the destination procedure. When the destination procedure returns, it does so through the jacket routine. The jacket routine propagates the destination routine's returned register values into the source routine's registers and returns control to the source procedure.

The OpenVMS Alpha operating system creates jacket routines automatically for most calls. To make use of automatic jacketing, use the compiler qualifier /TIE and the linker option /NONATIVE_ONLY to create the native Alpha parts of your application.

In certain cases, the application program must use a specially written jacket routine. For example, you may have to write jacket routines for nonstandard calls to libraries such as the following:

For information on how to create a jacket image for one of these situations, see DECmigrate for OpenVMS AXP Systems Translating Images.

Translated shareable images (such as run-time libraries for languages without native Alpha compilers) that are shipped with the OpenVMS Alpha operating system are accompanied by jacket routines that allow them to be called by native Alpha images.


Chapter 3
Migrating Your Application

Actually migrating your application to an Alpha system involves several steps:

  1. Setting up the migration environment
  2. Testing the application on a VAX system to establish baselines for evaluating the migration
  3. Converting the application to run on an Alpha system
  4. Debugging and testing the migrated application
  5. Integrating the migrated application into a software system

3.1 Setting Up the Migration Environment

The native Alpha environment is a complete development environment equivalent to that on VAX systems.

At present, you will have to complete the debugging and testing of your migrated application on Alpha hardware.

An important element of the Alpha migration environment is support from Digital, which can provide help in modifying, debugging, and testing your application.

3.1.1 Hardware

There are several issues to consider when planning what hardware you will need for your migration. To begin, consider what resources are required in your normal VAX development environment:

To estimate the resources needed for an Alpha migration environment, consider the following issues:

Using VEST tends to take a lot of CPU time. (It is difficult to predict how much; it depends more on application complexity than size.) VEST also needs a great deal of disk space for log files, for an Alpha image if you request one, for flowgraphs, and so on. The new image includes both the original VAX instructions and the new Alpha instructions, so it is always larger than the VAX image.

A suggested configuration consists of:

In a multiprocessing system, each processor should be able to support the image analysis of a separate application.

If computer resources are scarce, Digital suggests that you do one or more of the following:

3.1.2 Software

To create an efficient migration environment, check the following elements:

Native Alpha Development

All of the standard development tools you have on VAX are also available as native tools on Alpha systems.

Translation

The software translator VEST runs on both VAX and Alpha systems. The Translated Image Environment (TIE), which is required to run a translated image, is part of OpenVMS Alpha, so final testing of a translated image must either be done on an Alpha system or at an Alpha Migration Center.

3.2 Converting Your Application

If you have thoroughly analyzed your code and planned the migration process, this final stage should be fairly straightforward. You may be able to recompile or translate many programs with no change. Programs that do not recompile or translate directly will frequently need only straightforward changes to get them up on an Alpha system.

For more detailed information on the actual conversion of your code, see the following OpenVMS Alpha migration documentation:

For descriptions of these books, see the Preface of this manual.

The two migration environments and the principal tools used in each are shown in Figure 3-1.

Figure 3-1 Migration Environments and Tools



3.2.1 Recompiling and Relinking

In general, migrating your application involves repeated cycles of revising, compiling, linking, and debugging your code. During the process, you will resolve all syntax and logic errors noted by the development tools. Syntax errors are usually simple to fix; logic errors typically require significant modifications to your code.

Your compile and link commands will require some changes, such as new compiler and linker switches. For example, to allow portability among different Alpha platforms, the linker default page size for Alpha systems is 64 KB, which allows any OpenVMS Alpha image to run on any Alpha processor, regardless of the system page size on that processor. Also, Alpha shareable images declare their universal entry points and symbols by means of a symbol vector declaration in a linker options file, not by means of the VAX transfer vector mechanism.


Previous | Next | Contents | [Home] | [Comments] | [Ordering info] | [Help]

[HR]

  6459P003.HTM
  OSSG Documentation
  22-NOV-1996 13:07:07.11

Copyright © Digital Equipment Corporation 1996. All Rights Reserved.

Legal