Exemplar C and Fortran 77 Programmer's Guide

Migrating to the Exemplar compilers

[ Previous Page ] [ Next Page ] [ Contents ]


Last modified on: Wednesday, January 22 1997 at 10:12am

This chapter provides transition information for users moving from the SPP1000-Series compilers (/usr/convex/bin/cc, /usr/convex/bin/fc) to the Exemplar compilers, which are based on the standard HP compilers. Options, directives, and pragmas available in the SPP1000-Series compilers are mapped to the equivalent features in the Exemplar compilers. In addition, this chapter lists the language extensions from the SPP1000-Series compilers that the Exemplar compilers support. Finally, this chapter covers changes in accessing CPSlib.


Compiler options

This section lists the compiler options from the SPP1000-Series compilers that are supported by the Exemplar compilers or are unimplemented.

In Table 7, the compiler options in the left column were available in the SPP1000-Series compilers (/usr/convex/bin/cc, /usr/convex/bin/fc). The middle column lists corresponding or similar options in the Exemplar compilers or states that the option is unimplemented. The right column points to additional information on the Exemplar compiler options.

NOTE: Functionality may differ between corresponding options.

The following table does not list options (such as -o and -c) that are common across a number of compilers.

Table 7 Mapping of compiler options--(continued)

SPP1000-Series
compiler option*

Exemplar compiler option

For more information, see

-72

Default

-a1

unimplemented option

-alias addr

unimplemented option

-alias array_args

+Onoparmsoverlap

cc(1) man page

-alias cautious

unimplemented option

-alias global

+Optrs_to_globals

cc(1) man page

-alias no_addr

unimplemented option

-alias no_global

+Onoptrs_to_globals

cc(1) man page

-alias ptr_args

unimplemented option

-alias restrict_args

unimplemented option

-alias standard

+Optrs_strongly_typed

cc(1) man page

-alias worst

+Onoptrs_ansi

cc(1) man page

-align cache

unimplemented option

-align cache_check

unimplemented option

-align cseries

unimplemented option

-align cti

unimplemented option

-align spp

+A8 (Fortran only)

f77(1) man page

-ansi77

-A

f77(1) man page

-ansi90

unimplemented option

-blockloop n

unimplemented option

-br

unimplemented option

-cache n

unimplemented option

-cfc

Cray Fortran extensions are enabled by default

HP FORTRAN/9000 Programmer's Reference

-com

similar to -v

cc(1) man page,
f77(1) man page

-cs

-C

f77(1) man page

-ctifiles

unimplemented option

-cxdb

-g

Chapter 2,
"Exemplar extensions"

-cxpa

+pa

Chapter 2,
"Exemplar extensions"

-cxpab

unimplemented option

-cxpalib

unimplemented option

-cxpamon

unimplemented option

-cxpar

+pa

Chapter 2,
"Exemplar extensions"

-d name [={w|e}]

unimplemented option

-dc

-D

f77(1) man page

-ds

+Odynsel

Chapter 2,
"Exemplar extensions"

-errnames

unimplemented option

-ext

similar to -Ae

cc(1) man page

-extern distinct

unimplemented option

-extern same

Default

-F66

-w66

f77(1) man page

-fd

see +f and +r

cc(1) man page

-fl

+Oloop_transform

Chapter 1,
"Introduction"

-float dp_const

unimplemented option

-float sp_const

see +f and +r

cc(1) man page

-float dp_ops

unimplemented option

-float sp_ops

see +f and +r

cc(1) man page

-gs

+Osharedgra

Chapter 2,
"Exemplar extensions"

-i1

unimplemented option

-i2

-I2

f77(1) man page

-i4

-I4

f77(1) man page

-i8

-I8

Chapter 2,
"Exemplar extensions"

-il

unimplemented option

-ipo

+O4

Chapter 1,
"Introduction"

-is directory

unimplemented option

-LST

-L

f77(1) man page

-LSTI

unimplemented option

-mo

similar to +Onofltacc

cc(1) man page,
f77(1) man page

-mrl

similar to
+Onolimit +Onosize

cc(1) man page,
f77(1) man page

-na

unimplemented option

-nbr

