Vax C90-EL SERIES Manuel de service

Naviguer en ligne ou télécharger Manuel de service pour Aspirateurs Vax C90-EL SERIES. Vax C90-EL SERIES Technical data Manuel d'utilisatio

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 216
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs

Résumé du contenu

Page 1 - Cray Standard C/C++ Reference

Cray Standard C/C++ ReferenceManualS–2179–36

Page 2

Cray Standard C/C++ Reference ManualPage-F (CC, cc) ... 29-h listing (CC, cc) ... 29Debugging Options . . . .

Page 3 - New Features

Cray Standard C/C++ Reference Manualto determine their tasking context. The tasking context for these variablescannot be changed.Note: Variables defau

Page 4

#pragma Directives [3]For tasked loops, array variables that are sequentially indexed by the loop controlvariable and modified inside the loop are oft

Page 5 - Record of Revision

Cray Standard C/C++ Reference Manualand can cause loops inside and outside parallel regions to not vectorize. Avoidshared stack variables, where possi

Page 6

#pragma Directives [3]For all work distribution arguments except single, each chunk of iterations canbe vectorized, subject to the normal rules for ve

Page 7

Cray Standard C/C++ Reference Manualfollowing is an example of a guided distributionthat assumes 8 processors and 1000 iterations:125 110 96 84 74 64

Page 8

#pragma Directives [3]when used in conjunction with the vector orchunksize arguments) will be performed by themaster processor after all the other ite

Page 9 - S–2179–36 v

Cray Standard C/C++ Reference Manual#pragma _CRI nostreamThe following example illustrates the use of the nostream directive:#pragma _CRI nostreamfor

Page 10

#pragma Directives [3]3.10.1 align Directive (UNICOS Systems)The align directive causes functions, loops, or labels to be aligned on instructionbuffer

Page 11 - Directives [3] 45

Cray Standard C/C++ Reference Manualinstruction buffers, no additional instruction buffer fetches will be necessarywhile the function executes.The cod

Page 12

#pragma Directives [3]loops in addition to those automatically aligned by the compiler. In these cases,you must use the align directive.The align dire

Page 13 - Cray Standard C++ [4] 103

ContentsPageLoader Options . . . . . . . . . . . . . . . . . . . . . . . . . 38-d string (CC, cc)... 38-l libfile (CC, cc, c89) .

Page 14 - Predefined Macros [7] 117

