mrc-ide / odin.dust

Compile odin to dust
https://mrc-ide.github.io/odin.dust
Other
3 stars 1 forks source link

Add support for print() debugging #125

Closed richfitz closed 1 year ago

richfitz commented 1 year ago

Requires https://github.com/mrc-ide/odin/pull/282 - update the branch pin before merge.

Fairly straightforward implementation here following the C one in odin, with one small wrinkle: we can't use Rprintf from multithreaded code! To get around this we can detect if we're running in parallel with omp_in_parallel() (this is true if we're in a block with more than one active thread), and then only evaluate that function if OpenMP is available!

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and no project coverage change

Comparison is base (1a37d8b) 100.00% compared to head (8d59ce3) 100.00%.

:exclamation: Current head 8d59ce3 differs from pull request most recent head 86a6983. Consider uploading reports for the commit 86a6983 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #125 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 7 7 Lines 1120 1149 +29 ========================================= + Hits 1120 1149 +29 ``` | [Impacted Files](https://codecov.io/gh/mrc-ide/odin.dust/pull/125?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mrc-ide) | Coverage Δ | | |---|---|---| | [R/generate\_dust.R](https://codecov.io/gh/mrc-ide/odin.dust/pull/125?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mrc-ide#diff-Ui9nZW5lcmF0ZV9kdXN0LlI=) | `100.00% <100.00%> (ø)` | | | [R/utils.R](https://codecov.io/gh/mrc-ide/odin.dust/pull/125?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mrc-ide#diff-Ui91dGlscy5S) | `100.00% <100.00%> (ø)` | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mrc-ide). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mrc-ide)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.