Coarse-Grained Parallelism Using Metaobject Protocols

Currently, there exist diierent approaches to parallelizing a computation at a coarse-grain. One approach is to parallelize a computation by placing compiler declarations in the source code. This approach makes it possible to conceptually separate the code describing a computation from the code (i.e. declarations) describing its parallelization. This approach also makes it possible to explicitly control a computation's parallelization, thereby providing an opportunity to increase the com-putation's performance. However, there are cases when it is not reasonable to expect a desired mechanism for concurrency to be supported by the available, and xed set of declarations, such as when the desired mechanism is highly specialized to a given computation and target architecture. In these cases, the declaration-based approach fails. In this thesis, we demonstrate that metaobject protocols can solve this problem. Under the metaobject protocol approach, a computation is parallelized by marking source code expressions with marks supported by the compiler. Marks, like declarations, are used to separate a computation from its parallelization. When the supported marks can not be used to express a desired mechanism for concurrency, the metaobject protocol is used to incrementally augment the compiler's parallelization strategy to support the desired mechanism. The metaobject protocol is a model of the compiler's parallelization strategy that provides the knowledge necessary to augment the strategy incrementally, without exposing arbitrary or irrelevant implementation details. In order to demonstrate the eeectiveness of the metaobject protocol-based approach, we present Anibus, a metaobject protocol-based compiler. We give several examples of using marks, and of incrementally augmenting Anibus's parallelization strategy. The examples include two implementations of the n-body gravity problem. Acknowledgments There are many people I would like to thank for helping me through this thesis. I would like to thank John Lamping for his patient guidance and his commitment. I would also like to thank Hal Abelson for driving me to do better. Special thanks go to Gregor Kiczales; for over two years he has provided plenty of good advice, opportunities, and feedback; many times without any sort of obligation to do so. Many thanks also go to John, Hal, and Gregor for great feedback on the many drafts of this thesis. I also want to thank Jim des Rivi eres for discussing ideas about the approach to writing this thesis, and for his very careful readings of drafts of this thesis. Also, thanks to their love and their dedication to my well-being have …