{"id":14991122,"url":"https://github.com/lac-dcc/hydra","last_synced_at":"2025-04-12T03:25:36.115Z","repository":{"id":255102128,"uuid":"847934412","full_name":"lac-dcc/hydra","owner":"lac-dcc","description":"A benchmark game for guessing the hottest point of a program","archived":false,"fork":false,"pushed_at":"2025-04-09T20:49:26.000Z","size":238252,"stargazers_count":16,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T21:38:50.428Z","etag":null,"topics":["compilers","llvm","profiling"],"latest_commit_sha":null,"homepage":"https://github.com/lac-dcc/hydra","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lac-dcc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-26T20:29:15.000Z","updated_at":"2025-03-29T13:23:54.000Z","dependencies_parsed_at":"2024-08-28T02:02:57.724Z","dependency_job_id":"baad65be-bdc6-45a9-81cb-a332990832ab","html_url":"https://github.com/lac-dcc/hydra","commit_stats":{"total_commits":14,"total_committers":3,"mean_commits":4.666666666666667,"dds":0.4285714285714286,"last_synced_commit":"571c9873a5e1b1b30e05f4520352b39f16d98126"},"previous_names":["lac-dcc/hydra"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lac-dcc%2Fhydra","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lac-dcc%2Fhydra/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lac-dcc%2Fhydra/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lac-dcc%2Fhydra/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lac-dcc","download_url":"https://codeload.github.com/lac-dcc/hydra/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248511228,"owners_count":21116369,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["compilers","llvm","profiling"],"created_at":"2024-09-24T14:21:31.049Z","updated_at":"2025-04-12T03:25:31.100Z","avatar_url":"https://github.com/lac-dcc.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"Project Banner\" src=\"./assets/images/Banner.png\" width=\"95%\" height=\"auto\"/\u003e\u003c/br\u003e\n\u003c/p\u003e\n\nHydra is a collection of benchmarks and tools to test the ability of different techniques to predict the hottest spot in programs.\nEach benchmark consits of a single compilable C file that runs with one or more different inputs.\nWe provide execution counts for all the edges of each program, a [table](https://docs.google.com/spreadsheets/d/18C-DGg_l2gepRRfea_ivrW1o9qUde5fHHr6g3LIGn_I/edit?usp=sharing) that we call \"*the Ground Truth*\", plus scripts to extract and display these counts.\n\n## How to produce the ground truth\n\nYou can regenerate the ground truth (in [JSON](./JSON%20Files/jotaiMerlinResults.json)) running the script [nisse_all.sh](./Benchmark%20Scripts/Jotai/nisse_all.sh). The following dependencies are required:\n\n- Clang 17 or newer\n- A build of the [Nisse profiler](https://github.com/lac-dcc/Nisse)\n\nNow, you need to adjust some parameters that suit your environment:\n\n- In the [config.sh](./Benchmark%20Scripts/config.sh) configuration file:\n  - `LLVM_INSTALL_DIR` (line 3): must point to your LLVM installation directory\n  - `NISSE_SOURCE_DIR` (line 4): must point to your NISSE source directory\n  - `NISSE_BUILD_DIR` (line 5): must point to your NISSE build directory\n- In the [nisse_all.sh](./Benchmark%20Scripts/Jotai/nisse_all.sh) script:\n  - `BASE_DIR` (line 3): must point to your hydra (this repository) source directory\n\nWith these configurations correctly set, running the script `nisse_all.sh` must generate a file named `jotaiMerlinResults2.json` in the folder `JSON Files`. You can compare it with the `jotaiMerlinResults.json` using `diff`.\n\n## How to get the trivial heuristics results\n\nThere are two trivial heuristics implemented to guess the hottest blocks, which are:\n\n- **Random block**: a random block from the program is considered the hottest block\n- **Most nested block**: a random most nested loop header from the program is considered the hottest block\n\nIn order to run them, you must have the following requirements:\n\n- CMake version 3.20 or newer\n- Clang version 17 or newer\n\nAlso, there are some parameters to adjust:\n\n- In the [build.sh](./build.sh) script:\n  - `LLVM_INSTALL_DIR` (line 3): must point to your LLVM installation directory\n- In the [run.sh](./run.sh) script:\n  - `LLVM_INSTALL_DIR` (line 3): must point to your LLVM installation directory\n  - `BASE_DIR` (line 4): must point to your hydra (this repository) source directory\n\nWith these configurations correctly set, you must run the scripts `build.sh` and `run.sh` in this order, and it must generate the JSONs `jotaiRandomBlock2.json` and `jotaiNestedBlock2.json` in the folder `JSON Files`. Also, they can be compared with their respective original files using `diff`.\n\n## How to get the CSV table\n\nWith the `jotaiMerlinResults.json`, `jotaiRandomBlock.json` and `jotaiNestedBlock.json` files, you can generate a CSV file containing the detailed results by executing the `genCsv.py` python script.\n\n## How to pretty print a JSON file\n\nThe script `print_jotai_json.py` receives a path to the JSON file as parameter and returns a pretty print of this file. For more options, run `python3 print_jotai_json.py --help`.\n\nThe output format is as follows:\n\nEach file in the benchmark begins with its name, followed by a line with the number of executions of this file.\n\nThen, for each execution, the following structure appears:\n\n1. A line indicating the number of edges, denoted as `N`\n2. `N` subsequent lines, each containing information about an edge. The format of each line is:\n   - `u` -\u003e `v` : `count`\n   - Here, `u` and `v` represent the origin and destination blocks of the edge, respectively\n   - `count` represents the number of times this edge is traversed during the execution.\n\nThere are also two other scripts in Python that are similar to `print_jotai_json.py`:\n\n- The script `get_block_frequencies.py` takes the JSON input and compute the block frequencies based on the edges frequencies. The output is very similar to the `print_jotai_json.py` one, but for each block the output is only `u` : `count`. The critical edges blocks are omitted in the output.\n- The script `get_hottest_block.py` not only compute the frequencies, but also compute what is the hottest blocks among every block in one execution. The output of one execution is a line, indicating the number `N` of hot blocks, followed by `N` lines, each one containing an ID of a hot block in that execution.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flac-dcc%2Fhydra","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flac-dcc%2Fhydra","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flac-dcc%2Fhydra/lists"}