Internal:IMR 2018 Runtime Systems

From crtc.cs.odu.edu
Jump to navigation Jump to search

Slides

Click here to download the slides.

Clusters (+ heterogenous)

Unified Parallel C (Berkeley)

Summary

Unified Parallel C (UPC) is an extension of the C programming language designed for high-performance computing on large-scale parallel machines, including those with a common global address space (SMP and NUMA) and those with distributed memory (e.g. clusters). The programmer is presented with a single shared, partitioned global address space (PGAS), where variables may be directly read and written by any processor, but each variable is physically associated with a single processor. UPC uses a single program, multiple data (SPMD) model of computation in which the amount of parallelism is fixed at program startup time, typically with a single thread of execution per processor.

Highlights

  • A number of processors working independently in an SPMD fashion (like MPI)
  • Number of processors can be set at compile or at runtime
  • Partitioned global address space (PGAS)
  • Private and shared memory space
    • Private data accessed only locally
    • Shared data can be accessed from any processor but have affinity to a single one
  • Array partitioning defined in the declaration statement
    • Can be in chunks or round robin
  • Dynamic memory allocation of shared memory is possible
    • Non-collectively: Allocates contiguous shared memory in blocks with affinity to different processors
    • Collectively: All processors call the function that will allocate memory as before, but all of them will get the same pointer
  • upc_forall: Distributes independent iterations with every thread getting a bunch of them. Can set which processor computes on what for affinity

UPC Tutorial

Global Arrays (PNLL)

Summary

Global Arrays (GA) is a Partitioned Global Address Space (PGAS) programming model. It provides blocking and non-blocking primitives for one-sided communication and Atomic Operations. It features multidimensional arrays accessed through a shared-memory programming style and applies only for array data structures. The data locality is also exposed to the user to enable more efficient computations. Global Arrays adheres to an SPMD execution model.

Highlights

  • A number of processors working independently in an SPMD fashion (like MPI)
  • Partitioned global address space (PGAS)
  • Distributed shared memory in terms of arrays
  • Global array creation assigns parts of the area to each of the nodes available
    • The user can choose the distribution
  • Workflow: Get global data -> Compute -> Put to global array
    • Communication is one-sided and is performed by respective functions
  • The user needs to handle synchronization for race conditions
  • Functions to retrieve affinity of global data
  • Array patch operations
  • Process groups can limit arrays to be shared in the group

Global Arrays Tutorial

Co-Array Fortran

Summary

Coarray Fortran (CAF), started as an extension of Fortran 95/2003 for parallel processing. The Fortran 2008 standard now includes coarrays. A CAF program presents the user a Single Program Multiple Data (SPMD) programming model where each instance is termed an image. Coarrays are arrays spread across the available images and can be accessed from any image in the system. The array syntax of Fortran is extended with additional trailing subscripts in square brackets to provide a concise representation of references to data that is spread across images.

Highlights

  • SPMD model
  • Started as an extension to Fortran, now part of the standard
  • Partitioned Global Address Space (PGAS)
  • Squared brackets as co-dimensions used to allocate and access memory in remote nodes
    • Can define partitioning using multidimensional co-dimensions
  • Can use *this_image(a)* to retrieve the partition of an array that is local to the image
  • Synchronization primitives to make sure that the most recent version of the data is accessed
  • Coarray allocation is a collective operation
  • Image teams can create disjoint groups of synchronization

Technical Report

Chapel (Cray)

Summary

Chapel, the Cascade High Productivity Language, is a parallel programming language developed by Cray. Chapel aims to improve the programmability of parallel computers, by providing a higher level of expression than current programming languages do and by improving the separation between algorithmic expression and data structure implementation details. Chapel supports a multithreaded parallel programming model at a high level by supporting abstractions for data parallelism, task parallelism, and nested parallelism. It enables optimizations for the locality of data and computation in the program via abstractions for data distribution and data-driven placement of sub-computations. It allows for code reuse and generality through object-oriented concepts and generic programming features.

Highlight

  • Task-based
  • PGAS
  • Supports both high-level abstractions and low-level control
  • Locality Control
    • The user can specify where data should be allocated or where a task should run
  • The user identifies parallelism and locality, the compiler makes the transfers
  • Task synchronization
    • Can synchronize on statements
    • Or using special variables that synchronize tasks in a producer-consumer fashion
  • Distributed arrays and domains

Chapel Overview

X10 (IBM)

Summary

