Cray Standard C/C++ ReferenceManualS–2179–36
Cray Standard C/C++ Reference ManualPage-F (CC, cc) ... 29-h listing (CC, cc) ... 29Debugging Options . . . .
Cray Standard C/C++ Reference Manualto determine their tasking context. The tasking context for these variablescannot be changed.Note: Variables defau
#pragma Directives [3]For tasked loops, array variables that are sequentially indexed by the loop controlvariable and modified inside the loop are oft
Cray Standard C/C++ Reference Manualand can cause loops inside and outside parallel regions to not vectorize. Avoidshared stack variables, where possi
#pragma Directives [3]For all work distribution arguments except single, each chunk of iterations canbe vectorized, subject to the normal rules for ve
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
#pragma Directives [3]when used in conjunction with the vector orchunksize arguments) will be performed by themaster processor after all the other ite
Cray Standard C/C++ Reference Manual#pragma _CRI nostreamThe following example illustrates the use of the nostream directive:#pragma _CRI nostreamfor
#pragma Directives [3]3.10.1 align Directive (UNICOS Systems)The align directive causes functions, loops, or labels to be aligned on instructionbuffer
Cray Standard C/C++ Reference Manualinstruction buffers, no additional instruction buffer fetches will be necessarywhile the function executes.The cod
#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
ContentsPageLoader Options . . . . . . . . . . . . . . . . . . . . . . . . . 38-d string (CC, cc)... 38-l libfile (CC, cc, c89) .
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
#pragma Directives [3]E registers offer fine-grained access to local memory and a higher bandwidth forsparse index array accesses such as gather/scatt
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[
#pragma Directives [3]n An integer constant between 1 and 63, specifying that nodependencies exist between any iteration of the loop and nsubsequent i
Cray Standard C/C++ Reference ManualThe noreduction compiler directive tells the compiler to not optimize the loopthat immediately follows the directi
#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
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
#pragma Directives [3]from memory at the first reference following the directive. The local suppressdirective has the following format:#pragma _CRI su
Cray Standard C/C++ Reference Manualdeclared in that block will be squandered. Neither of these conditions aredetected by the compiler.3.10.10 unroll
#pragma Directives [3]line option is specified. On UNICOS systems, the compiler may do additionalunrolling over the amount requested by the user.In th
Cray Standard C/C++ Reference ManualPagenopattern Directive . . . . . . . . . . . . . . . . . . . . . . 59novector Directive . . . . . . . . . . . . .
Cray Standard C/C++ Reference Manual/* directive will cause incorrect code due to dependencies! */#pragma _CRI unroll 2for (i = 0; i < 10; i++) {fo
#pragma Directives [3]3.11.1 inline DirectiveThe inline directive specifies functions that are to be inlined. The inlinedirective has the following fo
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
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
Cray Standard C/C++ Reference ManualAdministration Guide for more information about the CrayDoc documentationsystem.If you have any questions about th
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
Cray Standard C/C++ Reference Manual5.2 fortran KeywordNote: The fortran keyword is not allowed in Cray Standard C++.In extended mode, the identifier
Cray Standard C Extensions [5]0x7f7fffff.f 32-bit float0x0123456789012345. 64-bit doubleThe value of a hexadecimal floating constant is interpreted as
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
ContentsPage#pragma preferstream Directive (Cray SV1 series Systems Only) . . . . . . . . 86Scalar Directives . . . . . . . . . . . . . . . . . . . .
Cray Standard C/C++ Reference Manualinstantiation of template entities until all source files of the complete programhave been read.The Cray Standard
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
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
Cray Standard C++ Template Instantiation [6]Automatic instantiation can coexist with partial explicit control ofinstantiation by the programmer throug
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
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
Cray Standard C/C++ Reference ManualIn the preceding example, f1(double) and g1(double) are not instantiatedbecause no bodies are supplied, but no err
Predefined Macros [7]Predefined macros can be divided into the following categories:• Macros required by the C and C++ standards• Macros based on the
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
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
Cray Standard C/C++ Reference ManualPageImplicit Inclusion . . . . . . . . . . . . . . . . . . . . . . . . 116Predefined Macros [7] 117Macros Required
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
Cray Standard C/C++ Reference Manual• Edit values of variables and memory locations• Evaluate code fragments8.2 Compiler Debugging OptionsTo use the C
Interlanguage Communication [9]In some situations, it is necessary or advantageous to make calls to assemblyor Fortran functions from C or C++ program
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
Interlanguage Communication [9]The output from the execution of the calling sequence illustrated in the precedingexample is as follows:Start C++ mainC
Cray Standard C/C++ Reference Manual9.3 Calling Fortran Functions and Subroutines from a C or C++ FunctionThis subsection describes the following aspe
Interlanguage Communication [9]9.3.2 Argument PassingBecause Fortran subroutines expect arguments to be passed by pointers ratherthan by value, C and
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,
Interlanguage Communication [9]_fcdlen Conversion utility that extracts the byte lengthfrom the Fortran character descriptor. BecauseFortran does not
ContentsPageIdentifiers . . . . . . . . . . . . . . . . . . . . . . . . . 142Types . . . . . . . . . . . . . . . . . . . . . . . . . . 142Characters .
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 =
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
Cray Standard C/C++ Reference Manual#include <stdio.h>struct st{float a;float b[10];} *ST;#ifdef __cplusplusextern "C" struct st *MYCO
Interlanguage Communication [9]SUBROUTINE FCTNCOMMON // STA,STB(10)PRINT *, "IN FORTRAN"PRINT *, " STA = ",STAPRINT *, " STB
Cray Standard C/C++ Reference Manual/* C program (main.c): */#include <stdio.h>#include <string.h>#include <fortran.h>fortran double
Interlanguage Communication [9]C Fortran subprogram (ftnfctn.f):FUNCTION FTNFCTN(STR, LOG)REAL FTNFCTNCHARACTER*(*) STRLOGICAL LOGCOMMON /FLOAT1/FLOAT
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
Interlanguage Communication [9]The Fortran program that is called from the Cray Standard C++ main function inthe preceding example is as follows:INTEG
Cray Standard C/C++ Reference ManualC Fortran program (main.f):PROGRAM MAINREAL CFCTNCOMMON /FLOAT1/FLOAT1COMMON /FLOAT2/FLOAT2REAL FLOAT1, FLOAT2DATA
Interlanguage Communication [9]/* C function (cfctn.c): */#include <fortran.h>#include <stdio.h>#include <stdlib.h>#include <stri
Cray Standard C/C++ Reference ManualPageAppendix C Compiler Messages 173Expanding Messages with the explain(1) Command . . . . . . . . . . . . . 173Co
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
Implementation-defined Behavior [10]This chapter describes compiler behavior that is defined by the implementationaccording to the C and/or C++ standa
Cray Standard C/C++ Reference Manual10.1.2.1 IdentifiersThe identifier (as defined by the standards) is merely a sequence of letters anddigits. Specif
Implementation-defined Behavior [10]UNICOS UNICOS/mkType Representation (bits) Memory (bits)Representation(bits) Memory (bits)long 64 64 64 64long lon
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
Implementation-defined Behavior [10]10.1.2.5 IntegersAll integral values are represented in a twos complement format. Forrepresentation and memory sto
Cray Standard C/C++ Reference Manual10.1.2.6.1 Cray floating-point RepresentationTypes float and double represent Cray single-precision (64-bit) float
Implementation-defined Behavior [10]Digits beyond these precisions may not be accurate. It is safest to assume only14 or 28 decimal places of accuracy
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
Implementation-defined Behavior [10]Pointers on UNICOS systems differ from pointers on UNICOS/mk systems. Thesections that follow describe pointer imp
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
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
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
Cray Standard C/C++ Reference ManualThe macros __DATE__ and __TIME__ contain the date and time of the beginningof translation. For more information, s
Libraries and Loaders [A]This appendix describes the libraries that are available with the Cray StandardC/C++ Programming Environment and the loaders,
Cray Standard C/C++ Reference ManualBecause of the special code needed to handle templates, constructors, destructors,and other C++ language features,
Libraries and Loaders [A]was designed specifically for use with UNICOS/mk systems, it offers severaladvantages. You can control cld(1) operations with
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
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
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
Cray Standard C/C++ Reference Manual• Appendix B, page 157, which contains information on the Cray StandardC/C++ dialects.• Appendix C, page 173, whic
Cray Standard C/C++ Reference Manual• Explicit specification of function template arguments is supported.• Unnamed template parameters are supported.•
Cray Standard C/C++ Dialects [B]• extern inline functions are not supported.• Covariant return types on overriding virtual functions are not supported
Cray Standard C/C++ Reference Manualwhen checking for compatibility, therefore, the following statements declarethe overloading of two functions named
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
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
Cray Standard C/C++ Dialects [B]to const int **). Comparisons and pointer difference of such pairs ofpointer types are also allowed.• In operations on
Cray Standard C/C++ Reference Manualthe object and the function pointed to will not modify the object. The oppositeassignment would not be safe.• Conv
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
Cray Standard C/C++ Reference Manualclass A {~A();};class B : public A {~B();};B::~B(){} // Error except in cfront mode• When disambiguation requires
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
PrefaceOrdering DocumentationTo order software documentation, contact the Cray Software Distribution Centerin any of the following ways:E-mail:orderds
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
Cray Standard C/C++ Dialects [B]• An uninitialized const object of non-POD class type is allowed even if itsdefault constructor is implicitly declared
Compiler Messages [C]This appendix describes how to use the message system to control and usemessages issued by the compiler. Explanatory texts for me
Cray Standard C/C++ Reference ManualC.2 Controlling the Use of MessagesThe following sections summarize the command line options that affect theissuin
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
Cray Standard C/C++ Reference ManualWARNING Probable user error. Indicates that the programwill probably abort or behave unpredictably.ERROR Fatal err
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
Intrinsic Functions [D]The C and C++ intrinsic functions either allow for direct access to some hardwareinstructions or result in generation of inline
© 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
Cray Standard C/C++ Reference Manualuser input This bold, fixed-space font denotes literal itemsthat the user enters in interactive sessions. Outputis
Cray Standard C/C++ Reference ManualTable 9. Summary of C and C++ Intrinsic FunctionsFunctionUNICOS systems UNICOS/mk systems_argcount1XX_cmrX_dshiftl
Intrinsic Functions [D]FunctionUNICOS systems UNICOS/mk systems_popparXX_ranfXX_readSBX_readSRX_readSTX_remote_write_barrierX_rtcXX_semclrX_semgetX_se
Index-#,33-##,33-###,33Aalignfunction alignment, 87align directive, 87loop alignment, 88AnachronismsC++, 161analysis tools-h listing,29_argcount, 180A
Cray Standard C/C++ Reference Manualcompiler version, 40conflicting with directives, 8conflicting with other options, 8-D macro[=def], 35-d string opt
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
Cray Standard C/C++ Reference ManualCray SV1 systems, 85Cray TotalView debugger, 121CRAYOLDCPPLIB,43CRI_c89_OPTIONS,44CRI_cc_OPTIONS,44CRI_CC_OPTIONS,
Indexsplit,94suppress,96symmetric,97taskcommon,76taskloop,70taskprivate,75taskshared,76unroll,98usage, 45uses_eregs,54vfunction,56protecting, 46scalar
Cray Standard C/C++ Reference ManualF_fcdlen conversion utility, 129_fcdtocp conversion utility, 128FeaturesC++, 157cfront compatibility, 157filesa.ou
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,
Introduction [1]The Cray Standard C++ Programming Environment contains both the CrayStandard C and C++ compilers. The Cray Standard C compiler conform
Cray Standard C/C++ Reference Manualident directive, 57identifier namesallowable, 15Identifiers, 142IEEE floating-point representation, 147IEEE floati
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
Cray Standard C/C++ Reference Manual_CRAYC, 119_CRAYIEEE, 119_CRAYMPP, 119_CRAYSV1, 119_CRAYT3E, 119__DATE__, 117_FASTMD, 119__FILE__, 117_LD64, 119__
Indexnointerchange directive, 93nontasked code, 65noopt directive, 53, 121noreduction directive, 94-nostdinc,38nostream directive, 85novector directiv
Cray Standard C/C++ Reference ManualPointers, 148–149UNICOS systems, 149UNICOS/mk systems, 149_popcnt, 180_poppar, 181Porting code, 11, 157#pragma dir
IndexShift operator, 145shortloop directive, 61shortloop128 directive, 61single work distribution, 83sizeof, 142slave code, 64slave function, 64slave
Cray Standard C/C++ Reference Manualproblem, 66reserved semaphores, 66shared registers, 66slave code, 64unitasked code, 65user-directed, 63with vector
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
Compiler Commands [2]This section describes the compiler commands and the environment variablesnecessary to execute the Cray Standard C and C++ compil
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
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]
Cray Standard C/C++ Reference Manualstandard input (stdin) and output to standard output (stdout). Specifying aminus sign (-) for infile also indicate
Compiler Commands [2]– General language options are described in the following subsections:SectionOptionsSection 2.7.1, page 14 -h keep=fileSection 2.
Cray Standard C/C++ Reference Manualwill accept the option. Unless otherwise noted, the following default informationapplies to each option:Default op
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
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
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
Compiler Commands [2]2.4.7 -h [no]anachronisms (CC)Default option: -h noanachronismsThe -h [no]anachronisms option enables or disables anachronisms in
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
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
Cray Standard C/C++ Reference ManualFor classes that contain no such function, the default behavior is to define thevirtual function table (but to def
Compiler Commands [2](=f), or each this pointer (=t) points to a unique object. This assumptioneliminates those pointers as sources of potential alias
Cray Standard C/C++ Reference Manual2.8 General Optimization OptionsThe following sections describe general optimization options.2.8.1 -O level (CC, c
Compiler Commands [2]updates in a single loop. On UNICOS/mk systems, this option enables thecompiler to aggressively assign registers and schedule ins
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
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
Many Cray C++ extensions were adopted by the C++ standard, and thereforecorresponding sections have been removed from this manual. Informationabout th
Cray Standard C/C++ Reference Manualimprove vectorization. Also, the aliasing assumptions specified inthe standard are used (for example, it is assume
Compiler Commands [2]aliasing will occur between two pointers to different structuretypes.2.11.2 -h taskprivate (cc)This option gives task private sta
Cray Standard C/C++ Reference Manual(UNICOS systems) The -h [no]threshold option enables or disablesgeneration of run-time threshold testing for autot
Compiler Commands [2]2.13 Scalar Optimization OptionsThe following sections describe scalar optimization options.2.13.1 -h [no]interchange (CC, cc)Def
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
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.
Cray Standard C/C++ Reference Manual(UNICOS/mk systems) The -h jump option generates jumps instead ofbranches to external functions. Branches provide
Compiler Commands [2](UNICOS systems) The -h fastmd option generates shorter code sequences forint variables when doing multiply, divide, or compariso
Cray Standard C/C++ Reference Manualrealized. For example, this option is useful in loops that contain divides with aloop-invariant divisor or sequenc
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
Record of RevisionVersion Description2.0 January 1996Original Printing. This manual supports the C and C++ compilers contained in theCray C++ Programm
Cray Standard C/C++ Reference Manual-G option is the preferred specification. The -Gn and -g options disable alloptimizations and imply -O0.The debugg
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
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
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
Cray Standard C/C++ Reference ManualTable 3. -W phase DefinitionsphaseSystem phase Commandp Preprocessor0CompileraAssembler as on Cray PVP systems, ca
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
Cray Standard C/C++ Reference ManualTable 5. -h pragma Directive ProcessingnameGroup Directives affectedallAll All directivesallinlineInlininginline,
Compiler Commands [2]4. Directory /usr/include.Directories for #include file are searched in the following order:1. Directories named in -I options, i
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
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
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
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
Compiler Commands [2]If a file is specified, information about the compilation is displayed in additionto the version information. The additional info
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.
Compiler Commands [2]• The following example compiles mydata1.C, writes object file mydata1.o,and produces a scalar optimization report to stdout.CC -
Cray Standard C/C++ Reference ManualNote: Setting the CRAYOLDCPPLIBenvironment variable disables exceptionhandling. Refer to the -h [no]exceptionsopti
#pragma Directives [3]#pragma directives are used within the source program to request certain kindsof special processing. #pragma directives are part
Cray Standard C/C++ Reference ManualCompiler: Cray Standard C and Cray Standard C++Operating System: UNICOS and UNICOS/mkScope: Local and global3.1 Pr
#pragma Directives [3]3.4 Alternative Directive form: _PragmaCompiler directives can also be specified in the following form, which has theadvantage i
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
#pragma Directives [3]For more information on accessing BESUs, see Barrier and Eureka Synchronization(Cray T3E Systems), publication HMM-141–0. (A non
ContentsPagePreface xiiiRelated Publications . . . . . . . . . . . . . . . . . . . . . . . xivOrdering Documentation . . . . . . . . . . . . . . . . .
Cray Standard C/C++ Reference Manual3.5.3 duplicate Directive (Cray Standard C Compiler)Scope: GlobalThe duplicate directive lets you provide addition
#pragma Directives [3]#pragma _CRI duplicate derivspeed as accel/* Error: derivspeed is not defined */static void endtime(void){}#pragma _CRI duplicat
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
#pragma Directives [3]The following example illustrates the use of the message compiler directive:#define FLAG 1#ifdef FLAG#pragma _CRI message "
Cray Standard C/C++ Reference Manual#include <stdio.h>void sub1(void){printf("In sub1, default optimization\n");}#pragma _CRI nooptvoi
#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
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 /*
#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
Cray Standard C/C++ Reference ManualOn UNICOS/mk systems, the compiler can perform "vectorization-like"optimizations on certain loops. Vecto
#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
Cray Standard C/C++ Reference ManualPage-h [no]tolerant (cc)... 11Template Language Options . . . . . . . . . . . . . . . . . . . .
Cray Standard C/C++ Reference Manual3.7.3 novector DirectiveScope: LocalThe novector directive directs the compiler to not vectorize the loop thatimme
#pragma Directives [3]The prefervector directive tells the compiler to vectorize the loop thatimmediately follows the directive if the loop contains m
Cray Standard C/C++ Reference ManualThe formats of these directives are as follows:#pragma _CRI shortloop#pragma _CRI shortloop128The following exampl
#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
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
#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
Cray Standard C/C++ Reference ManualBesides executing the vector loop, each processor must execute some loopoverhead code for each chunk of the work.I
#pragma Directives [3]• Shared T registers 0–3If you address these registers in your program (for example, using intrinsicfunctions), tasking may not
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
#pragma Directives [3]}/* The following tasks because the cncall directive *//* allows the compiler to assume no loop carried *//* dependence to/from
ContentsPage-h [no]vsearch (CC, cc) ... 20Tasking Optimization Options . . . . . . . . . . . . . . . . . . . . 20-h taskn (CC, cc) .
Cray Standard C/C++ Reference Manualsurprising results. In some cases the compiler’s scoping choices do not meetrequirements or expectations.The defau
#pragma Directives [3]explicitly do so. Unlike other loop-based directives, the taskloop directive mustappear before a for loop.The taskloop directive
Cray Standard C/C++ Reference Manualcontains the taskloop loop. This allows a mechanism to exploit parallelism inloops that contain reduction computat
#pragma Directives [3](Guarded regions are discussed in Section 3.8.7, page 74.) The endloopdirective ensures that no processor can proceed beyond thi
Cray Standard C/C++ Reference Manual..#pragma _CRI endparallel3.8.7 guard and endguard Directives (UNICOS Systems)Scope: LocalThe guard and endguard d
#pragma Directives [3]3.8.8 taskprivate Directive (Cray Standard C Compiler)The taskprivate directive specifies the task private storage class for var
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
#pragma Directives [3]#pragma _CRI taskcommon variable, ...Variables that are given a task common storage class are placed in storage so thateach task
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
#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