Approximating the buffer allocation problem using epochs - Pedersen, Jan Bækgaard; Brodsky, Alex; Sampson, Jeffrey (Journal of parallel and distributed computing, 2008)
The correctness of applications that perform asynchronous message passing typically relies on the underlying hardware having a sufficient amount of memory (message buffers) to hold all undelivered messages—such applications may deadlock when executed on a system with an insufficient number of message buffers. Thus, determining the minimum number of buffers that an application needs to prevent deadlock is an important task when writing portable parallel applications. Unfortunately, both this problem (called the Buffer Allocation Problem) and the simpler problem of determining whether an application may deadlock for a given number of available message buffers are intractable [A. Brodsky, J. Pedersen, A. Wagner, On the complexity of buffer allocation in message passing systems, Journal of Parallel and Distributed Computing 65 (2005) 692–713]. We present a new epoch-based polynomial-time approach for approximating a solution to the Buffer Allocation Problem. Our approach partitions application executions into epochs and intersperses barrier synchronizations between them, thus limiting the number of message buffers necessary to ensure deadlock-freedom. This approach produces near optimal solutions for many common cases and can be adapted to guide application modifications that ensure deadlock-freedom when the application is executed on different systems. We describe a prototype implementation, and present an empirical evaluation of this approach. Lastly, we describe a space-time trade-off between the number of available message buffers and the number of barrier synchronizations, and describe how this trade-off can be used to fine-tune application performance.