{"id":22670174,"url":"https://github.com/hobywan/wrappi","last_synced_at":"2025-03-29T11:41:17.113Z","repository":{"id":91786444,"uuid":"180575892","full_name":"hobywan/wrappi","owner":"hobywan","description":"A profiling library based on PAPI hardware counters targetted for Linux-based multicore compute nodes.","archived":false,"fork":false,"pushed_at":"2019-04-16T12:39:33.000Z","size":151,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-04T11:04:47.669Z","etag":null,"topics":["cpp","hpc","linux","multicore","profiling"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hobywan.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}},"created_at":"2019-04-10T12:22:47.000Z","updated_at":"2021-09-06T10:27:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"44cadacf-8c73-426b-b3b5-42bb4d5e1e82","html_url":"https://github.com/hobywan/wrappi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hobywan%2Fwrappi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hobywan%2Fwrappi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hobywan%2Fwrappi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hobywan%2Fwrappi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hobywan","download_url":"https://codeload.github.com/hobywan/wrappi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246180898,"owners_count":20736459,"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":["cpp","hpc","linux","multicore","profiling"],"created_at":"2024-12-09T15:52:28.524Z","updated_at":"2025-03-29T11:41:16.780Z","avatar_url":"https://github.com/hobywan.png","language":"C++","readme":"\n\u003cimg src=\"docs/figures/logo.png\" alt=\"logo\" width=\"150\"\u003e\n\n**wrappi** is a C++ library for core events profiling based on [PAPI](http://icl.utk.edu/papi/) hardware counters.  \nIt is targetted for multicore and [manycore](https://en.wikipedia.org/wiki/Manycore_processor) compute nodes endowed with a Linux kernel.  \nIt provides a simple and clean interface to retrieve:\n\n* core cycles,\n* cache hits/misses ratios,\n* branch prediction,\n* [translation lookaside buffer](https://en.wikipedia.org/wiki/Translation_lookaside_buffer) misses,\n* instructions load/store.\n\non a given **section** of the code, or for a **set** of compute kernels.  \n\n[![Build Status](https://travis-ci.com/hobywan/wrappi.svg?branch=master)](https://travis-ci.com/hobywan/wrappi)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/97ca452a233a4ca8b0b6ba82f56fd040)](https://www.codacy.com?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=hobywan/wrappi\u0026amp;utm_campaign=Badge_Grade)\n[![license](https://img.shields.io/badge/license-MIT-green.svg)](https://opensource.org/licenses/MIT)\n\n### Build and use\n###### Build\n\n**wrappi** is almost standalone.  \nIt requires a [C++14](https://isocpp.org/wiki/faq/cpp14-language) compiler endowed with [OpenMP](https://www.openmp.org).  \nIt can be built on any Linux distribution with [PAPI](http://icl.utk.edu/papi/) installed, using [CMake](https://cmake.org):  \n\n``` bash\nmkdir build                                      # out-of-source build recommended\ncd build                                         #\ncmake ..                                         # CMAKE_BUILD_TYPE=[Debug|Release]\nmake -j4                                         # use multiple jobs for compilation\nmake install                                     # optional, can use a prefix\n```\n\n###### Linking to your project\n**wrappi** is exported as a package.  \nTo enable it, please update your CMakeLists.txt with:\n\n``` cmake\nfind_package(wrappi)                             # in build or install tree\ntarget_link_libraries(target PRIVATE wrappi)     # replace 'target'\n```\nAnd then include `wrappi.h` in your application.  \n\n###### Setting thread-core affinity\n\nIn a multicore context, you have to explicitly set [thread-core affinity](https://eli.thegreenplace.net/2016/c11-threads-affinity-and-hyperthreading/) before profiling.  \nIndeed, threads should be bind to physical cores to prevent the OS from migrating them.  \nBesides, [simultaneous multithreading](https://en.wikipedia.org/wiki/Simultaneous_multithreading) (or hyperthreading on Intel) should be disabled in this case.  \nIt can be done by setting some environment variables:\n\n```bash\nexport OMP_PLACES=core OMP_PROC_BIND=close       # with Gnu or LLVM compiler\nexport KMP_AFFINITY=[granularity=core,compact]   # with Intel compiler  \n```\n\n###### Basic usage\n\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/97ca452a233a4ca8b0b6ba82f56fd040)](https://www.codacy.com?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=hobywan/wrappi\u0026amp;utm_campaign=Badge_Grade)\n\n**wrappi** was designed with simplicity and ease of use in mind.  \nIt can retrieve stats on each invidual core as well as for all cores.  \nHere is a basic usage:\n\n``` c++\nusing namespace wrappi;\nManager profile(Mode::Cache, nb);               \n\nfor (int i = 0; i \u003c nb; ++i) {                       \n  profile.start(i);                               \n  kernel[i].run();                                \n  profile.stop(i);                               \n}\n\nprofile.dump();\n```\n\u003eYou can profile cycles, caches, instructions, [TLB](https://en.wikipedia.org/wiki/Translation_lookaside_buffer), or any event supported by [PAPI](http://icl.utk.edu/papi/) as well.\n\n### Contribute\n###### Copyright 2018, Hoby Rakotoarivelo\n\n[![license](https://img.shields.io/badge/license-MIT-green.svg)](https://opensource.org/licenses/MIT)\n\n**wrappi** extends the initial work of [Sean Chester](https://github.com/sean-chester/papi-wrapper).\u003cbr\u003e\nImprovements are welcome.  \nTo get involved, you can:\n\n-    report bugs or request features by submitting an [issue](https://github.com/hobywan/wrappi/issues).\n-    submit code contributions using feature branches and [pull requests](https://github.com/hobywan/wrappi/pulls).\n\nEnjoy! 😊\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhobywan%2Fwrappi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhobywan%2Fwrappi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhobywan%2Fwrappi/lists"}