X10 is a programming language being developed designed specifically for parallel computing using the partitioned global address space (PGAS) model. A computation is divided among a set of places, each of which holds some data and hosts one or more activities that operate on those data. It has a constrained type system for object-oriented programming, a form of dependent types. Other features include user-defined primitive struct types; globally distributed arrays, and structured and unstructured parallelism. X10 uses the concept of parent and child relationships for activities to prevent the deadlocks. An activity may spawn one or more child activities, which may themselves have children. Children cannot wait for a parent to finish, but a parent can wait for a child.

Highlights

  • Task-based
  • AGAS memory model
  • Based on Java programming language
  • A place in X10 is a collection of resident lightweight threads (called activities) and data
    • Multiple activities allow SMP parallelism
    • Multiple places used for distributed memory parallelism
    • Supports heterogeneous architectures.
  • The user explicitly creates activities on remote places
  • Four storage classes
    • Local to activity, data private to an activity
    • Place local, data residing in a place accessible to all activities in the same place
    • Partitioned global, data residing in a place but are accessible by all activities in all places
    • Values, immutable and stateless data
  • Distributed arrays accessed uniformly by any place
    • With different distribution options
  • 4 types of synchronization
    • Futures
    • Clocks registered with activities to create barrier-like operations in groups
    • Unconditional atomic sections. Code sections that only one activity can enter at a time
    • Conditional atomic sections. Code sections that only one activity can enter at a time when a condition holds

Paper

Charm++ (University of Illinois)

Summary

Charm++ is an explicitly parallel language based on C++ with a runtime library for supporting parallel computation called the Charm kernel. It provides a clear separation between sequential and parallel objects. The execution model of Charm++ is message-driven, thus helping one write programs that are latency tolerant. Charm++ supports dynamic load balancing while creating new work as well as periodically, based on object migration. Several dynamic load balancing strategies are provided. Charm++ supports both irregular as well as regular, data-parallel applications.

Highlights

  • Object-oriented parallel language
  • Message-driven programming model
  • Concurrent objects called chares
    • Encapsulate data
    • Have functions that can be invoked remotely through messages
  • The program starts with a single chare that can invoke the creation of others in the whole system
  • Chares have proxies on the remote nodes that are used to invoke functions on the chare's location
  • Chares can move implicitly in the system for load balancing

Charm++ User Manual

HPX (LSU)

Summary

HPX is a general purpose C\++ runtime system for parallel and distributed applications of any scale. It strives to provide a unified programming model which transparently utilizes the available resources to achieve unprecedented levels of scalability. This library strictly adheres to the C\++11 Standard and leverages the Boost C\++ Libraries which makes HPX easy to use, highly optimized, and very portable. It provides an Active Global Address Space (AGAS) which allows its objects to move around the available nodes without changing their address.

Highlights

  • Task-based
  • Active Global Address Space (AGAS)
  • Remote objects (called components) are assigned Global IDs that are addressable in the whole system
  • Parcel Subsystem for network communications
    • Implements a form of Active Messages
    • Includes the GID of the target, a function to call and its arguments
    • On the arrival of a parcel the system creates a thread and executes the function asynchronously
  • Local Control Objects (LCOs) provide a means of controlling parallelization and synchronization in HPX applications and implement latency hiding.
    • Any object that might create or reactivate a thread exposes the functionality of an LCO
      • Futures
      • Dataflow objects: Mechanism for providing data dependencies
      • Mutexes, semaphores, condition variables etc.

HPX Paper

Open Community Runtime (OCR) (Rice University, Intel)

Summary

An OCR program defines a computation as a collection of asynchronously executing tasks operating on relocatable data-blocks. Events coordinate the execution of OCR tasks; hence an OCR task is called an Event Driven Task or EDT. Logically an OCR computation is a Directed Acyclic Graph (DAG) where the nodes are OCR objects (data-blocks, events or tasks) and the edges are dependencies between objects. When the dependences of an EDT are met, the EDT is guaranteed to run at some point in the future.

Highlights

  • Task-based
  • AGAS
  • Execution model is based on a Directed Acyclic Graph (DAG)
  • All OCR objects are considered nodes in a graph
    • Having pre and post slots
      • Pre slots determine the preconditions for an OCR object to be active
      • Post slots can be connected to pre slots of other objects
    • A post-slot can be connected to multiple pre-slots
    • A pre-slot can only be connected to one post-slot
  • Tasks called Event Driven Tasks
    • Can have multiple pre slots
    • Can have only one post slot
    • Task runs when all of its pre slots are satisfied
  • Data enclosed in data blocks
    • A relocatable block of memory
    • Can be connected to the pre-slot of EDTs
    • Data made available when the EDT starts running
  • Events are the synchronization mechanism
  • The DAG is constructed explicitly by the user
    • Using functions ocrAddDepedence() and ocrEventSatisfy()

