Explorer output

The explorer reads .discopop/profiler and writes its results to .discopop/explorer/. It removes the directory at the start of a run. Relative paths of the options below refer to the .discopop directory the explorer runs in.

.discopop/
├── explorer/
│   ├── patterns.json
│   ├── pattern_decisions.json
│   ├── detection_result_dump.json
│   ├── suggestion_extents.json
│   └── side_effects.json.gz
├── patch_generator/<pattern id>/<n>.patch
├── patch_applicator/applied_suggestions.json
├── line_mapping.json
└── next_free_pattern_id.txt

patterns.json

explorer/patterns.json (option --json) contains the detected patterns. It has the keys version, patterns and enabled_patterns; patterns maps a pattern type to a list of patterns. Only the detectors that ran appear: do_all, reduction and task by default (--enable-patterns reduction,doall,task), plus the always present, usually empty lists optimizer_output and merged_pattern. enabled_patterns lists the pattern types the detection was asked for, in the order reduction, doall, task, … (e.g. ["reduction", "doall", "task"]); the MCP server uses it to find out whether a result has to be detected again.

{
  "version": "CURRENTLY INVALID!",
  "patterns": {
    "optimizer_output": [],
    "merged_pattern": [],
    "do_all": [ { "pattern_id": 0, "node_id": "1:7", "start_line": "1:20", "...": "..." } ],
    "reduction": [ { "pattern_id": 1, "node_id": "1:12", "start_line": "1:24", "...": "..." } ],
    "task": []
  },
  "enabled_patterns": ["reduction", "doall", "task"]
}

The version field is not maintained at the moment and always contains the text CURRENTLY INVALID!. The fields of the patterns are described on the pages Parallel patterns, Do-All and Reduction. The task list holds, per task group, one entry of type TASK per task and one of type PARALLELREGION; the fields task_dependences and after_dependences (region) and shared, private, first_private (task) describe the data flow of the group and are documented there.

pattern_decisions.json

explorer/pattern_decisions.json (option --pattern-decisions; without a value nothing is recorded) lists which regions the detectors examined and what they decided. For the example:

{
 "format_version": 1,
 "detectors": { "doall_reduction": ["doall", "reduction"] },
 "decisions": [
  {
   "detector": "doall_reduction",
   "pattern_types": ["doall", "reduction"],
   "region": { "node_id": "1:7", "file_id": 1, "start_line": 20, "end_line": 22, "kind": "loop" },
   "outcome": "accepted",
   "patterns": [ { "type": "doall", "pattern_id": 0 } ],
   "reasons": []
  }
 ]
}

For a rejected region, outcome says so and reasons explains why.

detection_result_dump.json

explorer/detection_result_dump.json (option --dump-detection-result) is a jsonpickle dump of the whole detection result, including the program execution graph. It is large and meant for tools that reload the result, not for reading.

Most of the dump can be the callpath tree of the program execution graph (callpath_tree, every callpath state the profiler recorded in stateID_to_callpath_mapping.txt; for a large unpruned profile 17.9 of 18.3 GB, ~160 GB of memory when decoded). Only the task detection uses it, while the explorer runs. The autotuner and the extraction of the suggestion extents of an older dump (see below) therefore load the dump without it (discopop_library.result_classes.loading.load_detection_result): the file is streamed and only the rest is decoded, and the loaded graph fails on any use of the tree. If the tree cannot be cut out safely, the whole file is decoded as before, with a warning.

suggestion_extents.json

explorer/suggestion_extents.json is written next to the detection result dump, whenever the dump is written. It holds the source range of every suggestion (extents: pattern id -> [file id, first line, last line]; a suggestion on a loop reaches to the end of the loop) and the size and modification time of the dump it was made from (dump), so that a reader can tell whether it is current. The Amdahl ceilings of the project manager and the GUI are computed from it and hotspot_detection/Hotspots.json without decoding the dump. For a dump of an older explorer, python -m discopop_library.Amdahl.regions --extract-extents <.discopop directory> writes it.

{"format": 1, "dump": {"size": 1240552796, "mtime_ns": 1795186958053583856}, "extents": {"0": [148, 49, 50]}}

side_effects.json.gz

explorer/side_effects.json.gz is a gzip-compressed JSON export of the functions, their parameters and local variables, the dependencies with their callpath contexts, and the calls that were executed. The MCP server reads it to answer get_side_effects. The file starts with "format_version": 1; the explorer writes it with every run and removes a stale file if the export fails.

Patches

For every pattern the explorer runs the patch generator, which writes patch_generator/<pattern id>/<n>.patch (a unified diff against the source files named in FileMapping.txt):

@@ -21,6 +21,7 @@
     Arr[i] = i % 13;
   }

+  #pragma omp parallel for firstprivate(N) reduction(+:sum)
   for (int i = 0; i < N; i++) {
     sum += Arr[i];
   }

The patch applicator records the patches it applied in patch_applicator/applied_suggestions.json; before the first application the list is empty:

{"applied": []}

next_free_pattern_id.txt

The explorer takes pattern ids from next_free_pattern_id.txt (a plain number, protected by next_free_pattern_id.txt.lock) in its working directory, which is the .discopop directory. After the example run it contains 2. line_mapping.json is described on the File mapping page.


Copyright © 2026, Technical University of Darmstadt.

This site uses Just the Docs, a documentation theme for Jekyll.