C* PROGRAMMING GUIDE May 1993 Copyright (c) 1990-1993 Thinking Machines Corporation. ABOUT THIS MANUAL ***************** Objectives of This Manual ------------------------- This manual is intended to help you learn how to program in the C* data parallel programming language. Intended Audience ----------------- Readers are assumed to have a working knowledge of C programming and a general understanding of the components of the Connection Machine system on which they will be running their programs. Revision Information -------------------- This is a revision of the C* Programming Guide, Version 6.0.2. The major difference from the previous version is the inclusion of information about the CM-5 implementation of C*. Organization of This Manual --------------------------- Part I Getting Started The first two chapters introduce C* and data parallel programming on the Connection Machine system and provide a step-by-step explanation of a simple program. Part II Programming in C* These eight chapters, Chapters 3-10, describe how to write programs in C*. Part III C* Communication Functions Data parallel programming lets you operate on large multi- dimensional sets of data at the same time. These four chapters, Chapters 11-14, describe C* library functions that you can use to transfer values among items in the data set and to perform cumulative operations along any of the dimensions of the data set. Appendix A CM-200 C* Performance Hints This appendix suggests ways of increasing the performance of a CM-200 C* program. Appendix B Using allocate_detailed_shape for the CM-5 This appendix describes how to use the allocate_detailed_shape function to explicitly control how a shape is laid out on the CM-5. Appendix C Memory Layout on the CM-5 This appendix describes the memory layout of parallel variables on the CM-5, and explains how to manipulate data via shape aliasing. Appendix D CM-5 C* Table Lookup Utility This appendix describes a utility available in CM-5 C*. Appendix E Glossary This is a glossary of technical terms used in the manual. Associated Documents -------------------- If you are going to run your programs on a CM-5 system, see the CM-5 C* User's Guide for more information. If you are going to run your programs on a CM-200, CM-2, or CM-2a system, see the CM-200 C* User's Guide for more information. For more basic information on C*, see the manual Getting Started in C*. For information on improving the performance of your CM-5 C* program, see the CM-5 C* Performance Guide. Information about related aspects of CM programming is contained in other volumes of the documentation set for your CM system. C* is based on the standard version of the C programming language proposed by the X3J11 committee of the American National Standards Institute; this version is referred to as Standard C in this manual. The standard is available from: X3 Secretariat Computer and Business Equipment Manufacturers Association 311 First Street, N.W. Suite 500 Washington, DC 20001-2178 Related books about Standard C include: o Brian W. Kernighan and Dennis M. Ritchie, The C Programming Language, 2nd edition (Englewood Cliffs, New Jersey: Prentice- Hall, 1988) o Samuel P. Harbison and Guy L. Steele Jr., C: A Reference Manual, third edition (Englewood Cliffs, New Jersey: Prentice-Hall, 1991) ---------------------------------------------------------------------- Contents copyright (C) 1990-1993 by Thinking Machines Corporation. All rights reserved. This file contains documentation produced by Thinking Machines Corporation. Unauthorized duplication of this documentation is prohibited. ***************************************************************** The information in this document is subject to change without notice and should not be construed as a commitment by Think- ing Machines Corporation. Thinking Machines reserves the right to make changes to any product described herein. Although the information in this document has been reviewed and is believed to be reliable, Thinking Machines Corporation assumes no liability for errors in this document. Thinking Machines does not assume any liability arising from the application or use of any information or product described herein. ***************************************************************** Connection Machine (r) is a registered trademark of Thinking Machines Corporation. CM, CM-2, CM-200, and CM-5 are trademarks of Thinking Machines Corporation. C* (r) is a registered trademark of Thinking Machines Corporation. Thinking Machines (r) is a registered trademark of Thinking Machines Corporation. UNIX is a registered trademark of UNIX System Laboratories, Inc. Copyright (c) 1990-1993 by Thinking Machines Corporation. All rights reserved. Thinking Machines Corporation 245 First Street Cambridge, Massachusetts 02142-1264 (617) 234-1000