Cray Standard C/C++ Reference Manualvoid fctn(void){int i;#pragma _CRI alignfor (i = 0; i < 100; i++) /* This loop will be aligned. */{...}i=0;#pra

Page 15 - S–2179–36 xi

#pragma Directives [3]E registers offer fine-grained access to local memory and a higher bandwidth forsparse index array accesses such as gather/scatt

Page 16

Cray Standard C/C++ Reference Manual/* References of arrays a, b and c bypass cache.References to ix and d go through cache. */void indirect(double a[

Page 17 - S–2179–36 xiii

#pragma Directives [3]n An integer constant between 1 and 63, specifying that nodependencies exist between any iteration of the loop and nsubsequent i

Page 18 - Related Publications

Cray Standard C/C++ Reference ManualThe noreduction compiler directive tells the compiler to not optimize the loopthat immediately follows the directi

Page 19 - Conventions

#pragma Directives [3]by splitting an inner loop into a set of smaller loops, each of which allocates nomore than six stream buffers, thus avoiding st

Page 20 - Reader Comments

Cray Standard C/C++ Reference Manualfor (i = 0; i < 1000; i++) {a[i] = b[i] * c[i];ta[i] = d[i] + a[i];}for (i=0; i<1000; i++) {e[i] = f[i] * ta

Page 21 - Introduction [1]

#pragma Directives [3]from memory at the first reference following the directive. The local suppressdirective has the following format:#pragma _CRI su

Page 22 - 2 S–2179–36

Cray Standard C/C++ Reference Manualdeclared in that block will be squandered. Neither of these conditions aredetected by the compiler.3.10.10 unroll

Page 23 - Compiler Commands [2]

#pragma Directives [3]line option is specified. On UNICOS systems, the compiler may do additionalunrolling over the amount requested by the user.In th

Page 24 - 2.2 cc Command

Cray Standard C/C++ Reference ManualPagenopattern Directive . . . . . . . . . . . . . . . . . . . . . . 59novector Directive . . . . . . . . . . . . .

Page 25 - S–2179–36 5

Cray Standard C/C++ Reference Manual/* directive will cause incorrect code due to dependencies! */#pragma _CRI unroll 2for (i = 0; i < 10; i++) {fo

Page 26 - 2.3 Command Line Options

#pragma Directives [3]3.11.1 inline DirectiveThe inline directive specifies functions that are to be inlined. The inlinedirective has the following fo

Page 27 - S–2179–36 7

Cray Standard C/C++ Reference Manual#include <stdio.h>int f(int a) {return a*a;}#pragma _CRI noinline f /* Direct the compiler not to *//* inlin

Page 28 - 8 S–2179–36

Cray Standard C++ [4]The Cray Standard C++ compiler together with the Dinkum C++ Librariessupport the C++98 standard (ISO/IEC FDIS 14882) and continue

Page 29 - S–2179–36 9

Cray Standard C/C++ Reference ManualAdministration Guide for more information about the CrayDoc documentationsystem.If you have any questions about th

Page 30 - 10 S–2179–36

Cray Standard C Extensions [5]This chapter describes the Cray Standard C extensions to standard C. A programthat uses one or more extensions does not

Page 31

Cray Standard C/C++ Reference Manual5.2 fortran KeywordNote: The fortran keyword is not allowed in Cray Standard C++.In extended mode, the identifier

Page 32 - 2.5 Template Language Options

Cray Standard C Extensions [5]0x7f7fffff.f 32-bit float0x0123456789012345. 64-bit doubleThe value of a hexadecimal floating constant is interpreted as

Page 34 - 2.7 General Language Options

Cray Standard C++ Template Instantiation [6]A template describes a class or function that is a model for a family of relatedclasses or functions. The

Page 35 - S–2179–36 15

ContentsPage#pragma preferstream Directive (Cray SV1 series Systems Only) . . . . . . . . 86Scalar Directives . . . . . . . . . . . . . . . . . . . .

Page 36 - 16 S–2179–36

Cray Standard C/C++ Reference Manualinstantiation of template entities until all source files of the complete programhave been read.The Cray Standard

Page 37 - S–2179–36 17

Cray Standard C++ Template Instantiation [6]created, if one does not already exist (for example, the compilation of abc.Cresults in the creation of ab

Page 38 - 18 S–2179–36

Cray Standard C/C++ Reference Manualof -h prelink_copy_if_nonlocal (see Section 2.5.8, page 13) will work as ifyou created a library (.a) that is shar

Page 39 - S–2179–36 19

Cray Standard C++ Template Instantiation [6]Automatic instantiation can coexist with partial explicit control ofinstantiation by the programmer throug

Page 40 - 20 S–2179–36

Cray Standard C/C++ Reference ManualIn the case where the CC(1) command is given a single source file to compile andlink, all instantiations are done

Page 41 - S–2179–36 21

Cray Standard C++ Template Instantiation [6]• A member function name. For example: A<int>::f• A static data member name. For example: A<int&g

Page 42 - 22 S–2179–36

Cray Standard C/C++ Reference ManualIn the preceding example, f1(double) and g1(double) are not instantiatedbecause no bodies are supplied, but no err

Page 43 - S–2179–36 23

Predefined Macros [7]Predefined macros can be divided into the following categories:• Macros required by the C and C++ standards• Macros based on the

Page 44 - 24 S–2179–36

Cray Standard C/C++ Reference Manualrequired by the ISO C++ standard, but not theISO C standard.7.2 Macros Based on the Host MachineThe following macr

Page 45 - S–2179–36 25

Predefined Macros [7]_CRAYMPP Defined as 1 on all UNICOS/mk systems. If thehardware is any other machine type, the macrois not defined._CRAYSV1 Define

Page 46 - 2.15 Math Options

Cray Standard C/C++ Reference ManualPageImplicit Inclusion . . . . . . . . . . . . . . . . . . . . . . . . 116Predefined Macros [7] 117Macros Required

Page 48 - 2.16 Analysis Tool Options

Debugging Cray Standard C/C++ Code [8]The Cray TotalView symbolic debugger is available to help you debug C and C++codes. In addition, the Cray Standa

Page 49 - 2.17 Debugging Options

Cray Standard C/C++ Reference Manual• Edit values of variables and memory locations• Evaluate code fragments8.2 Compiler Debugging OptionsTo use the C

Page 50 - 2.18 Compiler Message Options

Interlanguage Communication [9]In some situations, it is necessary or advantageous to make calls to assemblyor Fortran functions from C or C++ program

Page 51 - S–2179–36 31

Cray Standard C/C++ Reference Manual• Structures and unions that are declared identically in C and C++. In orderfor structures and unions to be shared

Page 52 - 32 S–2179–36

Interlanguage Communication [9]The output from the execution of the calling sequence illustrated in the precedingexample is as follows:Start C++ mainC

Page 53 - S–2179–36 33

Cray Standard C/C++ Reference Manual9.3 Calling Fortran Functions and Subroutines from a C or C++ FunctionThis subsection describes the following aspe

Page 54 - 34 S–2179–36

Interlanguage Communication [9]9.3.2 Argument PassingBecause Fortran subroutines expect arguments to be passed by pointers ratherthan by value, C and

Page 55 - 2.20 Preprocessing Options

Cray Standard C/C++ Reference Manualwhich they are declared and referenced in Fortran. Arrays are zero-based in Cand C++ and are one-based in Fortran,

Page 56 - 36 S–2179–36

Interlanguage Communication [9]_fcdlen Conversion utility that extracts the byte lengthfrom the Fortran character descriptor. BecauseFortran does not

Page 57 - S–2179–36 37

ContentsPageIdentifiers . . . . . . . . . . . . . . . . . . . . . . . . . 142Types . . . . . . . . . . . . . . . . . . . . . . . . . . 142Characters .

Page 58 - 2.21 Loader Options

Cray Standard C/C++ Reference Manual#include <stdio.h>struct{int i;double a[10];long double d;} ST;main(){int i;/* initialize struct ST */ST.i =

Page 59 - S–2179–36 39

Interlanguage Communication [9]INTEGER IWRITE(6,100) STI, STD100 FORMAT (’IN FORTRAN: STI = ’, I5, ’, STD = ’, D25.20)WRITE(6,200) (STA(I), I = 1,10)2

Page 60 - 2.22 Miscellaneous Options

Cray Standard C/C++ Reference Manual#include <stdio.h>struct st{float a;float b[10];} *ST;#ifdef __cplusplusextern "C" struct st *MYCO

Page 61

Interlanguage Communication [9]SUBROUTINE FCTNCOMMON // STA,STB(10)PRINT *, "IN FORTRAN"PRINT *, " STA = ",STAPRINT *, " STB

Page 62 - 2.23 Command Line Examples

Cray Standard C/C++ Reference Manual/* C program (main.c): */#include <stdio.h>#include <string.h>#include <fortran.h>fortran double

Page 63 - 2.24 Environment Variables

Interlanguage Communication [9]C Fortran subprogram (ftnfctn.f):FUNCTION FTNFCTN(STR, LOG)REAL FTNFCTNCHARACTER*(*) STRLOGICAL LOGCOMMON /FLOAT1/FLOAT

Page 64 - 44 S–2179–36

Cray Standard C/C++ Reference Manual$ cc -c main.c$ ftn -c ftnfctn.f$ segldr main.o ftnfctn.o$ a.out$In main: FLOAT1 = 1.6; FLOAT2 = 2.4Calling FTNFCT

Page 65 - #pragma Directives [3]

Interlanguage Communication [9]The Fortran program that is called from the Cray Standard C++ main function inthe preceding example is as follows:INTEG

Page 66 - 3.3 Loop Directives

Cray Standard C/C++ Reference ManualC Fortran program (main.f):PROGRAM MAINREAL CFCTNCOMMON /FLOAT1/FLOAT1COMMON /FLOAT2/FLOAT2REAL FLOAT1, FLOAT2DATA

Page 67

Interlanguage Communication [9]/* C function (cfctn.c): */#include <fortran.h>#include <stdio.h>#include <stdlib.h>#include <stri

Page 68 - 3.5 General Directives

Cray Standard C/C++ Reference ManualPageAppendix C Compiler Messages 173Expanding Messages with the explain(1) Command . . . . . . . . . . . . . 173Co

Page 69

Cray Standard C/C++ Reference Manual$ cc -c cfctn.c$ ftn -c main.f$ ftn cfctn.o main.o$ a.out$IN MAIN: FLOAT1 = 1.6; FLOAT2 = 2.4CALLING CFCTN WITH AR

Page 70

Implementation-defined Behavior [10]This chapter describes compiler behavior that is defined by the implementationaccording to the C and/or C++ standa

Page 71

Cray Standard C/C++ Reference Manual10.1.2.1 IdentifiersThe identifier (as defined by the standards) is merely a sequence of letters anddigits. Specif

Page 72

Implementation-defined Behavior [10]UNICOS UNICOS/mkType Representation (bits) Memory (bits)Representation(bits) Memory (bits)long 64 64 64 64long lon

Page 73

Cray Standard C/C++ Reference Manualcharacter constant can contain up to 8 characters. The integer value of a characterconstant is the value of the ch

Page 74

Implementation-defined Behavior [10]10.1.2.5 IntegersAll integral values are represented in a twos complement format. Forrepresentation and memory sto

Page 75 - S–2179–36 55

Cray Standard C/C++ Reference Manual10.1.2.6.1 Cray floating-point RepresentationTypes float and double represent Cray single-precision (64-bit) float

Page 76

Implementation-defined Behavior [10]Digits beyond these precisions may not be accurate. It is safest to assume only14 or 28 decimal places of accuracy

Page 77 - 3.7 Vectorization Directives

Cray Standard C/C++ Reference ManualFor exact values, use the macros defined in the header file, float.h(3c).Rounding of 32 and 64 bit floating-point

Page 78

Implementation-defined Behavior [10]Pointers on UNICOS systems differ from pointers on UNICOS/mk systems. Thesections that follow describe pointer imp

Page 79

PrefaceThis publication describes the Standard C and C++ languages as implemented bythe Cray Standard C 6.6 release and the Cray Standard C++ 3.6 rele

Page 80

Cray Standard C/C++ Reference Manual10.1.2.8 RegistersUse of the register storage class in the declaration of an object has no effecton whether the ob

Page 81

Implementation-defined Behavior [10]10.1.2.12 StatementsThe compiler has no fixed limit on the maximum number of case values allowedin a switch statem

Page 82 - 3.8 Tasking Directives

Cray Standard C/C++ Reference ManualThe macros __DATE__ and __TIME__ contain the date and time of the beginningof translation. For more information, s

Page 83 - S–2179–36 63

Libraries and Loaders [A]This appendix describes the libraries that are available with the Cray StandardC/C++ Programming Environment and the loaders,

Page 84 - 64 S–2179–36

Cray Standard C/C++ Reference ManualBecause of the special code needed to handle templates, constructors, destructors,and other C++ language features,

Page 85 - S–2179–36 65

Libraries and Loaders [A]was designed specifically for use with UNICOS/mk systems, it offers severaladvantages. You can control cld(1) operations with

Page 87 - S–2179–36 67

Cray Standard C/C++ Dialects [B]This appendix details the features of the C and C++ languages that are acceptedby the Cray Standard C/C++ compilers, i

Page 88

Cray Standard C/C++ Reference Manual• The precedence of the third operand of the ? operator is changed.• If control reaches the end of the main() rout

Page 89

Cray Standard C/C++ Dialects [B]• Definition of a nested class outside its enclosing class is allowed.• mutable is accepted on nonstatic data member d

Page 90 - 70 S–2179–36

Cray Standard C/C++ Reference Manual• Appendix B, page 157, which contains information on the Cray StandardC/C++ dialects.• Appendix C, page 173, whic

Page 91

Cray Standard C/C++ Reference Manual• Explicit specification of function template arguments is supported.• Unnamed template parameters are supported.•

Page 92

Cray Standard C/C++ Dialects [B]• extern inline functions are not supported.• Covariant return types on overriding virtual functions are not supported

Page 93

Cray Standard C/C++ Reference Manualwhen checking for compatibility, therefore, the following statements declarethe overloading of two functions named

Page 94

Cray Standard C/C++ Dialects [B]struct A { };struct B : public A {B& operator=(A&);};By default, as well as in cfront-compatibility mode, ther

Page 95

Cray Standard C/C++ Reference Manual• enum tags can be incomplete as long as the tag name is defined and resolvedby specifying the brace-enclosed list

Page 96

Cray Standard C/C++ Dialects [B]to const int **). Comparisons and pointer difference of such pairs ofpointer types are also allowed.• In operations on

Page 97

Cray Standard C/C++ Reference Manualthe object and the function pointed to will not modify the object. The oppositeassignment would not be safe.• Conv

Page 98

Cray Standard C/C++ Dialects [B]struct A {void f(int);static void sf(int);typedef void A::T3(int); // nonstd typedef decltypedef void T2(int); // std

Page 99

Cray Standard C/C++ Reference Manualclass A {~A();};class B : public A {~B();};B::~B(){} // Error except in cfront mode• When disambiguation requires

Page 100 - 80 S–2179–36

Cray Standard C/C++ Dialects [B]• No warning is issued on duplicate size and sign specifiers, as shown in thefollowing example:short short int i; // N

Page 101 - S–2179–36 81

PrefaceOrdering DocumentationTo order software documentation, contact the Cray Software Distribution Centerin any of the following ways:E-mail:orderds

Page 102 - 82 S–2179–36

Cray Standard C/C++ Reference Manualin normal mode. In practice, this is not much of a problem, since classes thatallow bitwise copying usually do not

Page 103 - S–2179–36 83

Cray Standard C/C++ Dialects [B]• An uninitialized const object of non-POD class type is allowed even if itsdefault constructor is implicitly declared

Page 105 - S–2179–36 85

Compiler Messages [C]This appendix describes how to use the message system to control and usemessages issued by the compiler. Explanatory texts for me

Page 106 - 3.10 Scalar Directives

Cray Standard C/C++ Reference ManualC.2 Controlling the Use of MessagesThe following sections summarize the command line options that affect theissuin

Page 107 - S–2179–36 87

Compiler Messages [C]script, any message printed by the compiler appears as though it was generatedby the script. For example, the following C shell s

Page 108 - 88 S–2179–36

Cray Standard C/C++ Reference ManualWARNING Probable user error. Indicates that the programwill probably abort or behave unpredictably.ERROR Fatal err

Page 109 - S–2179–36 89

Compiler Messages [C]An operand range error occurs when a program attempts to load or store inan area of memory that is not part of the user’s area. T

Page 111 - S–2179–36 91

Intrinsic Functions [D]The C and C++ intrinsic functions either allow for direct access to some hardwareinstructions or result in generation of inline

Page 112 - 92 S–2179–36

© 1996-2002 Cray Inc. All Rights Reserved. This manual or parts thereof may not be reproduced in any form unless permitted bycontract or by written pe

Page 113

Cray Standard C/C++ Reference Manualuser input This bold, fixed-space font denotes literal itemsthat the user enters in interactive sessions. Outputis

Page 114

Cray Standard C/C++ Reference ManualTable 9. Summary of C and C++ Intrinsic FunctionsFunctionUNICOS systems UNICOS/mk systems_argcount1XX_cmrX_dshiftl

Page 115

Intrinsic Functions [D]FunctionUNICOS systems UNICOS/mk systems_popparXX_ranfXX_readSBX_readSRX_readSTX_remote_write_barrierX_rtcXX_semclrX_semgetX_se

Page 117 - S–2179–36 97

Index-#,33-##,33-###,33Aalignfunction alignment, 87align directive, 87loop alignment, 88AnachronismsC++, 161analysis tools-h listing,29_argcount, 180A

Page 118 - 98 S–2179–36

Cray Standard C/C++ Reference Manualcompiler version, 40conflicting with directives, 8conflicting with other options, 8-D macro[=def], 35-d string opt

Page 119

Indexremove macro definition, 38-s option, 40-S option, 3, 33-U macro option, 38-V option, 40-W option, 33-X npes option, 41-Y option, 34Command line

Page 120 - 3.11 Inlining Directives

Cray Standard C/C++ Reference ManualCray SV1 systems, 85Cray TotalView debugger, 121CRAYOLDCPPLIB,43CRI_c89_OPTIONS,44CRI_cc_OPTIONS,44CRI_CC_OPTIONS,

Page 121

Indexsplit,94suppress,96symmetric,97taskcommon,76taskloop,70taskprivate,75taskshared,76unroll,98usage, 45uses_eregs,54vfunction,56protecting, 46scalar

Page 122

Cray Standard C/C++ Reference ManualF_fcdlen conversion utility, 129_fcdtocp conversion utility, 128FeaturesC++, 157cfront compatibility, 157filesa.ou

Page 123 - Cray Standard C++ [4]

Index-h instantiation_dir,12–h interchange,23-h intrinsics,17-h ivdep,19-h jump,26-h keep=file,14-h listing,29-h matherror=method,26-h msglevel_n, 30,

Page 124 - 104 S–2179–36

Introduction [1]The Cray Standard C++ Programming Environment contains both the CrayStandard C and C++ compilers. The Cray Standard C compiler conform

Page 125 - 5.1 Complex Data Extensions

Cray Standard C/C++ Reference Manualident directive, 57identifier namesallowable, 15Identifiers, 142IEEE floating-point representation, 147IEEE floati

Page 126 - 5.2 fortran Keyword

Index-l libfile,38LANG, 44, 174languagegeneral-h keep=file,14-h [no]calchars,15-h [no]calsignedshifts,15-h restrict=args,14standard conformance-h cfro

Page 127

Cray Standard C/C++ Reference Manual_CRAYC, 119_CRAYIEEE, 119_CRAYMPP, 119_CRAYSV1, 119_CRAYT3E, 119__DATE__, 117_FASTMD, 119__FILE__, 117_LD64, 119__

Page 128

Indexnointerchange directive, 93nontasked code, 65noopt directive, 53, 121noreduction directive, 94-nostdinc,38nostream directive, 85novector directiv

Page 129 - S–2179–36 109

Cray Standard C/C++ Reference ManualPointers, 148–149UNICOS systems, 149UNICOS/mk systems, 149_popcnt, 180_poppar, 181Porting code, 11, 157#pragma dir

Page 130 - 6.1 Automatic Instantiation

IndexShift operator, 145shortloop directive, 61shortloop128 directive, 61single work distribution, 83sizeof, 142slave code, 64slave function, 64slave

Page 131 - S–2179–36 111

Cray Standard C/C++ Reference Manualproblem, 66reserved semaphores, 66shared registers, 66slave code, 64unitasked code, 65user-directed, 63with vector

Page 132

Cray Standard C/C++ Reference Manualindividual sites. The CC(1) command is described in Section 2.1, page 4, and onthe CC(1) man page. Command line ex

Page 133 - 6.2 Instantiation Modes

Compiler Commands [2]This section describes the compiler commands and the environment variablesnecessary to execute the Cray Standard C and C++ compil

Page 134 - 114 S–2179–36

Cray Standard C/C++ Reference Manual2.1 CC CommandThe CC command invokes the Cray Standard C++ compiler. The CC commandaccepts C++ source files that h

Page 135

Compiler Commands [2]The cc command format is as follows:cc [-c][-C][-d string][-D macro[=def]] [-E][-F][-g][-G level][-h arg][-I incldir][-l libfile]

Page 136 - 6.5 Implicit Inclusion

Cray Standard C/C++ Reference Manualstandard input (stdin) and output to standard output (stdout). Specifying aminus sign (-) for infile also indicate

Page 137 - Predefined Macros [7]

Compiler Commands [2]– General language options are described in the following subsections:SectionOptionsSection 2.7.1, page 14 -h keep=fileSection 2.

Page 138 - 118 S–2179–36

Cray Standard C/C++ Reference Manualwill accept the option. Unless otherwise noted, the following default informationapplies to each option:Default op

Page 139 - S–2179–36 119

Compiler Commands [2]the is option enabled. The -h c99 option is also required for C99 features notpreviously supported as extensions.The -h noc99 opt

Page 140

New FeaturesCray Standard C/C++ Reference Manual S–2179–36The Cray Standard C/C++ Reference Manual supports the Cray Standard C/C++ compiler 3.6 relea

Page 141 - 8.1 Cray TotalView Debugger

Cray Standard C/C++ Reference ManualNote: The c89 command does not accept the -h conform or -h stdcoption. It is enabled by default when the command i

Page 142 - 122 S–2179–36

Compiler Commands [2]2.4.7 -h [no]anachronisms (CC)Default option: -h noanachronismsThe -h [no]anachronisms option enables or disables anachronisms in

Page 143 - S–2179–36 123

Cray Standard C/C++ Reference Manualtype through a pointer to an entirely differenttype. For example, a pointer to intmight be used to access an objec

Page 144

Compiler Commands [2]-h instantiate=mode option. mode is specified as none (the default), used,all,orlocal.2.5.5 -h [no]implicitinclude (CC)Default op

Page 145

Cray Standard C/C++ Reference ManualFor classes that contain no such function, the default behavior is to define thevirtual function table (but to def

Page 146 - 126 S–2179–36

Compiler Commands [2](=f), or each this pointer (=t) points to a unique object. This assumptioneliminates those pointers as sources of potential alias

Page 147 - S–2179–36 127

Cray Standard C/C++ Reference Manual2.8 General Optimization OptionsThe following sections describe general optimization options.2.8.1 -O level (CC, c

Page 148 - 128 S–2179–36

Compiler Commands [2]updates in a single loop. On UNICOS/mk systems, this option enables thecompiler to aggressively assign registers and schedule ins

Page 149 - S–2179–36 129

Cray Standard C/C++ Reference ManualNote: The MSP is an optional feature. To determine whether the MSP isenabled on your system, enter the sysconf com

Page 150 - Cray Standard C main program:

Compiler Commands [2]2.10.2 -h [no]ivdep (CC, cc)Default option: -h noivdepThe -h ivdep option instructs the compiler to ignore vector dependenciesfor

Page 151

Many Cray C++ extensions were adopted by the C++ standard, and thereforecorresponding sections have been removed from this manual. Informationabout th

Page 152

Cray Standard C/C++ Reference Manualimprove vectorization. Also, the aliasing assumptions specified inthe standard are used (for example, it is assume

Page 153

Compiler Commands [2]aliasing will occur between two pointers to different structuretypes.2.11.2 -h taskprivate (cc)This option gives task private sta

Page 154 - 134 S–2179–36

Cray Standard C/C++ Reference Manual(UNICOS systems) The -h [no]threshold option enables or disablesgeneration of run-time threshold testing for autot

Page 155 - S–2179–36 135

Compiler Commands [2]2.13 Scalar Optimization OptionsThe following sections describe scalar optimization options.2.13.1 -h [no]interchange (CC, cc)Def

Page 156 - Cray Standard C++ program:

Cray Standard C/C++ Reference Manual2.13.3 -h [no]align (CC, cc)Default option: -h noalign(UNICOS systems) The -h align option specifies that all func

Page 157

Compiler Commands [2]code. -h zeroinc is the safer and slower option. This option is affected by the-h scalarn option (see Section 2.13.2, page 23).2.

Page 158

Cray Standard C/C++ Reference Manual(UNICOS/mk systems) The -h jump option generates jumps instead ofbranches to external functions. Branches provide

Page 159 - S–2179–36 139

Compiler Commands [2](UNICOS systems) The -h fastmd option generates shorter code sequences forint variables when doing multiply, divide, or compariso

Page 160

Cray Standard C/C++ Reference Manualrealized. For example, this option is useful in loops that contain divides with aloop-invariant divisor or sequenc

Page 161 - S–2179–36 141

Compiler Commands [2]2.16.1 -F (CC, cc)(UNICOS systems) The -F option enables the generation of additional run-timecode that is needed by Perftrace or

Page 162

Record of RevisionVersion Description2.0 January 1996Original Printing. This manual supports the C and C++ compilers contained in theCray C++ Programm

Page 163

Cray Standard C/C++ Reference Manual-G option is the preferred specification. The -Gn and -g options disable alloptimizations and imply -O0.The debugg

Page 164 - 144 S–2179–36

Compiler Commands [2]2.18.2 -h [no]message=n[: n...] (CC, cc)Default option: Determined by -h msglevel_nThe -h [no]message=n[:n...] option enables or

Page 165 - S–2179–36 145

Cray Standard C/C++ Reference Manual2.18.4 -h [no]abort (CC, cc)Default option: -h noabortThe -h [no]abort option controls whether a compilation abort

Page 166 - 146 S–2179–36

Compiler Commands [2]When the -P option is specified on the cpp command line, it is ignored. Whenboth the -P and -E options are specified, the last on

Page 167 - S–2179–36 147

Cray Standard C/C++ Reference ManualTable 3. -W phase DefinitionsphaseSystem phase Commandp Preprocessor0CompileraAssembler as on Cray PVP systems, ca

Page 168 - 148 S–2179–36

Compiler Commands [2]Because there is no separate preprocessor, -Yp and -Y0 are equivalent. If youare using the -Y option on the cpp command line, p i

Page 169 - S–2179–36 149

Cray Standard C/C++ Reference ManualTable 5. -h pragma Directive ProcessingnameGroup Directives affectedallAll All directivesallinlineInlininginline,

Page 170 - 150 S–2179–36

Compiler Commands [2]4. Directory /usr/include.Directories for #include file are searched in the following order:1. Directories named in -I options, i

Page 171

Cray Standard C/C++ Reference Manual2.20.7 -nostdinc (CC, cc, c89, cpp)The -nostdinc option stops the preprocessor from searching for include files in

Page 172 - 152 S–2179–36

Compiler Commands [2]libC.a (Cray Standard C++ only)libu.alibm.alibc.alibsma.a (UNICOS/mk systems only)libf.alibfi.alibsci.aIf you specify personal li

Page 173 - Libraries and Loaders [A]

Cray Standard C/C++ Reference Manual3.4 August 2000This revision supports the Cray C 6.4 and Cray C++ 3.4 releases running on UNICOSand UNICOS/mk oper

Page 174 - 154 S–2179–36

Cray Standard C/C++ Reference Manual2.21.4 -o outfile (CC, cc, c89)The -o outfile option produces an absolute binary file named outfile. A file nameda

Page 175 - S–2179–36 155

Compiler Commands [2]If a file is specified, information about the compilation is displayed in additionto the version information. The additional info

Page 176

Cray Standard C/C++ Reference ManualIn the first line, the -X option is passed only to the compiler, and the number ofPEs is set to 8 at compile time.

Page 177 - B.1 C++ Conformance

Compiler Commands [2]• The following example compiles mydata1.C, writes object file mydata1.o,and produces a scalar optimization report to stdout.CC -

Page 178 - 158 S–2179–36

Cray Standard C/C++ Reference ManualNote: Setting the CRAYOLDCPPLIBenvironment variable disables exceptionhandling. Refer to the -h [no]exceptionsopti

Page 179 - S–2179–36 159

#pragma Directives [3]#pragma directives are used within the source program to request certain kindsof special processing. #pragma directives are part

Page 180 - 160 S–2179–36

Cray Standard C/C++ Reference ManualCompiler: Cray Standard C and Cray Standard C++Operating System: UNICOS and UNICOS/mkScope: Local and global3.1 Pr

Page 181 - B.2 C++ Anachronisms Accepted

#pragma Directives [3]3.4 Alternative Directive form: _PragmaCompiler directives can also be specified in the following form, which has theadvantage i

Page 182

Cray Standard C/C++ Reference Manual#ifdef _CRAY#define Pragma(S) _Pragma(S)#else#define Pragma(S)#endifWhen this definition is used on a UNICOS or UN

Page 183

#pragma Directives [3]For more information on accessing BESUs, see Barrier and Eureka Synchronization(Cray T3E Systems), publication HMM-141–0. (A non

Page 184 - 164 S–2179–36

ContentsPagePreface xiiiRelated Publications . . . . . . . . . . . . . . . . . . . . . . . xivOrdering Documentation . . . . . . . . . . . . . . . . .

Page 185

Cray Standard C/C++ Reference Manual3.5.3 duplicate Directive (Cray Standard C Compiler)Scope: GlobalThe duplicate directive lets you provide addition

Page 186

#pragma Directives [3]#pragma _CRI duplicate derivspeed as accel/* Error: derivspeed is not defined */static void endtime(void){}#pragma _CRI duplicat

Page 187

Cray Standard C/C++ Reference Manualmain.c:extern void fctn(void), FCTN(void);main(){fctn();FCTN();}fctn.c:#include <stdio.h>void fctn(void){pri

Page 188

#pragma Directives [3]The following example illustrates the use of the message compiler directive:#define FLAG 1#ifdef FLAG#pragma _CRI message "

Page 189

Cray Standard C/C++ Reference Manual#include <stdio.h>void sub1(void){printf("In sub1, default optimization\n");}#pragma _CRI nooptvoi

Page 190

#pragma Directives [3]Note: Use of this directive prevents the cache_bypass directive from beingprocessed because when uses_eregs is in effect, no E r

Page 191 - S–2179–36 171

Cray Standard C/C++ Reference Manualextern long x;#pragma _CRI soft x /* x is a soft external data object */extern void f(void);#pragma _CRI soft f /*

Page 192

#pragma Directives [3]3.5.9 ident DirectiveThe ident directive directs the compiler to store the string indicated by textinto the object (.o) file. Th

Page 193 - Compiler Messages [C]

Cray Standard C/C++ Reference ManualOn UNICOS/mk systems, the compiler can perform "vectorization-like"optimizations on certain loops. Vecto

Page 194 - 174 S–2179–36

#pragma Directives [3]On the Cray SV1 series and Cray T3E systems, the compiler assumes that thesafe vector length is the maximum vector length suppor

Page 195 - C.3 Message Severity

Cray Standard C/C++ Reference ManualPage-h [no]tolerant (cc)... 11Template Language Options . . . . . . . . . . . . . . . . . . . .

Page 196 - C.4 Common System Messages

Cray Standard C/C++ Reference Manual3.7.3 novector DirectiveScope: LocalThe novector directive directs the compiler to not vectorize the loop thatimme

Page 197 - S–2179–36 177

#pragma Directives [3]The prefervector directive tells the compiler to vectorize the loop thatimmediately follows the directive if the loop contains m

Page 198

Cray Standard C/C++ Reference ManualThe formats of these directives are as follows:#pragma _CRI shortloop#pragma _CRI shortloop128The following exampl

Page 199 - Intrinsic Functions [D]

#pragma Directives [3]Autotasking is enabled by specifying the -h taskn option on the commandline. For more information on the -h taskn option, see Se

Page 200

Cray Standard C/C++ Reference Manual3.8.1.1.1 Master CodeThe master code contains the code that sets up the data structures needed fortasking, perform

Page 201 - S–2179–36 181

#pragma Directives [3]For debugging purposes, the names of slave functions are in the following form:__tsk_name_nnnThe name is the name of the origina

Page 202

Cray Standard C/C++ Reference ManualBesides executing the vector loop, each processor must execute some loopoverhead code for each chunk of the work.I

Page 203 - S–2179–36 183

#pragma Directives [3]• Shared T registers 0–3If you address these registers in your program (for example, using intrinsicfunctions), tasking may not

Page 204 - 184 S–2179–36

Cray Standard C/C++ Reference Manualextern float a[], b[], c;extern void crunch( float *x, float *y, float z);voidf(int n){int i;#pragma _CRI cncallfo

Page 205 - S–2179–36 185

#pragma Directives [3]}/* The following tasks because the cncall directive *//* allows the compiler to assume no loop carried *//* dependence to/from

Page 206 - 186 S–2179–36

ContentsPage-h [no]vsearch (CC, cc) ... 20Tasking Optimization Options . . . . . . . . . . . . . . . . . . . . 20-h taskn (CC, cc) .

Page 207 - S–2179–36 187

Cray Standard C/C++ Reference Manualsurprising results. In some cases the compiler’s scoping choices do not meetrequirements or expectations.The defau

Page 208 - 188 S–2179–36

#pragma Directives [3]explicitly do so. Unlike other loop-based directives, the taskloop directive mustappear before a for loop.The taskloop directive

Page 209 - S–2179–36 189

Cray Standard C/C++ Reference Manualcontains the taskloop loop. This allows a mechanism to exploit parallelism inloops that contain reduction computat

Page 210 - 190 S–2179–36

#pragma Directives [3](Guarded regions are discussed in Section 3.8.7, page 74.) The endloopdirective ensures that no processor can proceed beyond thi

Page 211 - S–2179–36 191

Cray Standard C/C++ Reference Manual..#pragma _CRI endparallel3.8.7 guard and endguard Directives (UNICOS Systems)Scope: LocalThe guard and endguard d

Page 212 - 192 S–2179–36

#pragma Directives [3]3.8.8 taskprivate Directive (Cray Standard C Compiler)The taskprivate directive specifies the task private storage class for var

Page 213 - S–2179–36 193

Cray Standard C/C++ Reference Manual• A taskprivate variable cannot also be a soft external.• The address of a taskprivate variable cannot be taken in

Page 214 - 194 S–2179–36

#pragma Directives [3]#pragma _CRI taskcommon variable, ...Variables that are given a task common storage class are placed in storage so thateach task

Page 215 - S–2179–36 195

Cray Standard C/C++ Reference Manual• The address of a taskcommon variable cannot be taken in a constantexpression (for example, an initializer).3.8.1

Page 216 - 196 S–2179–36

#pragma Directives [3]directive to take effect. Threshold testing for the loop specified by using theprefertask directive is suppressed. The format of

Commentaires sur ces manuels

Pas de commentaire