{"id":32178604,"url":"https://github.com/kforner/rcpp_progress","last_synced_at":"2025-10-21T20:58:23.537Z","repository":{"id":19106826,"uuid":"22335402","full_name":"kforner/rcpp_progress","owner":"kforner","description":"RcppProgress R package: An interruptible progress bar with OpenMP support for c++ in R packages","archived":false,"fork":false,"pushed_at":"2024-06-04T08:02:06.000Z","size":534,"stargazers_count":29,"open_issues_count":3,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-21T20:58:13.896Z","etag":null,"topics":["openmp-support","pkg","r","rcpp"],"latest_commit_sha":null,"homepage":"http://kforner.github.io/rcpp_progress/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kforner.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2014-07-28T08:06:36.000Z","updated_at":"2025-10-16T21:19:30.000Z","dependencies_parsed_at":"2024-05-15T22:54:41.904Z","dependency_job_id":null,"html_url":"https://github.com/kforner/rcpp_progress","commit_stats":{"total_commits":111,"total_committers":9,"mean_commits":"12.333333333333334","dds":0.5135135135135135,"last_synced_commit":"b706e3b8db8937df5fbb08a8fe7c671ea40211aa"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/kforner/rcpp_progress","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kforner%2Frcpp_progress","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kforner%2Frcpp_progress/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kforner%2Frcpp_progress/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kforner%2Frcpp_progress/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kforner","download_url":"https://codeload.github.com/kforner/rcpp_progress/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kforner%2Frcpp_progress/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280333502,"owners_count":26312845,"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","status":"online","status_checked_at":"2025-10-21T02:00:06.614Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["openmp-support","pkg","r","rcpp"],"created_at":"2025-10-21T20:58:21.365Z","updated_at":"2025-10-21T20:58:23.529Z","avatar_url":"https://github.com/kforner.png","language":"C++","readme":"\n\nRcppProgress\n==============\n\n\u003c!-- badges: start --\u003e\n[![R-CMD-check](https://github.com/kforner/rcpp_progress/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/kforner/rcpp_progress/actions/workflows/R-CMD-check.yaml)\n[![Codecov test coverage](https://codecov.io/gh/kforner/rcpp_progress/branch/master/graph/badge.svg)](https://app.codecov.io/gh/kforner/rcpp_progress?branch=master)\n[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/RcppProgress)](https://cran.r-project.org/package=RcppProgress)\n\u003c!-- badges: end --\u003e\n\na R package that provides a C++ interruptible progress bar with **OpenMP** support for C++ code in R packages:\n\n- can check for user interrupts in your C++ code\n- can display a progress bar monitoring your C++ computation\n- is compatible with multi-threaded C++ code (e.g. [openMP](https://www.openmp.org/))\n\n## Overview\n\nUsually you write C++ code with R when you want to speedup some calculations.\nDepending on the parameters, and especially during the development, it is\ndifficult to anticipate the execution time of your computation, so that you\ndo not know if you have to wait for one minute or several hours.\n\nRcppProgress is a tool to help you monitor the execution time of your C++ code, by\nproviding a way to **interrupt** the execution inside the C++ code, and also to\ndisplay a **progress bar** indicative of the state of your computation.\n\nAdditionally, it is compatible with multithreaded code, for example using\n**OpenMP**, which is not as trivial as it may seem since you cannot just stop the\nexecution in one thread. Also, not all threads should be writing in the console\nto avoid garbled output.\n\n\n## Installing\n\n- from CRAN: `install.packages(\"RcppProgress\")`\n- from github: `remotes::install_github('kforner/rcpp_progress')`\n\n## Quick try\n\nThere are test functions included in `RcppProgress` for convenience, that let you run some R functions calling C++ \ncode,  interruptible (by typing `CTRL+c`) and displaying a progress bar: \n\n- `test_multithreaded()`\n- `test_amardillo_multithreaded()`\n- `test_eta_progress_bar()`\n\nThese functions use the example R packages included in the `RcppProgress` package \n(check the `inst/examples` in the github repository).\n\nFor example:\n```\n\u003eRcppProgress::test_multithreaded()\nNumber of threads=4\n0%   10   20   30   40   50   60   70   80   90   100%\n[----|----|----|----|----|----|----|----|----|----|\n**************************************************|\n```\n\n## Inline demo\n\nYou can also test a complete example entirely in your R console!\n\n```r\n# our C++ code\nCODE \u003c- r\"(\n#ifdef _OPENMP\n#include \u003comp.h\u003e\n#endif\n// [[Rcpp::plugins(openmp)]]\n// [[Rcpp::depends(RcppProgress)]]\n#include \u003cprogress.hpp\u003e\n#include \u003cprogress_bar.hpp\u003e\n\n// [[Rcpp::export]]\ndouble long_computation_omp_progress(int nb, int threads=1) {\n#ifdef _OPENMP\n    if ( threads \u003e 0 )\n        omp_set_num_threads( threads );\n#endif\n    Progress p(nb, true);\n    double sum = 0;\n#pragma omp parallel for schedule(dynamic)   \n    for (int i = 0; i \u003c nb; ++i) {\n        double thread_sum = 0;\n        if ( ! Progress::check_abort() ) {\n            p.increment(); // update progress\n            for (int j = 0; j \u003c nb; ++j) {\n                thread_sum += R::dlnorm(i+j, 0.0, 1.0, 0);\n            }\n        }\n        sum += thread_sum;\n    }\n  \n    return sum + nb;\n}\n)\"\n\n# compile and run it\nRcpp::sourceCpp(code = CODE)\nres \u003c- long_computation_omp_progress(10000, 4)\n\n```\n\n## example\n\nThere is a detailed example on Rcpp Gallery: http://gallery.rcpp.org/articles/using-rcppprogress/.\nIt has been improved an is now available as a vignette \nTODO: insert link\n\n## Feedback\n\nPlease use github issues to provide feedback, report bugs and propose new features.\n\n## Development\n\ncf [here](dev.md)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkforner%2Frcpp_progress","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkforner%2Frcpp_progress","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkforner%2Frcpp_progress/lists"}