Pubtex Output 2007.09.07:1209
Total Page:16
File Type:pdf, Size:1020Kb
Cray® C and C++ Reference Manual S–2179–60 © 1996-2000, 2002-2007 Cray Inc. All Rights Reserved. This manual or parts thereof may not be reproduced in any form unless permitted by contract or by written permission of Cray Inc. U.S. GOVERNMENT RESTRICTED RIGHTS NOTICE The Computer Software is delivered as "Commercial Computer Software" as defined in DFARS 48 CFR 252.227-7014. All Computer Software and Computer Software Documentation acquired by or for the U.S. Government is provided with Restricted Rights. Use, duplication or disclosure by the U.S. Government is subject to the restrictions described in FAR 48 CFR 52.227-14 or DFARS 48 CFR 252.227-7014, as applicable. Technical Data acquired by or for the U.S. Government, if any, is provided with Limited Rights. Use, duplication or disclosure by the U.S. Government is subject to the restrictions described in FAR 48 CFR 52.227-14 or DFARS 48 CFR 252.227-7013, as applicable. Cray, LibSci, UNICOS and UNICOS/mk are federally registered trademarks and Active Manager, Cray Apprentice2, Cray C++ Compiling System, Cray Fortran Compiler, Cray SeaStar, Cray SeaStar2, Cray SHMEM, Cray Threadstorm, Cray X1, Cray X1E, Cray X2, Cray XD1, Cray XMT, Cray XT, Cray XT3, Cray XT4, CrayDoc, CRInform, Libsci, RapidArray, UNICOS/lc, and UNICOS/mp are trademarks of Cray Inc. Dinkumware and Dinkum are trademarks of Dinkumware, Ltd. Edison Design Group is a trademark of Edison Design Group, Inc. TotalView is a trademark of TotalView Technologies LLC. GNU is a trademark of The Free Software Foundation. O2 is a trademark of Silicon Graphics, Inc. SGI and Silicon Graphics are trademarks of Silicon Graphics, Inc. ISO is a trademark of International Organization for Standardization (Organisation Internationale de Normalisation). UNIX, the “X device,” X Window System, and X/Open are trademarks of The Open Group in the United States and other countries. All other trademarks are the property of their respective owners. The UNICOS, UNICOS/mk, and UNICOS/mp operating systems are derived from UNIX System V. These operating systems are also based in part on the Fourth Berkeley Software Distribution (BSD) under license from The Regents of the University of California. Portions of this document were copied by permission of OpenMP Architecture Review Board from OpenMP C and C++ Application Program Interface, Version 2.0, March 2002, Copyright © 1997-2002, OpenMP Architecture Review Board. New Features Cray® C and C++ Reference Manual S–2179–60 This manual was revised to include the following changes for the Programming Environment 6.0 Cray C and Cray C++ releases: • The -h calchars option allows the use of the @ symbol on Cray X1 series systems only (see Section 2.9.3, page 24). • The -h gen_private_callee option is not supported on Cray X2 systems (see Section 2.10.5, page 27). • Documented Cray X2 cache levels (see Table 5, page 34). • Added an option that directs the compiler to instrument the source code for gathering profile information (see Section 2.10.12, page 30). • Added support of profile-guided optimization (see Section 2.10.11, page 30 and Section 3.7.10, page 99). • On Cray X2 systems,-O values of 0, 1, 2,or3 set that level of optimization for -h cachen options (see Table 5, page 34). • The -h cpu=target_system option for Cray X2 systems is -h cpu=cray-x2 (see Section 2.22.2, page 58). • The CRAY_PE_TARGET environment variable for Cray X2 systems is cray-x2 (see Section 2.24, page 65). • Added support of the NPROC compile time environment variable for Cray X2 systems (see Section 2.24, page 65). • Added support of the CRAYNV_STACK_SIZE run time environment variable for Cray X2 systems (see Section 2.25, page 67). • Added support of the loop_info prefetch and loop_info noprefetch directives for Cray X2 systems. Preloading scalar data into cache can improve the frequency of cache hits and lower latency (see Section 3.7.3, page 92). • Added support of vector atomic memory operations (AMOs) on Cray X2 systems (see Example 10, page 94). • On Cray X2 systems, the maximum number of threads (aprun -d depth value) is 4 (see Section 5.5, page 132). • For Cray X2 systems, the Cray C++ compiler uses the GNU standard C++ library, libstdc++.a (see Section 7.2, page 141). • Added support of the __linux, __linux__, linux, and __gnu_linux__ macros for Cray X2 systems (see Section 10.2, page 159). • Added support of the __LITTLE_ENDIAN__ and __LITTLE_ENDIAN macros for Cray X2 systems (see Section 10.3, page 160). • Added support of the __crayx2 environment variable for Cray X2 systems (see Section 10.3, page 160). • Added support of the __craynv environment variable for Cray X2 systems (see Section 10.3, page 160). • The CRAY, _CRAY, and cray macros are not defined for Cray X2 systems (see Section 10.3, page 160). • Added support of the _CRAYC macro for Cray X2 systems (see Section 10.4, page 161). • The maximum hardware vector length Cray X2 systems is 128 (see Section 10.3, page 160). • Noted throughout the manual that multistreaming, MSPs and SSPs, and Cray Streaming Directives (CSDs) are not supported on Cray X2 systems. Record of Revision Version Description 2.0 January 1996 Original Printing. This manual supports the C and C++ compilers contained in the Cray C++ Programming Environment release 2.0. On all Cray systems, the C++ compiler is Cray C++ 2.0. On Cray systems with IEEE floating-point hardware, the C compiler is Cray Standard C 5.0. On Cray systems without IEEE floating-point hardware, the C compiler is Cray Standard C 4.0. 3.0 May 1997 This rewrite supports the C and C++ compilers contained in the Cray C++ Programming Environment release 3.0, which is supported on all systems except the Cray T3D system. On all supported Cray systems, the C++ compiler is Cray C++ 3.0 and the C compiler is Cray C 6.0. 3.0.2 March 1998 This revision supports the C and C++ compilers contained in the Cray C++ Programming Environment release 3.0.2, which is supported on all systems except the Cray T3D system. On all supported Cray systems, the C++ compiler is Cray C++ 3.0.2 and the C compiler is Cray C 6.0.2. 3.1 August 1998 This revision supports the C and C++ compilers contained in the Cray C++ Programming Environment release 3.1, which is supported on all systems except the Cray T3D system. On all supported Cray systems, the C++ compiler is Cray C++ 3.1 and the C compiler is Cray C 6.1. 3.2 January 1999 This revision supports the C and C++ compilers contained in the Cray C++ Programming Environment release 3.2, which is supported on all systems except the Cray T3D system. On all supported Cray systems, the C++ compiler is Cray C++ 3.2 and the C compiler is Cray C 6.2. 3.3 July 1999 This revision supports the C and C++ compilers contained in the Cray C++ Programming Environment release 3.3, which is supported on the Cray SV1, Cray C90, Cray J90, and Cray T90 systems running UNICOS 10.0.0.5 and later, and Cray T3E systems running UNICOS/mk 2.0.4 and later. On all supported Cray systems, the C++ compiler is Cray C++ 3.3 and the C compiler is Cray C 6.3. S–2179–60 i Cray® C and C++ Reference Manual 3.4 August 2000 This revision supports the Cray C 6.4 and Cray C++ 3.4 releases running on UNICOS and UNICOS/mk operating systems. It includes updates to revision 3.3. 3.4 October 2000 This revision supports the Cray C 6.4 and Cray C++ 3.4 releases running on UNICOS and UNICOS/mk operating systems. This revision supports a new inlining level, inline4. 3.6 June 2002 This revision supports the Cray Standard C 6.6 and Cray Standard C++ 3.6 releases running on UNICOS and UNICOS/mk operating systems. 4.1 August 20, 2002 Draft version to support Cray C 7.1 and Cray C++ 4.1 releases running on UNICOS/mp operating systems. 4.2 December 20, 2002 Draft version to support Cray C 7.2 and Cray C++ 4.2 releases running on UNICOS/mp operating systems. 4.3 March 31, 2003 Draft version to support Cray C 7.3 and Cray C++ 4.3 releases running on UNICOS/mp operating systems. 5.0 June 2003 Supports Cray C++ 5.0 and Cray C 8.0 releases running on UNICOS/mp 2.1 or later operating systems. 5.1 October 2003 Supports Cray C++ 5.1 and Cray C 8.1 releases running on UNICOS/mp 2.2 or later operating systems. 5.2 April 2004 Supports Cray C++ 5.2 and Cray C 8.2 releases running on UNICOS/mp 2.3 or later operating systems. 5.3 November 2004 Supports Cray C++ 5.3 and Cray C 8.3 releases running on UNICOS/mp 2.5 or later operating systems. 5.4 March 2005 ii S–2179–60 Record of Revision Supports Cray C++ 5.4 and Cray C 8.4 releases running on UNICOS/mp 3.0 or later operating systems. 5.5 December 2005 Supports Cray C++ 5.5 and Cray C 8.5 releases running on UNICOS/mp 3.0 or later operating systems. 5.6 March 2007 Supports Cray C++ 5.6 and Cray C 8.6 releases running on Cray X1 series systems.