CM FORTRAN LIBRARIES REFERENCE MANUAL Version 2.1, January 1994 Copyright (c) 1994 Thinking Machines Corporation. ABOUT THIS MANUAL ***************** Objectives of This Manual ------------------------- This manual provides reference and usage information about the procedures in the CM Fortran Utility Library, global/local library, and cmf77 library. Intended Audience ----------------- This manual assumes familiarity with CM Fortran programming. Organization of This Manual --------------------------- Part I Chapters 1 - 7 CM Fortran Utility Library Describes the utility procedures by functional categories and suggests how to use them. The descriptions include comparisons with language features, where appropriate, as well as reference pages for each of the procedures. The procedures are listed below by functional category. System Inquiry Functions ARCH = CMF_ARCHITECTURE ( ) NUM = CMF_NUMBER_OF_PROCESSORS ( ) BYTES = CMF_AVAILABLE_MEMORY ( ) Array Inquiry Subroutine CMF_DESCRIBE_ARRAY ( ARRAY ) Random Number Subroutines CMF_RANDOM ( DEST, LIMIT ) CMF_RANDOM_LONG_S_INTEGER ( DEST, LIMIT ) CMF_RANDOMIZE ( SEED ) Dynamic Array Allocation Subroutines CMF_ALLOCATE_ARRAY ( ARRAY, EXTENTS, RANK, TYPE ) CMF_ALLOCATE_LAYOUT_ARRAY ( ARRAY, EXTENTS, RANK, TYPE, ORDERS, WEIGHTS ) CMF_ALLOCATE_DETAILED_ARRAY ( ARRAY, EXTENTS, RANK, TYPE, ORDERS, SUBGRIDS, PMASKS ) CMF_DEALLOCATE_ARRAY ( ARRAY ) Operating Upon Aliases LOG = CMF_ARRAY_IS_ALIAS ( ARRAY, ASTAT ) CMF_SET_ALIAS_LOCATION ( ALIAS, LOCATION, ASTAT ) CMF_REMOVE_ALIAS ( ALIAS, ASTAT ) Array Descriptor Inquiries INT = CMF_GET_GLOBAL_LOCATION ( ARRAY, OFFSETS, ASTAT ) INT = CMF_GET_PHYSICAL_LOCATION ( ARRAY, OFFSETS, ASTAT ) CMF_GET_AXIS_ORDERS ( ARRAY, ORDERS, RANK, ASTAT ) CMF_GET_LOCAL_EXTENTS ( ARRAY, EXTENTS, RANK, ASTAT ) CMF_GET_LOCAL_STRIDES ( ARRAY, STRIDES, RANK, ASTAT ) CMF_GET_PROCESSOR_MASKS ( ARRAY, MASKS, RANK, ASTAT ) Execution Environment INT = CMF_ARRAY_SIZE_QUANTUM ( ) CMF_SET_ALIAS_SAFETY_LEVEL ( SAFETY_LEVEL ) INT = CMF_GET_ALIAS_SAFETY_LEVEL ( ) Array Transfer Subroutines CMF_FE_ARRAY_TO_CM ( DEST, SOURCE ) CMF_FE_ARRAY_FROM_CM ( DEST, SOURCE ) Array Address Construction Procedures GEOMETRY = CMF_GET_GEOMETRY_ID ( ARRAY ) CMF_MAKE_SEND_ADDRESS ( ARRAY ) CMF_MY_SEND_ADDRESS ( ARRAY ) CMF_DEPOSIT_GRID_COORDINATE ( GEOMETRY, SEND_ADDRESS, AXIS, COORDINATE, MASK ) Scatter-with-Combining Subroutine CMF_SEND_[ OVERWRITE | ADD | MAX | MIN | IOR | IAND | IEOR ] ( DEST, SEND_ADDRESS, SOURCE, MASK ) Parallel Prefix Subroutine CMF_SCAN_[ COPY | ADD | MAX | MIN | IOR | IAND | IEOR ] ( DEST, SOURCE, SEGMENT, AXIS, DIRECTION, INCLUSION, SEGMENT_MODE, MASK ) Sorting Subroutines CMF_ORDER ( DEST, SOURCE, AXIS, MASK ) CMF_RANK ( DEST, SOURCE, SEGMENT, AXIS, DIRECTION, SEGMENT_MODE, MASK ) CMF_SORT ( DEST, SOURCE, SEGMENT, AXIS, DIRECTION, SEGMENT_MODE, MASK ) Table Lookup Procedures TABLE = CMF_ALLOCATE_TABLE ( TYPE, ELEMENT_COUNT, INITIAL_VALUES ) CMF_DEALLOCATE_TABLE ( TABLE ) CMF_LOOKUP_IN_TABLE ( DEST, TABLE, INDEX, MASK ) Gathers/Scatters on Serial Axes (Subroutines) CMF_AREF_1D ( DEST, ARRAY, INDEX, MASK ) CMF_ASET_1D ( ARRAY, SOURCE, INDEX, MASK ) CM File Operations Procedures CMF_FILE_OPEN ( UNIT, PATH, IOSTAT ) CMF_FILE_OPEN_READONLY ( UNIT, PATH, IOSTAT ) CMF_FILE_CLOSE ( UNIT, IOSTAT ) CMF_FILE_UNLINK ( PATH, IOSTAT ) CMF_CM_ARRAY_TO_FILE ( UNIT, SOURCE, IOSTAT ) CMF_CM_ARRAY_FROM_FILE (UNIT, DEST, IOSTAT ) CMF_CM_ARRAY_TO_FILE_FMS ( UNIT, SOURCE, IOSTAT ) CMF_CM_ARRAY_FROM_FILE_FMS ( UNIT, DEST, IOSTAT ) CMF_CM_ARRAY_TO_FILE_SO ( UNIT, SOURCE, IOSTAT ) CMF_CM_ARRAY_FROM_FILE_SO ( UNIT, DEST, IOSTAT ) CMF_FILE_LSEEK ( UNIT, OFFSET, IOSTAT ) CMF_FILE_LSEEK_FMS ( UNIT, OFFSET, IOSTAT ) CMF_FILE_LLSEEK ( UNIT, OFFSET, IOSTAT ) CMF_FILE_REWIND ( UNIT, IOSTAT ) CMF_FILE_TRUNCATE ( UNIT, LENGTH, IOSTAT ) CMF_FILE_LTRUNCATE ( UNIT, LENGTH, IOSTAT ) SIZEOF = CMF_SIZEOF_ARRAY_ELEMENT ( ARRAY ) CM I/O via Sockets or Devices (Subroutines) CMF_FILE_FDOPEN ( UNIT, CMFS_FD, IOSTAT ) CMF_FILE_GET_FD ( UNIT, CMFS_FD, IOSTAT ) Constructing Aliases CMF_ALIAS_TYPE ( ALIAS, TYPE, ARRAY, RESIZE_MODE, ASTAT ) CMF_ALIAS_DETAILED ( ALIAS, RANK, EXTENTS, ORDERS, SUBGRIDS, PMASKS, OFFSETS, MASK_CHECK, ARRAY, ASTAT ) Part II Chapter 8: Global/Local Programming Describes global/local programming and provides reference pages for three library functions. Global/Local Library Routines CMGL_BROADCAST_SERIAL_ARRAY ( SERIAL_ARRAY, NUM_BYTES ) CMGL_local_to_global ( ARRAY, L_INDEX, G_INDEX ) CMGL_global_to_local ( ARRAY, L_INDEX, G_INDEX, LOCAL ) The first routine transfers global serial arrays from front-end memory to node memory, and the next two provide information on the mapping between global parallel arrays and subarrays. Part III Chapter 9: cmf77 Library Describes the library libcmf77.a and compares it with Sun Microsystems' libF77.a. Revision Information -------------------- This is a new manual. It replaces the CM Fortran Utility Library Reference Manual, Version 2.0 Beta, and includes the cmf77 library information previously documented in the CM Fortran User's Guide, Version 2.0 Beta. The global/local library is new with Version 2.1. Related Documents ----------------- o Getting Started in CM Fortran, January 1993. o CM Fortran User's Guide, Version 2.1 o CM Fortran Language Reference Manual, Version 2.1 o CM Fortran Programming Guide, Version 2.1 o CM Fortran Array Operations Quick Reference Guide, Version 2.1 o The dictionary entries in this manual are available on-line as man pages. View them with the command man on CM-5 or cmman on CM-2/200, specifying the procedure name in uppercase. ***************************************************************** 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, CM-5, CM-5 Scale 3, and DataVault are trademarks of Thinking Machines Corporation. CMOST, CMAX, and Prism are trademarks of Thinking Machines Corporation. C* (r) is a registered trademark of Thinking Machines Corporation. Paris and CM Fortran are trademarks of Thinking Machines Corporation. CMMD, CMSSL, and CMX11 are trademarks of Thinking Machines Corporation. CMview is a trademark of Thinking Machines Corporation. Scalable Computing (SC) is a trademark of Thinking Machines Corporation. Scalable Disk Array (SDA) is a trademark of Thinking Machines Corporation. Thinking Machines (r) is a registered trademark of Thinking Machines Corporation. SPARC and SPARCstation are trademarks of SPARC International, Inc. Sun, Sun-4, and Sun Workstation are trademarks of Sun Microsystems, Inc. UNIX is a trademark of UNIX System Laboratories, Inc. Copyright (c) 1994 by Thinking Machines Corporation. All rights reserved. This file contains documentation produced by Thinking Machines Corporation. Unauthorized duplication of this documentation is prohibited. Thinking Machines Corporation 245 First Street Cambridge, Massachusetts 02142-1264 (617) 234-1000