Equivalence Checker

November 4, 2019 ยท View on GitHub

Summary

Equivalence checker is a C++ parser able to read and process the JSON representation of files and loops provided by AutoParBench. It can evaluate equivalent JSON files, or join two json files into one (using the parallel representation of both to improve the coverage of the JSON). This parser can provide a detailed comparison of two loops also.

This parser was tested on Ubuntu 18.04, using GCC-8. However, mirror changes maybe are necessary to run it in your local machine.

Compilation Process

Users are able to compile this parser using a C++ compiler. The following example is using G++-8 to compile this parser. To compile OpenMP Extractor, please, follow the steps.

  • Open your terminal.
  • Go to the top lever directory of this repository.
  • Type the following commands into your terminal:
g++-8 tools/EquivalenceChecker/equivalence_checker.h tools/EquivalenceChecker/equivalence_checker.cpp -o equivalence_checker.out

After using it, we encorage you to remove the executable file.

Running Equivalence Checker

Equivalence Checker contains few flags to use. The goal is to do necessary steps to provide the best baseline possible or classify parallel OpenMP code in a Loop granularity comparing a reference (manually parallelized, provided by a tool, or files containing both representations, as our ground truth).

Classification

This tool provides a classification for loops in a JSON representation. The possible labels are the foolowing:

FlagMeaning
True PositiveA loop parallelized in a similar way in both versions, the reference is equivalent to the one generated by the tool.
False PositiveThe loop in the reference is sequential, however, the tool is able to parallelize it.
True NegativeA loop is sequential in both versions, in the reference and in the one generated by the tool.
False NegativeA loop parallelized in the reference but it is sequential in the version generated by the tool.
Different ParallelizationA loop is parallelized in by the tool with differences when comparing with the reference.
N/AThe loop exists in the reference but it was not found in the JSON that represents the tool

Step by Step use

Equivalence Checker provide different facilites to use JSON based OpenMP representation. They are:

  • -check: Classifies two versions of the same loop, and provide a classification like the one described in the previsous section.
  • -check-detailed : Privide a classification in debug mode, showing differences between two different JSON objects that represents some code snippet in the source file.
  • -report-check : Provide the same classification with more details to easily check the loop in the manual version.
  • -join : This flag provides a way to join two JSON files in one. The objects in the first JSON file are used as first option, then, if the loop is assinged as sequential in this version, uses the second JSON file to certify if the loop could be parallelized, and uses this version. Case a loop is not parallel in both versions, the tool will assing it as sequential.