5. Dynamic Shared Memory Allocation
Published Online: 27 JAN 2005
Copyright © 2005 John Wiley & Sons, Inc.
UPC: Distributed Shared Memory Programming
How to Cite
El-Ghazawi, T., Carlson, W., Sterling, T. and Yelick, K. (2005) Dynamic Shared Memory Allocation, in UPC: Distributed Shared Memory Programming, John Wiley & Sons, Inc., Hoboken, NJ, USA. doi: 10.1002/0471478369.ch5
- Published Online: 27 JAN 2005
- Published Print: 13 MAY 2005
Book Series Editors:
- Albert Y. Zomaya
Print ISBN: 9780471220480
Online ISBN: 9780471478362
- global shared memory space;
- local shared spaces;
In this chapter we discussed the three different ways to allocate shared storage space under UPC. The function upc_all_alloc() is a collective function that is called by all threads and allocates one shared space and returns one pointer to the allocated space to the threads. The function upc_global_alloc() is a non collective version of the upc_all_alloc(). Each calling thread gets a separate shared space and is returned a different shared pointer to that space. Finally, upc_alloc() is a non collective function. When called, each calling thread gets a pointer to a shared space with affinity to the calling thread, and a different pointer is returned to each calling thread. To free the previously allocated space, one can use upc_free().