unimplemented option

-nds

+Onodynsel

Chapter 2,
"Exemplar extensions"

-nfl

+Onoloop_transform

cc(1) man page,
f77(1) man page

-nga

unimplemented option

-ngr

unimplemented option

-ngs

+Onosharedgra

Chapter 2,
"Exemplar extensions"

-nmo

similar to +Ofltacc

cc(1) man page,
f77(1) man page

-no

+O0 (default)

Chapter 1,
"Introduction"

-noautopar

+Onoautopar

Chapter 2,
"Exemplar extensions"

-noblock

unimplemented option

-nof90

unimplemented option

-nonodepar

Default (Use +Onodepar to enable directive-specified, node-parallelism.)

Chapter 2,
"Exemplar extensions"

-nopeel

unimplemented option

-noptst

unimplemented option

-nore

unimplemented option

-nosc

unimplemented option

-noU77

Default (Use +U77 to get libU77 routines.)

f77(1) man page

-nptr

unimplemented option

-nsr

unimplemented option

-nuj

unimplemented option

-nur

+Onoloop_unroll

Chapter 1,
"Introduction"

-nv

Default is no report

-nw

-w

cc(1) man page,
f77(1) man page

-O (same as -O2)

-O (same as +02)

Chapter 1,
"Introduction"

-O0

unimplemented option

-O1

similar to +O2

Chapter 1,
"Introduction"

-02

similar to +O3

Chapter 1,
"Introduction"

-O3

similar to
+O3 +Oparallel

Chapter 2,
"Exemplar extensions"

-or table

+Oreport[=report_type]

Chapter 2,
"Exemplar extensions"

-p

-p (Using prof for multithreaded applications is not supported)

-p8

$AUTODBL DBL
source code directive

HP FORTRAN/9000 Programmer's Reference

-parens explicit

unimplemented option

-parens ignore

unimplemented option

-parens implicit

unimplemented option

-pcc

-Ac

cc(1) man page

-pd8

similar to -I8 with
$AUTODBL DBL DBL4
source code directive

HP FORTRAN/9000 Programmer's Reference, and
Chapter 2,
"Exemplar extensions"

-peel

unimplemented option

-peelall

unimplemented option

-pg

-G (Using gprof for multithreaded applications is not supported)

-pl n

$LINES n
source code directive

HP FORTRAN/9000 Programmer's Reference

-ppu

+ppu

f77(1) man page

-ptst

unimplemented option

-ptstall

unimplemented option

-pw n

unimplemented option

-r4

-R4

f77(1) man page

-r8

-R8

f77(1) man page

-re

unimplemented option

-sc

unimplemented option

-sfc

Sun Fortran extensions are enabled by default

HP FORTRAN/9000 Programmer's Reference

-sr

unimplemented option

-std

-Aa

cc(1) man page

-string read_only

+ESlit

cc(1) man page

-string write_only

Default

-tm target

+tm target

Chapter 2,
"Exemplar extensions"

-tri off

unimplemented option

-tri on

Default

-uj

unimplemented option

-ujn n

unimplemented option

-uo

unimplemented option

-ur

+Oloop_unroll

Chapter 1,
"Introduction"

-urn n

+Oloop_unroll=n

Chapter 1,
"Introduction"

-vfc

VAX Fortran extensions are enabled by default

HP FORTRAN/9000 Programmer's Reference

-vn

Use the what command on the executable (either /opt/ansic/bin/cc or /opt/fortran/bin/f77) to display version info for an Exemplar compiler

what(1) man page

-xr

+R

f77(1) man page

-xra

unimplemented option

*SPP1000-Series compiler refers to /usr/convex/bin/cc and /usr/convex/bin/fc


Directives and pragmas

This section lists the directives and pragmas from the SPP1000-Series compilers (/usr/convex/bin/cc and /usr/convex/bin/fc) that are supported by the Exemplar compilers or are unimplemented.

The forms of the directives and pragmas in the SPP1000-Series compilers are accepted by the Exemplar compilers.

The form of an SPP1000-Series Fortran compiler directive is:

C$DIR [CSERIES|SPP] directive-specification

The form of an SPP1000-Series C pragma is:

