codegreen 0.3.0__tar.gz → 0.3.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- codegreen-0.3.2/CMakeLists.txt +113 -0
- {codegreen-0.3.0/codegreen.egg-info → codegreen-0.3.2}/PKG-INFO +10 -4
- {codegreen-0.3.0 → codegreen-0.3.2}/README.md +8 -3
- {codegreen-0.3.0 → codegreen-0.3.2}/benchmark/profilers.py +68 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/benchmark/suites/__init__.py +4 -0
- codegreen-0.3.2/benchmark/suites/dacapo.py +45 -0
- codegreen-0.3.2/benchmark/suites/renaissance.py +48 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/codegreen/__init__.py +1 -1
- {codegreen-0.3.0 → codegreen-0.3.2}/codegreen/cli/cli.py +42 -21
- {codegreen-0.3.0 → codegreen-0.3.2/codegreen.egg-info}/PKG-INFO +10 -4
- {codegreen-0.3.0 → codegreen-0.3.2}/codegreen.egg-info/SOURCES.txt +2 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/pyproject.toml +4 -1
- {codegreen-0.3.0 → codegreen-0.3.2}/setup.py +5 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/tests/test_instrumentation.py +2 -3
- codegreen-0.3.0/CMakeLists.txt +0 -336
- {codegreen-0.3.0 → codegreen-0.3.2}/LICENSE +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/MANIFEST.in +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/benchmark/__init__.py +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/benchmark/__main__.py +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/benchmark/compilers.py +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/benchmark/config.py +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/benchmark/harness.py +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/benchmark/results.py +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/benchmark/suites/base.py +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/benchmark/suites/benchmarksgame.py +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/benchmark/suites/perfopt.py +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/benchmark/validation/__init__.py +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/benchmark/validation/analysis.py +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/benchmark/validation/experiments.py +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/benchmark/validation/reporting.py +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/codegreen/analysis/__init__.py +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/codegreen/analysis/_ts_java.py +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/codegreen/analysis/cfg/__init__.py +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/codegreen/analysis/cfg/builder.py +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/codegreen/analysis/cfg/callgraph.py +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/codegreen/analysis/cfg/dataflow.py +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/codegreen/analysis/cfg/energy_flow.py +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/codegreen/analysis/cfg/features.py +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/codegreen/analysis/cfg/pdg.py +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/codegreen/analysis/cfg/types.py +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/codegreen/analysis/cfg/visualization.py +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/codegreen/analyzer/__init__.py +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/codegreen/analyzer/plot.py +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/codegreen/cli/__init__.py +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/codegreen/cli/entrypoint.py +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/codegreen/config.json +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/codegreen/instrumentation/__init__.py +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/codegreen/instrumentation/ast_processor.py +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/codegreen/instrumentation/bridge_analyze.py +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/codegreen/instrumentation/bridge_instrument.py +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/codegreen/instrumentation/config.py +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/codegreen/instrumentation/configs/TEMPLATE.json +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/codegreen/instrumentation/configs/c.json +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/codegreen/instrumentation/configs/cpp.json +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/codegreen/instrumentation/configs/java.json +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/codegreen/instrumentation/configs/javascript.json +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/codegreen/instrumentation/configs/python.json +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/codegreen/instrumentation/engine.py +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/codegreen/instrumentation/language_configs.py +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/codegreen/instrumentation/language_engine.py +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/codegreen/instrumentation/language_runtimes/c/codegreen_runtime.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/codegreen/instrumentation/language_runtimes/cpp/codegreen/runtime.hpp +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/codegreen/instrumentation/language_runtimes/java/codegreen/runtime/CodeGreenRuntime.java +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/codegreen/instrumentation/language_runtimes/java/codegreen/runtime/CodeGreenStandaloneRuntime.java +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/codegreen/instrumentation/language_runtimes/python/codegreen_runtime.py +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/codegreen/utils/__init__.py +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/codegreen/utils/binary.py +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/codegreen/utils/platform.py +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/codegreen.egg-info/dependency_links.txt +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/codegreen.egg-info/entry_points.txt +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/codegreen.egg-info/not-zip-safe +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/codegreen.egg-info/requires.txt +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/codegreen.egg-info/top_level.txt +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/requirements.txt +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/setup.cfg +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/Programming-Language-Benchmarks/bench/algorithm/binarytrees/2.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/Programming-Language-Benchmarks/bench/algorithm/helloworld/1.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/Programming-Language-Benchmarks/bench/algorithm/knucleotide/1.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/Programming-Language-Benchmarks/bench/algorithm/mandelbrot/1-ffi.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/Programming-Language-Benchmarks/bench/algorithm/mandelbrot/1-mffi.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/Programming-Language-Benchmarks/bench/algorithm/nbody/2.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/Programming-Language-Benchmarks/bench/algorithm/nbody/5.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/Programming-Language-Benchmarks/bench/algorithm/nbody/8-i.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/Programming-Language-Benchmarks/bench/algorithm/nsieve/1.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/Programming-Language-Benchmarks/bench/algorithm/spectral-norm/3.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/Programming-Language-Benchmarks/bench/algorithm/spectral-norm/4.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/Programming-Language-Benchmarks/bench/algorithm/spectral-norm/5-im.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/Programming-Language-Benchmarks/bench/algorithm/spectral-norm/6-im.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/nvim-treesitter/tests/indent/c/aligned_indent.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/nvim-treesitter/tests/indent/c/array.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/nvim-treesitter/tests/indent/c/comment.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/nvim-treesitter/tests/indent/c/compound_lit.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/nvim-treesitter/tests/indent/c/cond.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/nvim-treesitter/tests/indent/c/enum.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/nvim-treesitter/tests/indent/c/expr.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/nvim-treesitter/tests/indent/c/func.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/nvim-treesitter/tests/indent/c/if_else.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/nvim-treesitter/tests/indent/c/issue-1568.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/nvim-treesitter/tests/indent/c/issue-2086.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/nvim-treesitter/tests/indent/c/issue-4079.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/nvim-treesitter/tests/indent/c/issue-4117.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/nvim-treesitter/tests/indent/c/issue-4525.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/nvim-treesitter/tests/indent/c/label.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/nvim-treesitter/tests/indent/c/loop.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/nvim-treesitter/tests/indent/c/no_braces.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/nvim-treesitter/tests/indent/c/preproc_cond.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/nvim-treesitter/tests/indent/c/preproc_func.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/nvim-treesitter/tests/indent/c/string.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/nvim-treesitter/tests/indent/c/struct.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/nvim-treesitter/tests/indent/c/switch.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/nvim-treesitter/tests/indent/c/ternary.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/nvim-treesitter/tests/indent/c/unfinished_comment.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/nvim-treesitter/tests/query/highlights/c/enums-as-constants.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/crates/cli/src/templates/PARSER_NAME.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/crates/cli/src/templates/py-binding.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/crates/generate/src/templates/alloc.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/crates/generate/src/templates/array.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/crates/highlight/include/tree_sitter/highlight.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/crates/tags/include/tree_sitter/tags.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/lib/CMakeLists.txt +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/lib/binding_web/lib/tree-sitter.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/lib/include/tree_sitter/api.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/lib/src/alloc.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/lib/src/alloc.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/lib/src/array.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/lib/src/atomic.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/lib/src/clock.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/lib/src/error_costs.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/lib/src/get_changed_ranges.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/lib/src/get_changed_ranges.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/lib/src/host.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/lib/src/language.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/lib/src/language.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/lib/src/length.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/lib/src/lexer.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/lib/src/lexer.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/lib/src/lib.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/lib/src/node.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/lib/src/parser.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/lib/src/parser.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/lib/src/point.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/lib/src/portable/endian.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/lib/src/query.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/lib/src/reduce_action.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/lib/src/reusable_node.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/lib/src/stack.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/lib/src/stack.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/lib/src/subtree.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/lib/src/subtree.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/lib/src/tree.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/lib/src/tree.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/lib/src/tree_cursor.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/lib/src/tree_cursor.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/lib/src/ts_assert.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/lib/src/unicode/ptypes.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/lib/src/unicode/umachine.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/lib/src/unicode/urename.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/lib/src/unicode/utf.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/lib/src/unicode/utf16.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/lib/src/unicode/utf8.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/lib/src/unicode.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/lib/src/wasm/stdlib.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/lib/src/wasm/wasm-stdlib.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/lib/src/wasm_store.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/lib/src/wasm_store.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/test/fixtures/test_grammars/depends_on_column/scanner.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/test/fixtures/test_grammars/epsilon_external_extra_tokens/scanner.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/test/fixtures/test_grammars/epsilon_external_tokens/scanner.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/test/fixtures/test_grammars/external_and_internal_anonymous_tokens/scanner.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/test/fixtures/test_grammars/external_and_internal_tokens/scanner.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/test/fixtures/test_grammars/external_extra_tokens/scanner.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/test/fixtures/test_grammars/external_tokens/scanner.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/test/fixtures/test_grammars/external_unicode_column_alignment/scanner.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/test/fixtures/test_grammars/get_col_eof/scanner.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/test/fixtures/test_grammars/get_col_should_hang_not_crash/scanner.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/test/fixtures/test_grammars/inverted_external_token/scanner.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter/test/fixtures/test_grammars/uses_current_column/scanner.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter-c/CMakeLists.txt +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter-c/bindings/c/tree_sitter/tree-sitter-c.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter-c/bindings/python/tree_sitter_c/binding.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter-c/bindings/swift/TreeSitterC/c.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter-c/examples/cluster.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter-c/examples/malloc.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter-c/examples/parser.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter-c/src/parser.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter-c/src/tree_sitter/alloc.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter-c/src/tree_sitter/array.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter-c/src/tree_sitter/parser.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter-c/test/highlight/keywords.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter-c/test/highlight/names.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter-cpp/CMakeLists.txt +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter-cpp/bindings/c/tree-sitter-cpp.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter-cpp/bindings/python/tree_sitter_cpp/binding.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter-cpp/bindings/swift/TreeSitterCPP/cpp.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter-cpp/examples/marker-index.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter-cpp/src/parser.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter-cpp/src/scanner.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter-cpp/src/tree_sitter/alloc.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter-cpp/src/tree_sitter/array.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter-cpp/src/tree_sitter/parser.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter-java/CMakeLists.txt +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter-java/bindings/c/tree-sitter-java.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter-java/bindings/python/tree_sitter_java/binding.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter-java/bindings/swift/TreeSitterJava/java.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter-java/src/parser.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter-java/src/tree_sitter/alloc.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter-java/src/tree_sitter/array.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter-java/src/tree_sitter/parser.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter-python/CMakeLists.txt +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter-python/bindings/c/tree-sitter-python.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter-python/bindings/python/tree_sitter_python/binding.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter-python/bindings/swift/TreeSitterPython/python.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter-python/src/parser.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter-python/src/scanner.c +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter-python/src/tree_sitter/alloc.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter-python/src/tree_sitter/array.h +0 -0
- {codegreen-0.3.0 → codegreen-0.3.2}/third_party/tree-sitter-python/src/tree_sitter/parser.h +0 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
cmake_minimum_required(VERSION 3.16)
|
|
2
|
+
project(CodeGreen VERSION 0.3.0 LANGUAGES CXX)
|
|
3
|
+
|
|
4
|
+
set(CMAKE_CXX_STANDARD 17)
|
|
5
|
+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
6
|
+
|
|
7
|
+
if(NOT CMAKE_BUILD_TYPE)
|
|
8
|
+
set(CMAKE_BUILD_TYPE Release)
|
|
9
|
+
endif()
|
|
10
|
+
|
|
11
|
+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
|
12
|
+
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
|
13
|
+
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
|
14
|
+
|
|
15
|
+
find_package(PkgConfig)
|
|
16
|
+
find_package(Threads REQUIRED)
|
|
17
|
+
|
|
18
|
+
# Optional GPU library detection
|
|
19
|
+
find_library(NVML_LIBRARY nvidia-ml PATHS /usr/local/cuda/lib64 /usr/lib/x86_64-linux-gnu)
|
|
20
|
+
find_path(NVML_INCLUDE_DIR nvml.h PATHS /usr/local/cuda/include /usr/include/nvidia/gdk)
|
|
21
|
+
find_library(ROCM_SMI_LIBRARY rocm_smi64 PATHS /opt/rocm/lib)
|
|
22
|
+
find_path(ROCM_SMI_INCLUDE_DIR rocm_smi.h PATHS /opt/rocm/include/rocm_smi)
|
|
23
|
+
|
|
24
|
+
if(NVML_LIBRARY AND NVML_INCLUDE_DIR)
|
|
25
|
+
message(STATUS "NVML found: ${NVML_LIBRARY}")
|
|
26
|
+
set(HAVE_NVML ON)
|
|
27
|
+
else()
|
|
28
|
+
set(HAVE_NVML OFF)
|
|
29
|
+
endif()
|
|
30
|
+
|
|
31
|
+
if(ROCM_SMI_LIBRARY AND ROCM_SMI_INCLUDE_DIR)
|
|
32
|
+
message(STATUS "ROCm SMI found: ${ROCM_SMI_LIBRARY}")
|
|
33
|
+
set(HAVE_ROCM_SMI ON)
|
|
34
|
+
else()
|
|
35
|
+
set(HAVE_ROCM_SMI OFF)
|
|
36
|
+
endif()
|
|
37
|
+
|
|
38
|
+
# Global include directories
|
|
39
|
+
include_directories(${CMAKE_SOURCE_DIR}/codegreen/measurement/include)
|
|
40
|
+
|
|
41
|
+
# Tree-sitter (for C++ instrumentation runtime, if submodules present)
|
|
42
|
+
if(EXISTS "${CMAKE_SOURCE_DIR}/third_party/tree-sitter/lib/CMakeLists.txt")
|
|
43
|
+
include_directories(${CMAKE_SOURCE_DIR}/third_party/tree-sitter/lib/include)
|
|
44
|
+
add_subdirectory(third_party/tree-sitter/lib)
|
|
45
|
+
if(EXISTS "${CMAKE_SOURCE_DIR}/third_party/tree-sitter-python/CMakeLists.txt")
|
|
46
|
+
add_subdirectory(third_party/tree-sitter-python EXCLUDE_FROM_ALL)
|
|
47
|
+
endif()
|
|
48
|
+
endif()
|
|
49
|
+
|
|
50
|
+
# NEMB -- the only native component
|
|
51
|
+
add_subdirectory(codegreen/measurement)
|
|
52
|
+
|
|
53
|
+
# Sync instrumentation files to build dir (for C/C++/Java runtime headers)
|
|
54
|
+
file(MAKE_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/runtime)
|
|
55
|
+
file(MAKE_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/python/instrumentation)
|
|
56
|
+
|
|
57
|
+
add_custom_target(sync_instrumentation
|
|
58
|
+
COMMAND ${CMAKE_COMMAND} -E copy
|
|
59
|
+
${CMAKE_SOURCE_DIR}/codegreen/instrumentation/language_runtimes/python/codegreen_runtime.py
|
|
60
|
+
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/runtime/codegreen_runtime.py
|
|
61
|
+
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
|
62
|
+
${CMAKE_SOURCE_DIR}/codegreen/instrumentation/language_runtimes
|
|
63
|
+
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/python/instrumentation/language_runtimes
|
|
64
|
+
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
|
65
|
+
${CMAKE_SOURCE_DIR}/codegreen/instrumentation/configs
|
|
66
|
+
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/python/instrumentation/configs
|
|
67
|
+
COMMENT "Syncing instrumentation files to build directory"
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
add_dependencies(codegreen-nemb sync_instrumentation)
|
|
71
|
+
|
|
72
|
+
# Copy config to build dir
|
|
73
|
+
if(EXISTS "${CMAKE_SOURCE_DIR}/config/codegreen.json")
|
|
74
|
+
file(MAKE_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/config)
|
|
75
|
+
configure_file(
|
|
76
|
+
${CMAKE_SOURCE_DIR}/config/codegreen.json
|
|
77
|
+
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/config/codegreen.json
|
|
78
|
+
COPYONLY
|
|
79
|
+
)
|
|
80
|
+
endif()
|
|
81
|
+
|
|
82
|
+
# Dev-install: copy NEMB library to project root for pip editable installs
|
|
83
|
+
add_custom_target(dev-install ALL
|
|
84
|
+
DEPENDS codegreen-nemb
|
|
85
|
+
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_SOURCE_DIR}/lib
|
|
86
|
+
COMMAND ${CMAKE_COMMAND} -E copy
|
|
87
|
+
$<TARGET_FILE:codegreen-nemb>
|
|
88
|
+
${CMAKE_SOURCE_DIR}/lib/
|
|
89
|
+
COMMENT "Dev-install: copying NEMB to ${CMAKE_SOURCE_DIR}/lib/"
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
# Install
|
|
93
|
+
install(TARGETS codegreen-nemb
|
|
94
|
+
LIBRARY DESTINATION lib
|
|
95
|
+
ARCHIVE DESTINATION lib
|
|
96
|
+
RUNTIME DESTINATION bin
|
|
97
|
+
)
|
|
98
|
+
|
|
99
|
+
install(FILES
|
|
100
|
+
${CMAKE_SOURCE_DIR}/codegreen/instrumentation/language_runtimes/python/codegreen_runtime.py
|
|
101
|
+
DESTINATION bin/runtime
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
if(EXISTS "${CMAKE_SOURCE_DIR}/config/codegreen.json")
|
|
105
|
+
install(FILES ${CMAKE_SOURCE_DIR}/config/codegreen.json
|
|
106
|
+
DESTINATION bin/config
|
|
107
|
+
)
|
|
108
|
+
endif()
|
|
109
|
+
|
|
110
|
+
set(CPACK_PACKAGE_NAME "CodeGreen")
|
|
111
|
+
set(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}")
|
|
112
|
+
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Energy-aware software development tool")
|
|
113
|
+
include(CPack)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codegreen
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.2
|
|
4
4
|
Summary: Energy-aware software development tool for measuring and optimizing code energy consumption
|
|
5
5
|
Author-email: Saurabhsingh Rajput <saurabh@dal.ca>
|
|
6
6
|
Maintainer-email: Saurabhsingh Rajput <saurabh@dal.ca>
|
|
@@ -400,6 +400,7 @@ Classifier: Programming Language :: Python :: 3.13
|
|
|
400
400
|
Classifier: Programming Language :: C++
|
|
401
401
|
Classifier: Operating System :: POSIX :: Linux
|
|
402
402
|
Classifier: Operating System :: MacOS :: MacOS X
|
|
403
|
+
Classifier: Operating System :: Microsoft :: Windows :: Windows 11
|
|
403
404
|
Classifier: Environment :: Console
|
|
404
405
|
Requires-Python: >=3.8
|
|
405
406
|
Description-Content-Type: text/markdown
|
|
@@ -468,9 +469,13 @@ sudo codegreen run -- python script.py
|
|
|
468
469
|
|
|
469
470
|
| Platform | pip install | Energy measurement | Backend |
|
|
470
471
|
|----------|------------|-------------------|---------|
|
|
471
|
-
| Linux x86_64 (Intel
|
|
472
|
-
|
|
|
472
|
+
| Linux x86_64 (Intel) | Pre-built wheel | Full (PKG, core, iGPU, DRAM) | RAPL via NEMB |
|
|
473
|
+
| Linux x86_64 (AMD) | Pre-built wheel | Full (PKG, no DRAM counter) | RAPL via NEMB |
|
|
474
|
+
| macOS ARM64 (Apple Silicon) | Pre-built wheel | Full (CPU, GPU, ANE, DRAM) | IOReport + kpc via NEMB |
|
|
473
475
|
| macOS Intel | From source | Full | IOReport via NEMB |
|
|
476
|
+
| Windows 11 (Intel) | From source | Full (PKG, core, iGPU, DRAM) | EMI via intelpep.sys |
|
|
477
|
+
| Windows 11 (AMD) | From source | Unverified | EMI may not expose AMD RAPL |
|
|
478
|
+
| NVIDIA GPU (any OS) | Automatic | Full (cumulative mJ) | NVML |
|
|
474
479
|
| Other | From source | Time-only | Fallback |
|
|
475
480
|
|
|
476
481
|
### Requirements
|
|
@@ -478,6 +483,7 @@ sudo codegreen run -- python script.py
|
|
|
478
483
|
- Python 3.9+
|
|
479
484
|
- Linux: kernel 5.0+, Intel/AMD CPU with RAPL support
|
|
480
485
|
- macOS: Apple Silicon (M1-M5) or Intel, sudo for energy measurement
|
|
486
|
+
- Windows 11: Intel/AMD CPU (EMI via inbox intelpep.sys driver, zero install)
|
|
481
487
|
- Source builds: CMake 3.16+, C++17 compiler
|
|
482
488
|
|
|
483
489
|
## Usage
|
|
@@ -555,7 +561,7 @@ Features: Ball & Larus branch heuristics, SCC-based hot path computation, three-
|
|
|
555
561
|
|
|
556
562
|
## Architecture
|
|
557
563
|
|
|
558
|
-
- **C++ NEMB backend**: platform-aware energy measurement (RAPL on Linux, IOReport on macOS), sub-microsecond timestamping, background polling with lock-free ring buffers
|
|
564
|
+
- **C++ NEMB backend**: platform-aware energy measurement (RAPL on Linux, IOReport on macOS, EMI on Windows), sub-microsecond timestamping, background polling with lock-free ring buffers
|
|
559
565
|
- **Python instrumentation**: tree-sitter AST analysis, config-driven checkpoint insertion
|
|
560
566
|
- **Energy Flow Graph**: CFG + energy annotation for path-dependent analysis
|
|
561
567
|
- **Benchmark harness**: multi-suite support (benchmarksgame, PerfOpt), statistical analysis with t-distribution CI, IQR outlier detection, profiler comparison
|
|
@@ -37,9 +37,13 @@ sudo codegreen run -- python script.py
|
|
|
37
37
|
|
|
38
38
|
| Platform | pip install | Energy measurement | Backend |
|
|
39
39
|
|----------|------------|-------------------|---------|
|
|
40
|
-
| Linux x86_64 (Intel
|
|
41
|
-
|
|
|
40
|
+
| Linux x86_64 (Intel) | Pre-built wheel | Full (PKG, core, iGPU, DRAM) | RAPL via NEMB |
|
|
41
|
+
| Linux x86_64 (AMD) | Pre-built wheel | Full (PKG, no DRAM counter) | RAPL via NEMB |
|
|
42
|
+
| macOS ARM64 (Apple Silicon) | Pre-built wheel | Full (CPU, GPU, ANE, DRAM) | IOReport + kpc via NEMB |
|
|
42
43
|
| macOS Intel | From source | Full | IOReport via NEMB |
|
|
44
|
+
| Windows 11 (Intel) | From source | Full (PKG, core, iGPU, DRAM) | EMI via intelpep.sys |
|
|
45
|
+
| Windows 11 (AMD) | From source | Unverified | EMI may not expose AMD RAPL |
|
|
46
|
+
| NVIDIA GPU (any OS) | Automatic | Full (cumulative mJ) | NVML |
|
|
43
47
|
| Other | From source | Time-only | Fallback |
|
|
44
48
|
|
|
45
49
|
### Requirements
|
|
@@ -47,6 +51,7 @@ sudo codegreen run -- python script.py
|
|
|
47
51
|
- Python 3.9+
|
|
48
52
|
- Linux: kernel 5.0+, Intel/AMD CPU with RAPL support
|
|
49
53
|
- macOS: Apple Silicon (M1-M5) or Intel, sudo for energy measurement
|
|
54
|
+
- Windows 11: Intel/AMD CPU (EMI via inbox intelpep.sys driver, zero install)
|
|
50
55
|
- Source builds: CMake 3.16+, C++17 compiler
|
|
51
56
|
|
|
52
57
|
## Usage
|
|
@@ -124,7 +129,7 @@ Features: Ball & Larus branch heuristics, SCC-based hot path computation, three-
|
|
|
124
129
|
|
|
125
130
|
## Architecture
|
|
126
131
|
|
|
127
|
-
- **C++ NEMB backend**: platform-aware energy measurement (RAPL on Linux, IOReport on macOS), sub-microsecond timestamping, background polling with lock-free ring buffers
|
|
132
|
+
- **C++ NEMB backend**: platform-aware energy measurement (RAPL on Linux, IOReport on macOS, EMI on Windows), sub-microsecond timestamping, background polling with lock-free ring buffers
|
|
128
133
|
- **Python instrumentation**: tree-sitter AST analysis, config-driven checkpoint insertion
|
|
129
134
|
- **Energy Flow Graph**: CFG + energy annotation for path-dependent analysis
|
|
130
135
|
- **Benchmark harness**: multi-suite support (benchmarksgame, PerfOpt), statistical analysis with t-distribution CI, IQR outlier detection, profiler comparison
|
|
@@ -202,11 +202,79 @@ class NativeProfiler(ProfilerInterface):
|
|
|
202
202
|
def is_available(self) -> bool:
|
|
203
203
|
return True
|
|
204
204
|
|
|
205
|
+
class CodeCarbonProfiler(ProfilerInterface):
|
|
206
|
+
"""Wraps CodeCarbon for energy measurement (requires: pip install codecarbon)."""
|
|
207
|
+
def run(self, cmd: List[str], timeout: int = 300) -> ProfileResult:
|
|
208
|
+
try:
|
|
209
|
+
from codecarbon import EmissionsTracker
|
|
210
|
+
except ImportError:
|
|
211
|
+
return ProfileResult(0.0, 0.0, "", [], {"error": "codecarbon not installed"})
|
|
212
|
+
tracker = EmissionsTracker(log_level="error", save_to_file=False)
|
|
213
|
+
tracker.start()
|
|
214
|
+
start = time.perf_counter()
|
|
215
|
+
result = subprocess.run(cmd, capture_output=True, text=True, timeout=timeout)
|
|
216
|
+
elapsed = time.perf_counter() - start
|
|
217
|
+
emissions = tracker.stop()
|
|
218
|
+
energy = tracker._total_energy.kWh * 3_600_000 # kWh -> J
|
|
219
|
+
return ProfileResult(energy, elapsed, result.stdout, [],
|
|
220
|
+
{"emissions_kg_co2": emissions, "energy_kwh": tracker._total_energy.kWh})
|
|
221
|
+
|
|
222
|
+
def is_available(self) -> bool:
|
|
223
|
+
try:
|
|
224
|
+
import codecarbon
|
|
225
|
+
return True
|
|
226
|
+
except ImportError:
|
|
227
|
+
return False
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
class JoularJXProfiler(ProfilerInterface):
|
|
231
|
+
"""Wraps JoularJX for Java energy measurement (requires JoularJX agent jar)."""
|
|
232
|
+
def __init__(self, agent_path: str = ""):
|
|
233
|
+
self.agent_path = agent_path or self._find_agent()
|
|
234
|
+
|
|
235
|
+
def _find_agent(self) -> str:
|
|
236
|
+
for p in [Path("joularjx-agent.jar"), Path.home() / ".joularjx" / "joularjx-agent.jar"]:
|
|
237
|
+
if p.exists():
|
|
238
|
+
return str(p)
|
|
239
|
+
return ""
|
|
240
|
+
|
|
241
|
+
def run(self, cmd: List[str], timeout: int = 300) -> ProfileResult:
|
|
242
|
+
if not self.agent_path:
|
|
243
|
+
return ProfileResult(0.0, 0.0, "", [], {"error": "JoularJX agent not found"})
|
|
244
|
+
jx_cmd = cmd.copy()
|
|
245
|
+
if cmd[0] == "java":
|
|
246
|
+
jx_cmd.insert(1, f"-javaagent:{self.agent_path}")
|
|
247
|
+
start = time.perf_counter()
|
|
248
|
+
result = subprocess.run(jx_cmd, capture_output=True, text=True, timeout=timeout)
|
|
249
|
+
elapsed = time.perf_counter() - start
|
|
250
|
+
energy = self._parse_joularjx_output()
|
|
251
|
+
return ProfileResult(energy, elapsed, result.stdout, [], {"agent": self.agent_path})
|
|
252
|
+
|
|
253
|
+
def _parse_joularjx_output(self) -> float:
|
|
254
|
+
csv_path = Path("joularJX-all-methods-energy.csv")
|
|
255
|
+
if not csv_path.exists():
|
|
256
|
+
return 0.0
|
|
257
|
+
total = 0.0
|
|
258
|
+
for line in csv_path.read_text().splitlines()[1:]:
|
|
259
|
+
parts = line.split(",")
|
|
260
|
+
if len(parts) >= 2:
|
|
261
|
+
try:
|
|
262
|
+
total += float(parts[-1])
|
|
263
|
+
except ValueError:
|
|
264
|
+
pass
|
|
265
|
+
return total
|
|
266
|
+
|
|
267
|
+
def is_available(self) -> bool:
|
|
268
|
+
return bool(self.agent_path) and Path(self.agent_path).exists()
|
|
269
|
+
|
|
270
|
+
|
|
205
271
|
def get_profiler(name: str) -> ProfilerInterface:
|
|
206
272
|
profilers = {
|
|
207
273
|
"codegreen": CodeGreenProfiler,
|
|
208
274
|
"perf": PerfProfiler,
|
|
209
275
|
"native": NativeProfiler,
|
|
276
|
+
"codecarbon": CodeCarbonProfiler,
|
|
277
|
+
"joularjx": JoularJXProfiler,
|
|
210
278
|
}
|
|
211
279
|
if name not in profilers:
|
|
212
280
|
raise ValueError(f"Unknown profiler: {name}. Available: {list(profilers.keys())}")
|
|
@@ -2,10 +2,14 @@
|
|
|
2
2
|
from benchmark.suites.base import Suite, Task
|
|
3
3
|
from benchmark.suites.benchmarksgame import BenchmarksgameSuite
|
|
4
4
|
from benchmark.suites.perfopt import PerfOptSuite
|
|
5
|
+
from benchmark.suites.dacapo import DaCapoSuite
|
|
6
|
+
from benchmark.suites.renaissance import RenaissanceSuite
|
|
5
7
|
|
|
6
8
|
SUITES = {
|
|
7
9
|
"benchmarksgame": BenchmarksgameSuite,
|
|
8
10
|
"perfopt": PerfOptSuite,
|
|
11
|
+
"dacapo": DaCapoSuite,
|
|
12
|
+
"renaissance": RenaissanceSuite,
|
|
9
13
|
}
|
|
10
14
|
|
|
11
15
|
def get_suite(name: str, **kwargs) -> Suite:
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"""DaCapo benchmark suite for Java workloads.
|
|
2
|
+
Requires: DaCapo jar downloaded from https://dacapobench.org/
|
|
3
|
+
Usage: codegreen benchmark --suite dacapo --dataset-dir /path/to/dacapo.jar
|
|
4
|
+
"""
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
from typing import List, Optional
|
|
7
|
+
from benchmark.suites.base import Suite, Task
|
|
8
|
+
|
|
9
|
+
DACAPO_BENCHMARKS = [
|
|
10
|
+
"avrora", "batik", "biojava", "cassandra", "eclipse", "fop",
|
|
11
|
+
"graphchi", "h2", "h2o", "jme", "jython", "kafka",
|
|
12
|
+
"luindex", "lusearch", "pmd", "spring", "sunflow",
|
|
13
|
+
"tomcat", "tradebeans", "tradesoap", "xalan", "zxing",
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class DaCapoSuite(Suite):
|
|
18
|
+
def __init__(self, dataset_dir: str = "", benchmarks: List[str] = None):
|
|
19
|
+
self.jar_path = Path(dataset_dir) if dataset_dir else None
|
|
20
|
+
self.benchmarks = benchmarks or DACAPO_BENCHMARKS
|
|
21
|
+
|
|
22
|
+
@property
|
|
23
|
+
def name(self) -> str:
|
|
24
|
+
return "dacapo"
|
|
25
|
+
|
|
26
|
+
def discover(self, filters: Optional[dict] = None) -> List[Task]:
|
|
27
|
+
if not self.jar_path or not self.jar_path.exists():
|
|
28
|
+
raise FileNotFoundError(f"DaCapo jar not found at {self.jar_path}. "
|
|
29
|
+
"Download from https://dacapobench.org/")
|
|
30
|
+
selected = self.benchmarks
|
|
31
|
+
if filters and "benchmarks" in filters:
|
|
32
|
+
selected = [b for b in selected if b in filters["benchmarks"]]
|
|
33
|
+
return [Task(
|
|
34
|
+
name=b, language="java",
|
|
35
|
+
run_command=["java", "-jar", str(self.jar_path), b],
|
|
36
|
+
variant="default",
|
|
37
|
+
metadata={"suite": "dacapo", "benchmark": b}
|
|
38
|
+
) for b in selected]
|
|
39
|
+
|
|
40
|
+
def build(self, task: Task) -> Task:
|
|
41
|
+
return task # DaCapo is pre-built
|
|
42
|
+
|
|
43
|
+
@property
|
|
44
|
+
def default_timeout(self) -> int:
|
|
45
|
+
return 600
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"""Renaissance benchmark suite for modern JVM workloads.
|
|
2
|
+
Requires: Renaissance jar downloaded from https://renaissance.dev/
|
|
3
|
+
Usage: codegreen benchmark --suite renaissance --dataset-dir /path/to/renaissance.jar
|
|
4
|
+
"""
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
from typing import List, Optional
|
|
7
|
+
from benchmark.suites.base import Suite, Task
|
|
8
|
+
|
|
9
|
+
RENAISSANCE_BENCHMARKS = [
|
|
10
|
+
"akka-uct", "als", "chi-square", "db-shootout", "dec-tree",
|
|
11
|
+
"dotty", "finagle-chirper", "finagle-http", "fj-kmeans",
|
|
12
|
+
"future-genetic", "gauss-mix", "log-regression", "mnemonics",
|
|
13
|
+
"movie-lens", "naive-bayes", "neo4j-analytics", "page-rank",
|
|
14
|
+
"par-mnemonics", "philosophers", "reactors", "rx-scrabble",
|
|
15
|
+
"scala-doku", "scala-kmeans", "scala-stm-bench7", "scrabble",
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class RenaissanceSuite(Suite):
|
|
20
|
+
def __init__(self, dataset_dir: str = "", benchmarks: List[str] = None, repetitions: int = 1):
|
|
21
|
+
self.jar_path = Path(dataset_dir) if dataset_dir else None
|
|
22
|
+
self.benchmarks = benchmarks or RENAISSANCE_BENCHMARKS
|
|
23
|
+
self.repetitions = repetitions
|
|
24
|
+
|
|
25
|
+
@property
|
|
26
|
+
def name(self) -> str:
|
|
27
|
+
return "renaissance"
|
|
28
|
+
|
|
29
|
+
def discover(self, filters: Optional[dict] = None) -> List[Task]:
|
|
30
|
+
if not self.jar_path or not self.jar_path.exists():
|
|
31
|
+
raise FileNotFoundError(f"Renaissance jar not found at {self.jar_path}. "
|
|
32
|
+
"Download from https://renaissance.dev/")
|
|
33
|
+
selected = self.benchmarks
|
|
34
|
+
if filters and "benchmarks" in filters:
|
|
35
|
+
selected = [b for b in selected if b in filters["benchmarks"]]
|
|
36
|
+
return [Task(
|
|
37
|
+
name=b, language="java",
|
|
38
|
+
run_command=["java", "-jar", str(self.jar_path), b, "-r", str(self.repetitions)],
|
|
39
|
+
variant="default",
|
|
40
|
+
metadata={"suite": "renaissance", "benchmark": b, "repetitions": self.repetitions}
|
|
41
|
+
) for b in selected]
|
|
42
|
+
|
|
43
|
+
def build(self, task: Task) -> Task:
|
|
44
|
+
return task
|
|
45
|
+
|
|
46
|
+
@property
|
|
47
|
+
def default_timeout(self) -> int:
|
|
48
|
+
return 900
|
|
@@ -5,7 +5,7 @@ A comprehensive energy measurement and code optimization tool for developers
|
|
|
5
5
|
and researchers who need precise, fine-grained energy consumption analysis.
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
-
__version__ = "0.3.
|
|
8
|
+
__version__ = "0.3.2"
|
|
9
9
|
__author__ = "Saurabhsingh Rajput"
|
|
10
10
|
__email__ = "saurabh@dal.ca"
|
|
11
11
|
__description__ = "Energy-aware software development tool"
|
|
@@ -990,8 +990,8 @@ def _build_comprehensive_json(
|
|
|
990
990
|
def _should_run_actual_measurement(sensors: Optional[List[SensorType]]) -> bool:
|
|
991
991
|
"""Check if actual energy measurement should be performed"""
|
|
992
992
|
# For now, check if binary exists for actual measurement
|
|
993
|
-
|
|
994
|
-
return
|
|
993
|
+
backend = _get_energy_backend()
|
|
994
|
+
return not isinstance(backend, _TimeOnlyBackend)
|
|
995
995
|
|
|
996
996
|
|
|
997
997
|
def _parse_runtime_measurements(output: str) -> List[Dict[str, Any]]:
|
|
@@ -2126,22 +2126,26 @@ def run_measure_workload(
|
|
|
2126
2126
|
console.print(f"[blue]Duration:[/blue] {duration} seconds")
|
|
2127
2127
|
console.print(f"[blue]Workload:[/blue] {workload}")
|
|
2128
2128
|
|
|
2129
|
-
|
|
2130
|
-
if
|
|
2131
|
-
console.print("[red]
|
|
2129
|
+
backend = _get_energy_backend()
|
|
2130
|
+
if isinstance(backend, _TimeOnlyBackend):
|
|
2131
|
+
console.print("[red]No energy measurement backend available[/red]")
|
|
2132
2132
|
raise typer.Exit(1)
|
|
2133
|
-
|
|
2133
|
+
|
|
2134
|
+
# Generate workload command
|
|
2135
|
+
if workload == "cpu_stress":
|
|
2136
|
+
cmd = ["python3", "-c", f"import time;t=time.time();[sum(range(10**6)) for _ in iter(lambda:time.time()-t<{duration},True)]"]
|
|
2137
|
+
elif workload == "memory_stress":
|
|
2138
|
+
cmd = ["python3", "-c", f"import time;t=time.time();exec('x=[]\\nwhile time.time()-t<{duration}:\\n x.append(bytearray(10**6))\\n if len(x)>100: x.clear()')"]
|
|
2139
|
+
else:
|
|
2140
|
+
cmd = ["python3", "-c", f"import time;time.sleep({duration})"]
|
|
2141
|
+
|
|
2134
2142
|
try:
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
capture_output=True,
|
|
2138
|
-
text=True,
|
|
2139
|
-
timeout=duration + 30 # Add buffer time
|
|
2140
|
-
)
|
|
2141
|
-
|
|
2142
|
-
if result.returncode == 0:
|
|
2143
|
+
energy_j, elapsed = backend.measure(cmd, timeout=duration + 30)
|
|
2144
|
+
if energy_j and energy_j > 0:
|
|
2143
2145
|
console.print("[green]Workload measurement completed successfully[/green]")
|
|
2144
|
-
console.print(
|
|
2146
|
+
console.print(f"Energy: {energy_j:.4f} J")
|
|
2147
|
+
console.print(f"Power: {energy_j/elapsed:.2f} W")
|
|
2148
|
+
console.print(f"Duration: {elapsed:.2f} s")
|
|
2145
2149
|
else:
|
|
2146
2150
|
console.print("[red]Workload measurement failed[/red]")
|
|
2147
2151
|
console.print(result.stderr)
|
|
@@ -2321,11 +2325,30 @@ def run_command(
|
|
|
2321
2325
|
"budget_exceeded": budget is not None and e_stats.mean > budget
|
|
2322
2326
|
}, indent=2))
|
|
2323
2327
|
else:
|
|
2328
|
+
# Coefficient of variation: signal-to-noise indicator
|
|
2329
|
+
cv = (e_stats.std / e_stats.mean * 100) if e_stats.mean > 0 else 0
|
|
2330
|
+
ci_width = e_stats.ci95_upper - e_stats.ci95_lower
|
|
2331
|
+
ci_pct = (ci_width / e_stats.mean * 100) if e_stats.mean > 0 else 0
|
|
2332
|
+
|
|
2333
|
+
# Color-code by measurement quality
|
|
2334
|
+
if cv < 5:
|
|
2335
|
+
quality, color = "excellent", "green"
|
|
2336
|
+
elif cv < 15:
|
|
2337
|
+
quality, color = "good", "yellow"
|
|
2338
|
+
elif cv < 30:
|
|
2339
|
+
quality, color = "moderate", "bright_yellow"
|
|
2340
|
+
else:
|
|
2341
|
+
quality, color = "high noise", "red"
|
|
2342
|
+
|
|
2324
2343
|
console.print(f"\n[bold]Energy:[/bold] {e_stats.mean:.4f} J +/- {e_stats.std:.4f} J")
|
|
2325
|
-
console.print(f" Range: [{e_stats.min:.4f} .. {e_stats.max:.4f}] J
|
|
2326
|
-
|
|
2344
|
+
console.print(f" Range: [{e_stats.min:.4f} .. {e_stats.max:.4f}] J")
|
|
2345
|
+
console.print(f" CI95: [{e_stats.ci95_lower:.4f}, {e_stats.ci95_upper:.4f}] J ({ci_pct:.1f}% width)")
|
|
2346
|
+
console.print(f" CV: [{color}]{cv:.1f}% ({quality})[/{color}]")
|
|
2327
2347
|
console.print(f"[bold]Time:[/bold] {t_stats.mean:.4f} s +/- {t_stats.std:.4f} s")
|
|
2348
|
+
console.print(f"[bold]Power:[/bold] {e_stats.mean / t_stats.mean:.2f} W (avg)")
|
|
2328
2349
|
console.print(f" Runs: {len(energies)}, Outliers removed: {e_stats.outliers_removed}")
|
|
2350
|
+
if cv > 20:
|
|
2351
|
+
console.print(f"[yellow] Tip: high variance -- try --repeat 30 or reduce background load[/yellow]")
|
|
2329
2352
|
if budget is not None:
|
|
2330
2353
|
if e_stats.mean > budget:
|
|
2331
2354
|
console.print(f"[red]BUDGET EXCEEDED: {e_stats.mean:.4f}J > {budget}J[/red]")
|
|
@@ -2405,10 +2428,8 @@ class _NEMBBackend(_EnergyBackend):
|
|
|
2405
2428
|
return (energy.value if ok and energy.value > 0 else None, elapsed)
|
|
2406
2429
|
|
|
2407
2430
|
def wrap_command(self, cmd_str: str, energy_file: str, checkpoint_file: str) -> str:
|
|
2408
|
-
# NEMB
|
|
2409
|
-
|
|
2410
|
-
if binary:
|
|
2411
|
-
return f"{binary} measure-workload --output {energy_file} -- bash -c '{cmd_str} 2>{checkpoint_file}'"
|
|
2431
|
+
# NEMB measures in-process; for project mode, just run the command and
|
|
2432
|
+
# let the coordinator's background thread capture energy during execution
|
|
2412
2433
|
return f"bash -c '{cmd_str} 2>{checkpoint_file}'"
|
|
2413
2434
|
|
|
2414
2435
|
def parse_energy(self, energy_file: str) -> float:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codegreen
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.2
|
|
4
4
|
Summary: Energy-aware software development tool for measuring and optimizing code energy consumption
|
|
5
5
|
Author-email: Saurabhsingh Rajput <saurabh@dal.ca>
|
|
6
6
|
Maintainer-email: Saurabhsingh Rajput <saurabh@dal.ca>
|
|
@@ -400,6 +400,7 @@ Classifier: Programming Language :: Python :: 3.13
|
|
|
400
400
|
Classifier: Programming Language :: C++
|
|
401
401
|
Classifier: Operating System :: POSIX :: Linux
|
|
402
402
|
Classifier: Operating System :: MacOS :: MacOS X
|
|
403
|
+
Classifier: Operating System :: Microsoft :: Windows :: Windows 11
|
|
403
404
|
Classifier: Environment :: Console
|
|
404
405
|
Requires-Python: >=3.8
|
|
405
406
|
Description-Content-Type: text/markdown
|
|
@@ -468,9 +469,13 @@ sudo codegreen run -- python script.py
|
|
|
468
469
|
|
|
469
470
|
| Platform | pip install | Energy measurement | Backend |
|
|
470
471
|
|----------|------------|-------------------|---------|
|
|
471
|
-
| Linux x86_64 (Intel
|
|
472
|
-
|
|
|
472
|
+
| Linux x86_64 (Intel) | Pre-built wheel | Full (PKG, core, iGPU, DRAM) | RAPL via NEMB |
|
|
473
|
+
| Linux x86_64 (AMD) | Pre-built wheel | Full (PKG, no DRAM counter) | RAPL via NEMB |
|
|
474
|
+
| macOS ARM64 (Apple Silicon) | Pre-built wheel | Full (CPU, GPU, ANE, DRAM) | IOReport + kpc via NEMB |
|
|
473
475
|
| macOS Intel | From source | Full | IOReport via NEMB |
|
|
476
|
+
| Windows 11 (Intel) | From source | Full (PKG, core, iGPU, DRAM) | EMI via intelpep.sys |
|
|
477
|
+
| Windows 11 (AMD) | From source | Unverified | EMI may not expose AMD RAPL |
|
|
478
|
+
| NVIDIA GPU (any OS) | Automatic | Full (cumulative mJ) | NVML |
|
|
474
479
|
| Other | From source | Time-only | Fallback |
|
|
475
480
|
|
|
476
481
|
### Requirements
|
|
@@ -478,6 +483,7 @@ sudo codegreen run -- python script.py
|
|
|
478
483
|
- Python 3.9+
|
|
479
484
|
- Linux: kernel 5.0+, Intel/AMD CPU with RAPL support
|
|
480
485
|
- macOS: Apple Silicon (M1-M5) or Intel, sudo for energy measurement
|
|
486
|
+
- Windows 11: Intel/AMD CPU (EMI via inbox intelpep.sys driver, zero install)
|
|
481
487
|
- Source builds: CMake 3.16+, C++17 compiler
|
|
482
488
|
|
|
483
489
|
## Usage
|
|
@@ -555,7 +561,7 @@ Features: Ball & Larus branch heuristics, SCC-based hot path computation, three-
|
|
|
555
561
|
|
|
556
562
|
## Architecture
|
|
557
563
|
|
|
558
|
-
- **C++ NEMB backend**: platform-aware energy measurement (RAPL on Linux, IOReport on macOS), sub-microsecond timestamping, background polling with lock-free ring buffers
|
|
564
|
+
- **C++ NEMB backend**: platform-aware energy measurement (RAPL on Linux, IOReport on macOS, EMI on Windows), sub-microsecond timestamping, background polling with lock-free ring buffers
|
|
559
565
|
- **Python instrumentation**: tree-sitter AST analysis, config-driven checkpoint insertion
|
|
560
566
|
- **Energy Flow Graph**: CFG + energy annotation for path-dependent analysis
|
|
561
567
|
- **Benchmark harness**: multi-suite support (benchmarksgame, PerfOpt), statistical analysis with t-distribution CI, IQR outlier detection, profiler comparison
|
|
@@ -15,7 +15,9 @@ benchmark/results.py
|
|
|
15
15
|
benchmark/suites/__init__.py
|
|
16
16
|
benchmark/suites/base.py
|
|
17
17
|
benchmark/suites/benchmarksgame.py
|
|
18
|
+
benchmark/suites/dacapo.py
|
|
18
19
|
benchmark/suites/perfopt.py
|
|
20
|
+
benchmark/suites/renaissance.py
|
|
19
21
|
benchmark/validation/__init__.py
|
|
20
22
|
benchmark/validation/analysis.py
|
|
21
23
|
benchmark/validation/experiments.py
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "codegreen"
|
|
7
|
-
version = "0.3.
|
|
7
|
+
version = "0.3.2"
|
|
8
8
|
description = "Energy-aware software development tool for measuring and optimizing code energy consumption"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = {file = "LICENSE"}
|
|
@@ -36,6 +36,7 @@ classifiers = [
|
|
|
36
36
|
"Programming Language :: C++",
|
|
37
37
|
"Operating System :: POSIX :: Linux",
|
|
38
38
|
"Operating System :: MacOS :: MacOS X",
|
|
39
|
+
"Operating System :: Microsoft :: Windows :: Windows 11",
|
|
39
40
|
"Environment :: Console"
|
|
40
41
|
]
|
|
41
42
|
requires-python = ">=3.8"
|
|
@@ -107,8 +108,10 @@ find = {where = ["."], include = [
|
|
|
107
108
|
"config.json",
|
|
108
109
|
"lib/*.so",
|
|
109
110
|
"lib/*.dylib",
|
|
111
|
+
"lib/*.dll",
|
|
110
112
|
"lib/runtime/**/*.h",
|
|
111
113
|
"bin/codegreen",
|
|
114
|
+
"bin/codegreen.exe",
|
|
112
115
|
]
|
|
113
116
|
|
|
114
117
|
[tool.setuptools.exclude-package-data]
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
2
|
"""CodeGreen setup with C++ backend compilation for wheel builds."""
|
|
3
3
|
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
4
6
|
import os
|
|
5
7
|
import platform
|
|
6
8
|
import shutil
|
|
@@ -14,6 +16,7 @@ _EXCLUDE_DIRS = {"ide", "measurement", "optimizer"}
|
|
|
14
16
|
_NATIVE_LIB = {
|
|
15
17
|
"Darwin": "libcodegreen-nemb.dylib",
|
|
16
18
|
"Linux": "libcodegreen-nemb.so",
|
|
19
|
+
"Windows": "codegreen-nemb.dll",
|
|
17
20
|
}
|
|
18
21
|
|
|
19
22
|
|
|
@@ -116,8 +119,10 @@ setup(
|
|
|
116
119
|
"codegreen": [
|
|
117
120
|
"lib/*.so",
|
|
118
121
|
"lib/*.dylib",
|
|
122
|
+
"lib/*.dll",
|
|
119
123
|
"lib/runtime/**/*.h",
|
|
120
124
|
"bin/codegreen",
|
|
125
|
+
"bin/codegreen.exe",
|
|
121
126
|
"config.json",
|
|
122
127
|
],
|
|
123
128
|
},
|
|
@@ -184,7 +184,7 @@ SAMPLES = {
|
|
|
184
184
|
"java": (".java", JAVA_SAMPLE, 3),
|
|
185
185
|
"c": (".c", C_SAMPLE, 3),
|
|
186
186
|
"cpp": (".cpp", CPP_SAMPLE, 3),
|
|
187
|
-
"javascript": (".js", JS_SAMPLE,
|
|
187
|
+
"javascript": (".js", JS_SAMPLE, 4),
|
|
188
188
|
}
|
|
189
189
|
|
|
190
190
|
|
|
@@ -215,8 +215,7 @@ class TestInstrumentationPoints:
|
|
|
215
215
|
("java", ".java", JAVA_SAMPLE, 3),
|
|
216
216
|
("c", ".c", C_SAMPLE, 3),
|
|
217
217
|
("cpp", ".cpp", CPP_SAMPLE, 3),
|
|
218
|
-
pytest.param("javascript", ".js", JS_SAMPLE,
|
|
219
|
-
marks=pytest.mark.xfail(reason="JavaScript instrumentation incomplete")),
|
|
218
|
+
pytest.param("javascript", ".js", JS_SAMPLE, 4),
|
|
220
219
|
])
|
|
221
220
|
def test_finds_instrumentation_points(self, lang, ext, code, min_points):
|
|
222
221
|
path = _write_sample(lang, code, ext)
|