31

Cilkmem: Algorithms for Analyzing the Memory High-Water Mark of Fork-Join Parallel Programs

SIAM Symposium on Algorithmic Principles of Computer Systems (SAPCS), 2019
Abstract

Software engineers designing recursive fork-join programs destined to run on massively parallel computing systems must be cognizant of how their program's memory requirements scale in a many-processor execution. Although tools exist for measuring memory usage during one particular execution of a parallel program, such tools cannot bound the worst-case memory usage over all possible parallel executions. This paper introduces Cilkmem, a tool that analyzes the execution of a deterministic Cilk program to determine its pp-processor memory high-water mark (MHWM), which is the worst-case memory usage of the program over \emph{all possible} pp-processor executions. Cilkmem employs two new algorithms for computing the pp-processor MHWM. The first algorithm calculates the exact pp-processor MHWM in O(T1p)O(T_1 \cdot p) time, where T1T_1 is the total work of the program. The second algorithm solves, in O(T1)O(T_1) time, the approximate threshold problem, which asks, for a given memory threshold MM, whether the pp-processor MHWM exceeds M/2M/2 or whether it is guaranteed to be less than MM. Both algorithms are memory efficient, requiring O(pD)O(p \cdot D) and O(D)O(D) space, respectively, where DD is the maximum call-stack depth of the program's execution on a single thread. Our empirical studies show that Cilkmem generally exhibits low overheads. Across ten application benchmarks from the Cilkbench suite, the exact algorithm incurs a geometric-mean multiplicative overhead of 1.541.54 for p=128p=128, whereas the approximation-threshold algorithm incurs an overhead of 1.361.36 independent of pp. In addition, we use Cilkmem to reveal and diagnose a previously unknown issue in a large image-alignment program contributing to unexpectedly high memory usage under parallel executions.

View on arXiv
Comments on this paper