Skip to Main Content
UPC: DISTRIBUTED SHARED MEMORY PROGRAMMING
book

UPC: DISTRIBUTED SHARED MEMORY PROGRAMMING

by Tarek El-Ghazawi, William Carlson, Thomas Sterling, Katherine Yelick
July 2003
Intermediate to advanced content levelIntermediate to advanced
260 pages
5h 57m
English
Wiley-Interscience
Content preview from UPC: DISTRIBUTED SHARED MEMORY PROGRAMMING

CHAPTER 5

Dynamic Shared Memory Allocation

Dynamic memory allocation has been used extensively in applications for several important reasons. For example, dynamic memory allocation provides flexibility when the data sizes change during the lifetime of a program, and allows memory reuse for better utilization of the memory resources when data sizes are very large. In the private space of a UPC program, dynamic memory allocation can be done using the standard dynamic memory allocation functions available in ISO C. Dynamic memory allocation in the shared space is also possible. However, this is accomplished by special UPC memory allocation and deallocation functions. In this chapter we discuss dynamic shared memory allocation in UPC.

Dynamic shared memory allocation functions can be collective or noncollective. A function is collective if it is required to be called by all threads to produce the required impact. A function is noncollective if it should be called by a single thread. UPC has three basic dynamic shared memory allocation functions and one deallocation function. The allocation functions can create a global shared space collectively or noncollectively, or a local shared space by a thread. All dynamically allocated shared space can be released using the same deallocation function.

5.1 ALLOCATING A GLOBAL SHARED MEMORY SPACE COLLECTIVELY

To allocate one global shared space collectively, upc_all_alloc() is used. The upc_all_alloc() function is a collective function that ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Stack Frames: A Look From Inside

Stack Frames: A Look From Inside

Giuseppe Di Cataldo
Scalable Shared-Memory Multiprocessing

Scalable Shared-Memory Multiprocessing

Daniel E. Lenoski, Wolf-Dietrich Weber

Publisher Resources

ISBN: 9780471220480Purchase book