{"id":21231959,"url":"https://github.com/bsc-quantic/extrae.jl","last_synced_at":"2025-03-15T02:29:43.882Z","repository":{"id":65636625,"uuid":"371824341","full_name":"bsc-quantic/Extrae.jl","owner":"bsc-quantic","description":"Julia bindings for extrae Basic API","archived":false,"fork":false,"pushed_at":"2025-01-21T11:38:34.000Z","size":483,"stargazers_count":8,"open_issues_count":11,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-02-23T14:18:20.731Z","etag":null,"topics":["bsc","extrae","profiling","tracing"],"latest_commit_sha":null,"homepage":"","language":"TeX","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bsc-quantic.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":"2021-05-28T21:42:20.000Z","updated_at":"2025-01-21T11:38:37.000Z","dependencies_parsed_at":"2023-02-17T08:01:03.538Z","dependency_job_id":"1e1c636a-5daf-4fe6-8360-df9555b6a5c3","html_url":"https://github.com/bsc-quantic/Extrae.jl","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsc-quantic%2FExtrae.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsc-quantic%2FExtrae.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsc-quantic%2FExtrae.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsc-quantic%2FExtrae.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bsc-quantic","download_url":"https://codeload.github.com/bsc-quantic/Extrae.jl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243674332,"owners_count":20329077,"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":["bsc","extrae","profiling","tracing"],"created_at":"2024-11-20T23:49:00.276Z","updated_at":"2025-03-15T02:29:43.858Z","avatar_url":"https://github.com/bsc-quantic.png","language":"TeX","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Extrae\n\nJulia bindings to BSC's [`extrae`](https://tools.bsc.es/extrae) HPC profiler.\n\nIt supports automatic instrumentation (through `LD_PRELOAD` mechanism, DynInst is on the way) of MPI, CUDA and pthreads, and PAPI/PMAPI hardware counters and callstack sampling.\nGenerated traces can be viewed with [Paraver](https://tools.bsc.es/paraver).\n\n## Usage\n\nFirst, you need to set the Extrae configuration using environment variables or XML configuration. An example configuration file can be found in `scripts/extrae.xml`.\n\n### Event emision\n\nExtrae's functionality is very basic: every registered event is just a tuple of 2 integers annotating the event type and the event value.\nSome events are automatically registered, such as MPI call names when you are tracing or PAPI hardware counters when performing sampling.\nBut you can also emit your own custom events using `emit`:\n\n```julia\n# emit event 80000 with value 4\nemit(80_000, 4)\n```\n\nEvent types are encoded with `Int32` and the values must always be a `Int64`.\n\nIf you want to assign a string descriptor to the event, you should call `Extrae.register` before initialization.\n\n```julia\nconst BANANAS_TYPECODE::Int32 = 80_000\nExtrae.register(BANANAS_TYPECODE, \"Bananas\")\n```\n\nAlternatively, you can also add string descriptors to values.\n\n```julia\nExtrae.register(Int32(80_001), \"Monkey name\", Int64[0,1,2], String[\"no monkey\", \"louis\", \"george\"])\n```\n\n### Initialization\n\n`Extrae` can be initialized just by calling `Extrae.init()`. If you are planning to use `Distributed`, you should call\n\n```julia\n@everywhere Extrae.init(Val(:Distributed))\n```\n\nto properly initialize the profiler in all workers. If you plan to use MPI, you should use the `LD_PRELOAD` mechanism.\n\nThe profiling is finished with `Extrae.finish()`.\n\n### Mark user functions\n\nMany times, the profiler catches much more information than we want. One way to filter it is by marking which moments in the trace where devoted to user code. This can be done by calling `Extrae.user_function(1)` to start and `Extrae.user_function(0)` to end the marking region.\n\nWe also provide a `Extrae.@user_function` for code cleanliness.\n\n## Example scripts\n\nIn `scripts` directory you can find the `test-distributed-work.jl` script that traces a very basic execution of a Distributed program.  This script squares a random 1000x1000 matrix two times in a worker, and then fetches the values.\n\nTo run it, execute:\n\n```bash\nscripts/env.sh julia --project=. scripts/test-distributed-work.jl\n```\n\nThe `env.sh` file sets up some environment variables required by the extrae library at load time.\n\nThen, to obtain the Paraver trace, we use the script `julia2prv` which is a wrapper to the `mpi2prv` tool by extrae. You can create your trace by doing:\n\n```bash\nscripts/julia2prv test-distributed.prv JULIATRACE*\n```\n\nand you will obtain a Paraver trace named `test-distributed.prv`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbsc-quantic%2Fextrae.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbsc-quantic%2Fextrae.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbsc-quantic%2Fextrae.jl/lists"}