3. Pointers and Arrays

  1. Tarek El-Ghazawi1,
  2. William Carlson2,
  3. Thomas Sterling3 and
  4. Katherine Yelick4

Published Online: 27 JAN 2005

DOI: 10.1002/0471478369.ch3

UPC: Distributed Shared Memory Programming

UPC: Distributed Shared Memory Programming

How to Cite

El-Ghazawi, T., Carlson, W., Sterling, T. and Yelick, K. (2005) Pointers and Arrays, in UPC: Distributed Shared Memory Programming, John Wiley & Sons, Inc., Hoboken, NJ, USA. doi: 10.1002/0471478369.ch3

Author Information

  1. 1

    The George Washington University, USA

  2. 2

    IDA Center for Computing Sciences, USA

  3. 3

    California Institute of Technology, USA

  4. 4

    University of California at Berkeley, USA

Publication History

  1. Published Online: 27 JAN 2005
  2. Published Print: 13 MAY 2005

Book Series:

  1. Wiley Series on Parallel and Distributed Computing

Book Series Editors:

  1. Albert Y. Zomaya

ISBN Information

Print ISBN: 9780471220480

Online ISBN: 9780471478362



  • UPC pointers;
  • pointer arithmetic;
  • pointer casting


UPC embodies many powerful pointer concepts. UPC pointers include private pointers, private pointers-to-shared and shared pointers-to-shared. Shared pointers-to-private are also possible to declare, but using them is not advised as their behavior is not specified. Pointers-to-shared can have blocking factors, just like shared arrays. Such a layout specifier is part of the type. Pointer-to-shared representations embody three important elements. These are the thread number, the phase number, and the address. Pointer information and manipulation functions can be used to extract this information from a pointer. One type of pointer can be cast into another. For example, pointers-to-shared can be cast to private pointers. In this case, the thread number information is lost. Local shared data is stored contiguously and therefore can be easily addressed by a private pointer. All these different types of pointers available in UPC can be extremely useful to developers.