SHMEM explained

SHMEM (from Cray Research's “shared memory” library) is a family of parallel programming libraries, providing one-sided, RDMA, parallel-processing interfaces for low-latency distributed-memory supercomputers. The SHMEM acronym was subsequently reverse engineered to mean "Symmetric Hierarchical MEMory”. Later it was expanded to distributed memory parallel computer clusters, and is used as parallel programming interface or as low-level interface to build partitioned global address space (PGAS) systems and languages.[1] “Libsma”, the first SHMEM library, was created by Richard Smith at Cray Research in 1993 as a set of thin interfaces to access the CRAY T3D's inter-processor-communication hardware. SHMEM has been implemented by Cray Research, SGI, Cray Inc., Quadrics, HP, GSHMEM, IBM, QLogic, Mellanox, Universities of Houston and Florida; there is also open-source OpenSHMEM.[2]

SHMEM laid the foundations for low-latency (sub-microsecond) one-sided communication.[3] After its use on the CRAY T3E,[4] its popularity waned as few machines could deliver the near-microsecond latencies necessary to maintain efficiency for its hallmark individual-word communication. With the advent of popular sub-microsecond interconnects, SHMEM has been used to address the necessity of hyper-efficient, portable, parallel-communication methods for exascale computing.[5]

Programs written using SHMEM can be started on several computers, connected together with some high-performance network, supported by used SHMEM library. Every computer runs a copy of a program (SPMD); each copy is called PE (processing element). PEs can ask the SHMEM library to do remote memory-access operations, like reading ("shmem_get" operation) or writing ("shmem_put" operation) data. Peer-to-peer operations are one-sided, which means that no active cooperation from remote thread is needed to complete the action (but it can poll its local memory for changes using "shmem_wait"). Operations can be done on short types like bytes or words, or on longer datatypes like arrays, sometimes evenly strided or indexed (only some elements of array are sent). For short datatypes, SHMEM can do atomic operations (CAS, fetch and add, atomic increment, etc.) even in remote memory. Also there are two different synchronization methods:[2] task control sync (barriers and locks) and functions to enforce memory fencing and ordering. SHMEM has several collective operations, which should be started by all PEs, like reductions, broadcast, collect.

Every PE has some of its memory declared as "symmetric" segment (or shared memory area) and other memory is private. Only "shared" memory can be accessed in one-sided operation from remote PEs. Programmers can use static-memory constructs or shmalloc/shfree routines to create objects with symmetric address that span the PEs.

Typical SHMEM functions

List of SHMEM implementations

OpenSHMEM implementations

OpenSHMEM is a standard effort by SGI and Open Source Software Solutions, Inc.

Disadvantages

In first years SHMEM was accessible only on some Cray Research machines (later additionally on SGI)[11] equipped with special networks, limiting library widespread and being vendor lock-in (for example, Cray Research recommended to partially rewrite MPI programs to combine both MPI and shmem calls, which make the program non-portable to other clear-MPI environment).

SHMEM was not defined as standard,[11] so there were created several incompatible variants of SHMEM libraries by other vendors. Libraries had different include file names, different management function names for starting PEs or getting current PE id, and some functions were changed or not supported.

Some SHMEM routines were designed according to Cray T3D architecture limitations, for example reductions and broadcasts could be started only on subsets of PEs with size being power of two.[12]

Variants of SHMEM libraries can run on top of any MPI library, even when a cluster has only non-RDMA optimized Ethernet, however the performance will be typically worse than other enhanced networking protocols.

Memory in shared region should be allocated using special functions (/), not with the system .

SHMEM is available only for C and Fortran (some versions also to C++).[13]

Many disadvantages of SHMEM have been overcome with the use of OpenSHMEM on popular sub-microsecond interconnects, driven by exascale development.

See also

Further reading

External links

Notes and References

  1. Web site: New Accelerations for Parallel Programming. 2012. Mellanox. 18 January 2014. SHMEM is being used/proposed as a lower level interface for PGAS implementations.
  2. Book: Poole, Stephen. Encyclopedia of Parallel Computing . OpenSHMEM - Toward a Unified RMA Model . 2011. 1379–1391. 10.1007/978-0-387-09766-4_490. 978-0-387-09765-7.
  3. http://users.sdsc.edu/~lcarring/Papers/2012_CUG.pdf Tools for Benchmarking, Tracing, and Simulating SHMEM Applications
  4. https://books.google.com/books?id=eeNswgpkBW4C&pg=PA59&dq=%22SHMEM%22+popular Recent Advances in Parallel Virtual Machine and Message Passing ..., Volume 11
  5. Web site: OpenSHMEM 2015. www.csm.ornl.gov. 2017-04-10.
  6. http://docs.sgi.com/library/tpl/cgi-bin/getdoc.cgi?coll=linux&db=man&fname=/usr/share/catman/man3/shmem_get.3.html man shmem_get
  7. http://staff.psc.edu/oneal/compaq/ShmemMan.pdf Shmem Programming Manual
  8. https://www.open-mpi.org OpenMPI
  9. James Ross and David Richie. An OpenSHMEM Implementation for the Adapteva Epiphany Coprocessor. In Proceedings of the Third Workshop on OpenSHMEM and Related Technologies, Web site: OpenSHMEM 2016. www.csm.ornl.gov. . Springer, 2016.
  10. https://github.com/Sandia-OpenSHMEM/SOS Sandia OpenSHMEM (SOS) on Github
  11. http://docs.cray.com/books/004-2178-002/06chap3.pdf SHMEM
  12. http://courses.cs.washington.edu/courses/cse590o/02wi/otherapproaches.pdf Introduction to Parallel Computing - 3.11 Related Work
  13. http://www2.cs.uh.edu/~tonyc/pgas12/openshmem-tutorial/pgas-2012-slides.pdf OpenSHMEM TUTORIAL