Skip to content

Bugfix clearing stdout stderr on finish & cleanup #522

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Jun 22, 2021

Conversation

rok-cesnovar
Copy link
Member

@rok-cesnovar rok-cesnovar commented Jun 19, 2021

Summary

Fix #517 by applying the suggestion by @martinmodrak. Fixes #493. Also a bit of cleanup (see comment).

Copyright and Licensing

Please list the copyright holder for the work you are submitting
(this will be you or your assignee, such as a university or company):
Rok Češnovar

By submitting this pull request, the copyright holder is agreeing to
license the submitted work under the following licenses:

@@ -371,36 +371,6 @@ build_cmdstan <- function(dir,
)
}

# Removes files that are used to simplify switching to using threading, opencl or mpi.
clean_compile_helper_files <- function() {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has not been needed for some time, we just haven't cleaned it up.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, always nice to delete a bunch of code!

@rok-cesnovar rok-cesnovar changed the title Bugfix clear stdout stderr on finish Bugfix clearing stdout stderr on finish & cleanup Jun 19, 2021
}
stancflags_val <- paste0(stancflags_val, include_paths_flag, include_paths, " ")
}
stancflags_val <- include_paths_stanc3_args(include_paths)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is repeated in check_syntax, so I added a utility function with a test.

@@ -60,9 +60,7 @@ is_rosetta2 <- function() {

# Returns the type of make command to use to compile depending on the OS
make_cmd <- function() {
# CmdStan 2.21 introduced TBB that requires mingw32-make on Windows
ver <- .cmdstanr$VERSION
if (os_is_windows() && (is.null(ver) || ver >= "2.21")) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check for versions is not needed. CmdStan 2.20 and earlier will still work with mingw32-make (its just that 2.21 and on requires mingw32-make). The toolchain installation for Windows is made in such a way that users will always have mingw32-make (3.x or 4.x). Not to mention I doubt anyone uses CmdStan 2.20 with CmdStanR :)

@codecov-commenter
Copy link

codecov-commenter commented Jun 20, 2021

Codecov Report

Merging #522 (fd3dac4) into master (bee8254) will decrease coverage by 1.59%.
The diff coverage is 90.62%.

❗ Current head fd3dac4 differs from pull request most recent head e44a0d0. Consider uploading reports for the commit e44a0d0 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master     #522      +/-   ##
==========================================
- Coverage   92.78%   91.19%   -1.60%     
==========================================
  Files          12       12              
  Lines        3062     3031      -31     
==========================================
- Hits         2841     2764      -77     
- Misses        221      267      +46     
Impacted Files Coverage Δ
R/install.R 57.86% <50.00%> (-12.56%) ⬇️
R/model.R 90.62% <92.30%> (-1.01%) ⬇️
R/run.R 95.23% <93.33%> (-0.51%) ⬇️
R/data.R 99.23% <100.00%> (+0.74%) ⬆️
R/utils.R 90.71% <100.00%> (-1.49%) ⬇️
R/csv.R 97.74% <0.00%> (-0.91%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bee8254...e44a0d0. Read the comment docs.

Copy link
Member

@jgabry jgabry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@@ -371,36 +371,6 @@ build_cmdstan <- function(dir,
)
}

# Removes files that are used to simplify switching to using threading, opencl or mpi.
clean_compile_helper_files <- function() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, always nice to delete a bunch of code!

@jgabry jgabry merged commit 4457bbf into master Jun 22, 2021
@jgabry jgabry deleted the bugfix_clear_stdout_stderr_on_finish branch June 22, 2021 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

optimize() can return failure, even when the underlying fit is succesful windows openCL compilation issue
3 participants