Paper

Legion (Stanford)

Summary

Legion is a data-centric parallel programming system for writing portable high-performance programs targeted at distributed heterogeneous architectures. Legion presents abstractions which allow programmers to describe properties of program data (e.g. independence, locality). By making the Legion programming system aware of the structure of program data, it can automate many of the tedious tasks programmers currently face, including correctly extracting task- and data-level parallelism and moving data around complex memory hierarchies. A novel mapping interface provides explicit programmer controlled placement of data in the memory hierarchy and assignment of tasks to processors in a way that is orthogonal to correctness, thereby enabling easy porting and tuning of Legion applications to new architectures.

Highlights

  • Task-based
  • Global address space (GAS)
  • Data are enclosed into regions
    • A relational data model
    • Supporting partitioning, slicing
    • Convey locality, independence
  • Each task must declare the regions it will use
  • Each task must declare a privilege to access a region
  • The runtime system uses this information for dependencies resolution
    • And can then run the non-conflicting tasks in parallel
  • Mapping interface
    • Allows programmer to select where tasks run and where regions are placed
  • Tasks and regions may migrate to different nodes based on load imbalance

Legion Thesis

OmpSs (Barcelona SC center)

Summary

OmpSs' objective is to extend OpenMP with new directives to support asynchronous parallelism and heterogeneity (devices like GPUs). However, it can also be understood as new directives extending other accelerator-based APIs like CUDA or OpenCL. Asynchronous parallelism is enabled in OmpSs by the use data-dependencies between the different tasks of the program. To support heterogeneity a new construct is introduced: the target construct.

Highlights

  • Task-based
  • Directive-based API
  • Parallelism offered through pragma directives
  • OpenMP extensions for task creation, heterogeneous and cluster systems support
  • Fixed number of threads
  • Active Global Address Space (AGAS)
  • User defines data dependencies using in, out and inout directives for the arguments of tasks
    • Using dependencies resolution tasks can then be executed in parallel
  • Data locations and transfers are hidden from the user
    • Between both nodes and hosts-devices
    • Communication also hidden
  • Global synchronization, synchronization on a variable, atomic operations and critical regions

OmpSs Specification

PaRSEC (Tenessee)

Summary

PaRSEC is a generic framework for architecture aware scheduling and management of micro-tasks on distributed many-core heterogeneous architectures. Applications can be expressed as a Direct Acyclic Graph of tasks with labeled edges designating data dependencies. DAGs are represented in a compact problem-size independent format that can be queried on-demand to discover data dependencies in a totally distributed fashion. PaRSEC assigns computation threads to the cores, overlaps communications and computations and uses a dynamic, fully-distributed scheduler based on architectural features such as NUMA nodes and algorithmic features such as data reuse.

Highlights

  • Task-based
  • Message Passing (implicit)
  • Algorithm is expressed as a Directed Acyclic Graph
    • Created by PaRSEC based on the task-based code
    • Parallelism is exploited by finding disjoint parts in the graph
  • PaRSEC APIs provide
    • Data distribution
    • Data organization
    • Data serialization
    • Object manipulation
  • Communication implicit, handled by the runtime
  • Allows the user to specify data affinity and movement, and task placement
  • Tools to inspect and modify the created DAG are provided
    • Also tools to analyze performance
  • Supports heterogeneous systems

Paper

AllScale (EU Universities)

Summary

A novel application model granting parallel runtime systems system-wide control over the distribution of user-defined shared data structures. It utilizes the high-level nature of parallel programming languages, in particular, the usage of well-typed data structures and the associated hiding of implementation details from the application developers. By being based on a generalization of such data structures and extending the resulting abstraction with features facilitating the automated management of the distribution of those, enables runtime systems to dynamically influence the placement and replication of shared data.

Highlights

  • Task-based
  • AGAS
  • Extends on the HPX runtime
  • Uses the abstraction of data items for all elements that are part of a data structure
    • Can be decomposed and distributed
    • Can form subsets called regions
      • Addressable by the runtime system
  • Tasks can be specified through one or more alternative implementations
    • Variants can be produced by the compiler
    • The runtime can pick which to use for performance
    • Must come to the same result
    • Recursively nested parallelism
  • Tasks need to define read/write requirements for their data
    • And then they are scheduled to the resource that the runtime decides
  • Runtime system can decide to move data (and implicitly tasks) to other nodes
    • To enable dynamic load balancing
    • Runtime system can steer execution towards:
      • Low execution time
      • Low energy consumption
  • Still under development

Paper

StarPU (Inria)

Summary