#pragma _CNX [CSERIES|SPP] directive-specification

If CSERIES is specified, the directive is discarded by the compiler. See the section "Exemplar compiler directives and pragmas" on page 23 for information on the recommended forms for the Exemplar compilers.

Table 8 lists the compiler directives and pragmas and states whether they exist in the Exemplar compilers. Words in italics indicate user-supplied information. For the directives and pragmas that are implemented, descriptions are given in Chapter 2. However, for more information on using the directives and pragmas, see the Exemplar Programming Guide.

Table 8 Compiler directives/pragmas--(continued)

Directive/pragma

Status

barrier(namelist)directive in Fortran
barrier_t typedef in C

Implemented*

begin_tasks[(attribute_list)]

Implemented*

block_loop[(block_factor=n)]

Implemented*

block_shared(allocatable_array_namelist)

Implemented*

critical_section[(gate_var)]

Implemented*

dynsel[(trip_count=n)]

Implemented*

end_ordered_section

Implemented*

end_tasks

Implemented*

far_shared(namelist) directive in Fortran
far_shared storage class specifier in C

Implemented*

gate(namelist) directive in Fortran
gate_t typedef in C

Implemented*

loop_parallel[(attribute_list)]

Implemented*

loop_private(namelist)

Implemented*

near_shared(namelist) directive in Fortran
near_shared storage class specifier in C

Implemented*

next_task

Implemented*

no_block_loop

Implemented*

no_distribute

Implemented*

no_dynsel

Implemented*

no_fuse

Unimplemented directive/pragma

no_loop_dependence(namelist)

Implemented*

no_parallel

Implemented*

no_peel

Unimplemented directive/pragma

no_promote_test

Unimplemented directive/pragma

no_side_effects(funclist)

Implemented*

no_unroll

Unimplemented directive/pragma

no_unroll_and_jam

Unimplemented directive/pragma

node_private(namelist) directive in Fortran
node_private storage class specifier in C

Implemented*

opt_level(level)

Similar to opt_level level_arg in C,
OPTIMIZE level_arg in Fortran**

ordered_section(gate_var)

Implemented*

peel

Unimplemented directive/pragma

peel_all

Unimplemented directive/pragma

prefer_fuse

Unimplemented directive/pragma

prefer_parallel[(attribute_list)]

Implemented*

promote_test

Unimplemented directive/pragma

promote_test_all

Unimplemented directive/pragma

row_wise

Unimplemented directive/pragma

save_last[(list)]

Implemented*

scalar

Implemented*

sync_routine(routinelist)

Implemented*

task_private(namelist)

Implemented*

thread_private(namelist)directive in Fortran
thread_private storage class specifier in C

Implemented*

unroll[(unroll_factor=n)]

Unimplemented directive/pragma

unroll_and_jam[(unroll_factor=n)]

Unimplemented directive/pragma

* For more information on implemented directives and pragmas, see Chapter 2, "Exemplar extensions" or the Exemplar Programming Guide.** For more information on the opt_level pragma and the OPTIMIZE directive, see the Exemplar Programming Guide.


Fortran 77 language extensions

This section lists the Fortran 77 language extensions from the SPP1000-Series Fortran compiler (/usr/convex/bin/fc) that are supported by the Exemplar Fortran compiler or are unimplemented.

Table 9 lists the extensions that are supported in the Exemplar Fortran 77 compiler. Because some of these extensions are available in the standard HP Fortran compiler, the functionality and syntax may differ slightly from the SPP1000-Series Fortran compiler. Unless noted otherwise, see the HP FORTRAN/9000 Programmer's Reference for information on using these extensions.

Table 9 Fortran 77 language extensions--(continued)

Extension

Status

$ edit descriptor

Implemented

* edit descriptor

Implemented

%REF

Implemented

%VAL

Implemented

.XOR.

Implemented

ACCEPT

Implemented

ALLOCATABLE

This statement is implemented but has a different syntax.

/usr/convex/bin/fc required parentheses:
INTEGER*8 A(:)
ALLOCATABLE (A)

f77 does not allow parentheses:
INTEGER*8 A(:)
ALLOCATABLE A

