Safer Parallelization

This page supplies additional material for the paper “Safer Parallelization”, submitted to ISoLA 2020.

Abstract. Adapting sequential legacy software to parallel environments not only saves time and money, but additionally avoids losing valuable domain knowledge hidden in existing code. One useful parallelization approach is the detection of standardized parallel design patterns which allow making best use of parallel programming interfaces like OpenMP. When these patterns are not literally present, it can be necessary to apply code transformations to suitably re-shape the input program. In this paper, we describe how we used Abstract Execution, a semi-automatic program proving technique for second-order program properties, to formally prove conditional correctness of the restructuring techniques CU Elimination, Loop Splitting and Geometric Decomposition – for all input programs. The former two techniques require an advanced modeling technique based on families of abstract location sets.

REFINITY and Restructuring Models

The archive linked above contains the current KeY version with REFINITY, the three transformation models discussed in the paper, as well as a (Linux) script replayProofs.sh to replay all closed proofs in batch mode. REFINITY models have the file ending ".aer", proof (bundles) the ending ".zproof". REFINITY models can be opened from within KeY and the REFINITY window, proofs have to be loaded directly in KeY. For instructions on how to run KeY/REFINITY and system prerequisites, we refer to the REFINITY webpage.

Note: When loading longer proofs, such as the one for Geometric Decomposition, it might happen that you get a StackOverflowError. This is an uncritical bug related to recent versions of the KeY user interface, and should not prevent the system from completely loading and displaying the chosen proof, and being fully functional afterward.

Proof Statistics

In the following, we show the detailed statistics for the proofs of our transformation schemata. "Block/Loop Contract apps" are in fact applications of constraints defined in the models; internally, they are encoded as "block contracts".

Concerning interactive (manual) applications, "instAll" and "allLeftHide" are both quantifier instantiations for universal assumptions. Case distinctions on the truth values of formulas are realized using "cut_direct" applications. Real, user-defined cuts (on-the fly lemmas) are introduced by "cut" applications.

CU Elimination

Nodes994
Branches9
Interactive steps0
Symbolic execution steps28
Automode time6,054 ms
Avg. time per step6.096 ms
Rule applications
Quantifier instantiations1
One-step Simplifier apps0
SMT solver apps0
Dependency Contract apps0
Operation Contract apps0
Block/Loop Contract apps2
Loop invariant apps0
Abstract Execution apps4
Merge Rule apps0
Total rule apps993

Loop Splitting

Nodes15,599
Branches86
Interactive steps23
Symbolic execution steps158
Automode time295.9s
Automode time29,5965 ms
Avg. time per step18.974 ms
Rule applications
Quantifier instantiations113
One-step Simplifier apps0
SMT solver apps0
Dependency Contract apps0
Operation Contract apps0
Block/Loop Contract apps10
Loop invariant apps3
Abstract Execution apps5
Merge Rule apps0
Total rule apps15,598
Details on Interactive Apps
cut8
instAll7
hide_left5
hide_right2
allLeftHide1

Geometric Decomposition

Nodes84,209
Branches360
Interactive steps215
Symbolic execution steps175
Automode time38min
Automode time2337083ms
Avg. time per step27.753ms
Rule applications
Quantifier instantiations173
One-step Simplifier apps0
SMT solver apps0
Dependency Contract apps0
Operation Contract apps0
Block/Loop Contract apps8
Loop invariant apps3
Abstract Execution apps3
Merge Rule apps0
Total rule apps84,208
Details on Interactive Apps
hide_left36
cut_direct29
instAll24
cut23
hide_right21
ifthenelse_true17
jdiv_axiom_inline17
replace_known_left17
div_axiom_positive6
applyEqRigid4
allLeftHide2
allRight2
applyEqReverse2
concrete_and_32
concrete_or_42
hideAuxiliaryEqConcrete2
andRight1
applyEq1
auto_int_induction_geqZero1
concrete_and_11
concrete_or_21
ifthenelse_split_for1
orLeft1
pullOut1
replace_known_right1