Filaments Concepts

The Filaments package is a library of C code that currently runs on several different shared- and distributed-memory machines. It has been designed to support parallel scientific applications, and is intended to be a target for a compiler.

Filaments has two key abstractions: fine-grain parallelism and shared-variable communictation The fine-grain execution model can be thought of as the least common denominator for concurrency, because it supports coarse- and medium-grain tasks as well as fine-grain ones. The shared-variable model provides a simple and natural way to program.

A filament is a very lightweight thread. Each filament is an independent of unit of work, and there may be thousands in an application. There are two kinds of filaments: iterative, which are used in loop-based applications such as matrix multiplication and Jacobi iterative, and fork/join, which are used in recursive applications such as adaptive quadrature. Filaments are executed concurrently by server threads.

The distributed shared memory (DSM) system provides a logically shared memory on distributed memory machines. Hence, filaments can communicate by reading and writing shared variables; no explicit message passing is required. Filaments synchronize using barriers for iterative applications or the join primitive for recursive applications. The package also provides reduction operations, which are integrated with barrier synchronization.

The Filament package employs a number of techniques to help make it efficient. First, filaments are stackless (reducing the cost of a context switch significantly) and independent. Thus, there may be thousands and each can be executed on any node in any order. This allows the runtime system flexibility in selecting the next filament to run and facilitates load balancing. Second, the DSM is multi-threaded: When a filament faults on a non-local DSM page, it is suspended and a different filament is executed; the faulting filament is rescheduled when the page arrives. This overlaps communication and computation, and therefore, eliminates communication latency in most applications. Third, the package employs techniques such as inlining and pruning to reduce the overhead of executing filaments. Finally, a reliable datagram protocol is used to reduce buffering and copying of message data (pages) and to provide scalability.


Last modified: July 1998