Implemented

ALLOCATE

Implemented

AUTOMATIC

Implemented

BLOCKSIZE keyword

Implemented

BUFFERIN

Unimplemented extension

BUFFEROUT

Unimplemented extension

CARRIAGECONTROL keyword

Implemented

COMPLEX*8

Implemented

COMPLEX*16

Implemented

DEFAULTFILE keyword

Unimplemented extension

DECODE

Implemented

DISPOSE keyword

Unimplemented extension

DO WHILE

Implemented

DOUBLE COMPLEX

Implemented

ENCODE

Implemented

END DO

Implemented

FIND

Unimplemented extension

IMPLICIT NONE

Implemented

INCLUDE

Implemented

INTEGER*1

Unimplemented extension

INTEGER*2

Implemented

INTEGER*4

Implemented

INTEGER*8 (See the section "INTEGER*8" on page 38)

Implemented

IOSTAT keyword

Implemented

LOC

Implemented

LOGICAL*1

Implemented

LOGICAL*2

Implemented

LOGICAL*4

Implemented

LOGICAL*8 (See the section "LOGICAL*8" on page 38)

Implemented

MAXREC keyword

Unimplemented extension

NAME keyword

Implemented

NAMELIST

Implemented

NOSPANBLOCKS keyword

Unimplemented extension

O edit descriptor

Unimplemented extension

PARAMETER (FORTRAN 66/VAX version)

Implemented

POINTER

Implemented

Q edit descriptor

Implemented

R edit descriptor

Unimplemented extension

READONLY keyword

Implemented

REAL*4

Implemented

REAL*8

Implemented

REAL*16

Implemented

RECORD type

Implemented

RECORDSIZE keyword

Unimplemented extension

RECORDTYPE keyword

Unimplemented extension

TASK COMMON (See the section "TASK COMMON" on page 39)

Implemented

STATIC

Implemented

TYPE keyword

Implemented

TYPE statement

Implemented

Binary data file format conversions

Unimplemented extension

Extended-range DO loops

Implemented

Fortran 90 array notation

Implemented

Hex constants

Implemented

Hollerith constants

Implemented

Integers in logical expressions

Unimplemented extension

List-directed sequential internal I/O

Implemented

Namelist-directed sequential external I/O

Implemented

Octal constants

Implemented

User-defined conversions

Unimplemented extension

Z edit descriptor

Unimplemented extension


Enabling node-parallelism

In the SPP1000-Series compilers (/usr/convex/bin/cc, /usr/convex/bin/fc), node-level parallelism (which is indicated using directives or pragmas) is enabled by default. However, in the Exemplar compilers, loop, task, and region node-parallelism is disabled by default. In other words, +Ononodepar is the default.

The +Ononodepar option causes the compiler to generate code for a single-node machine. When this option is used, serial code is generated for node-parallel constructs; thus, node-parallelism is not implemented. Thread-parallelism--both automatic and directive-specified--is still implemented.

Use the +Onodepar option to enable directive-specified node-parallelism when compiling with +Oparallel at +O3 or +O4.

The +O[no]nodepar option is only meaningful when specified with the +Oparallel option at +O3 or +O4. See the section "+O[no]nodepar" on page 19 for more information.


Accessing CPSlib

CPSlib is the Compiler Parallel Support library--a library of low-level parallelization and synchronization routines. In the SPP1000-Series compilers (/usr/convex/bin/cc, /usr/convex/bin/fc), CPSlib is automatically linked in at every optimization level. However, in the Exemplar compilers, CPSlib is automatically linked in only at +O3 (and above) when +Oparallel is specified.

If your program explicitly calls CPSlib routines or calls other libraries that use CPS routines and you are not linking at +O3 (or +O4) with +Oparallel, you must explicitly link in CPSlib as shown in the following example.

Assume prog.c contains calls to CPSlib routines:

% cc -lpthread -lcps -lpthread -lail prog.c

Linking in CPSlib requires specifying--in the order given--all of the string -lpthread -lcps -lpthread -lail.

See the Exemplar Programming Guide for more information on CPSlib routines.


[ Previous Page ] [ Next Page ] [ Contents ]