A simple tasking API that provides numerical kernel designers with a convenient way to execute parallel tasks over the heterogeneous hardware on the one hand, and easily develop and tune powerful scheduling algorithms on the other hand. StarPU is based on the integration of the data-management facility with a task execution engine. We demonstrate the relevance of our approach by showing how heterogeneous parallel versions of some numerical kernels were developed together with advanced scheduling policies.

Highlights

  • In node parallelism
  • Supports both SMPs and GPUs
  • Data are registered with handles, then used
    • Runtime can then automate the transfers needed
  • Tasks are defined as codelets
    • Abstractions that define different implementations of a task for different architectures
    • Dependencies and data access privileges defined here also
  • Codelets are then pushed to the task pool and the runtime system can infer the directed acyclic graph (DAG) to schedule them
  • Customizable scheduling policies
  • Scheduling hints
  • Debugging and profiling tools

Paper

CPU-GPU only (no distributed memory)

Kokkos (Sandia)

Summary

Kokkos implements a programming model in C++ for writing performance portable applications targeting all major HPC platforms. For that purpose, it provides abstractions for both parallel execution of code and data management. Kokkos is designed to target complex node architectures with N-level memory hierarchies and multiple types of execution resources. It currently can use OpenMP, Pthreads, and CUDA as backend programming models.

Highlights

  • In node parallelism only
  • Supports both SMPs and GPUs
    • Can run simultaneously on both technologies
  • Targets code reuse, run the same code for both CPUs and GPUs
    • Just by switching a flag
  • Views memory abstraction
    • Data defined as views will be mapped efficiently to the hardware where they will reside
    • No need to change data layout depending on the architecture the application is running (e.g arrays of structs vs structs of arrays)
    • Can map legacy data structures to views for efficiency. Has to be done manually
  • Mirror views to transfer data from host to device and vice-versa
  • Use Functors or C\++11 lambdas to schedule parallel work
    • Arguments are part of the Functor and are copied implicitly to the device
  • The device can be Cuda, Pthreads or OpenMP
  • Parallel_for,reduce,scan functionalities
  • Thread teams

Tutorial1Tutorial2

Shared memory only

Open Multi-Processing (OpenMP v4.5)

Summary

OpenMP is an Application Program Interface (API), jointly defined by a group of major computer hardware and software vendors. OpenMP provides a portable, scalable model for developers of shared memory parallel applications. The API supports C/C++ and Fortran on a wide variety of architectures. Parallelism is defined mainly using directives that the compiler transforms into parallel code. The initial specification of OpenMP focused on parallelizing for loops in a fork-join model but has been extended greatly to support task-based parallelism and heterogeneous architectures.

Highlights

  • Directive-based API
  • Thread creation pragmas
  • Loop parallelization
    • Different distribution policies
  • Reductions
  • Task creation
    • Dependencies based on in-out data arguments
  • Synchronization directives
  • Atomic operations
  • target clause allows offloading computations to accelerators or vectorization hardware
  • Teams of threads available

Specification

Threading Building Blocks (Intel)

Summary

A Threading Building Blocks TBB program creates, synchronizes and destroys graphs of dependent tasks according to algorithms. Tasks are then executed respecting graph dependencies. This approach groups TBB in a family of solutions for parallel programming aiming to decouple the programming from the particulars of the underlying machine. TBB implements work stealing to balance a parallel workload across available processing cores in order to increase core utilization and therefore scaling. Initially, the workload is evenly divided among the available processor cores. If one core completes its work while other cores still have a significant amount of work in their queue, TBB reassigns some of the work from one of the busy cores to the idle core

    • Highlights**
  • Task-based
    • Tasks can be used explicitly or implicitly
  • Many parallel loop based operations (parallel_for, reduce, scan)
  • Concurrent containers queue, priority queue, vector, hashmap
  • Memory allocator
  • Mutual exclusion and atomic operations
  • Customizable scheduler
  • Library based on C\++ templates
  • Automatic load balancing

Tutorial

Cilk Plus (MIT, Intel)(Deprecated)

Summary

Cilk, Cilk++, and Cilk Plus are general-purpose programming languages designed for multithreaded parallel computing. They are based on the C and C++ programming languages, which they extend with constructs to express parallel loops and the fork-join idiom. Cilk Plus offers great performance in multi-core environments using few but powerful semantics.

Highlights

  • Parallel loop based operation cilk_for
  • Parallel task creation operation cilk_spawn
  • Multiple reduce operations (max,min,list_append,etc...)
  • Array notations provide vectorization semantics A[:] = B[:]+y[:]
  • Tools for race detection and scalability analysis

Tutorial