-
Notifications
You must be signed in to change notification settings - Fork 42
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
Number of threads decreased to 1 after re-entering RStudio Server session #112
Comments
Hi @renkun-ken, thanks for reporting that! If I understand correctly you have a web interface to RStudio Server and the actual So what happens exactly when you refresh the web-page, the servers starts up a completely new R` session and kills the previous one? The only way that the number of cores would be set to 1 would be if fst:::hasopenmp() # TRUE if OpenMP detected
#> [1] TRUE would you be so kind to test that? data.table::getDTthreads()
#> [1] 8 Thanks! |
I do some tests with both while (TRUE) {
cat("[", format(Sys.time()), "] fst::threads_fst() = ", fst::threads_fst(),
", data.table::getDTthreads() = ", data.table::getDTthreads(), "\n", sep = "")
Sys.sleep(1)
} On
It's quite clear that the R session is not suspended but the moment I re-enter the session at I'm not sure why it behaves in this way. Maybe it's not an issue of |
Hi @renkun-ken, that's a smart way of testing that, nice work! In I could add some code to check that or make it the user's choice to switch back to multi-threaded mode after the fork was ended, say: fst::threads_fst(8, reset_after_fork = TRUE)
#> [1] 8 That would be an option at the users own risk however :-) |
Thanks for referring to the data.table's code and clarify. I'd prefer not making it more complex. I'll use |
After some intensive use, I prefer adding |
Hi @renkun-ken, thanks, yes that would be better than setting with Judging from the # set number of threads to 10
fst::write_fst(dt, "myfile.fst", theads = 10) that amount of threads is set regardless of any other setting. And with: fst::write_fst(dt, "myfile.fst") the default thread behavior is used. That default can be set with: fst::threads_fst(8, single_threaded_on_fork = TRUE, reset_after_fork = FALSE) That specifies the threading during and after a fork. thanks |
@MarcusKlik, it is definitely a good option. Thanks! |
Hi @renkun-ken, with the latest On the I'm very interested to see if this solves your issues with Thanks |
Hi @renkun-ken, I believe we can close this issue, the default behavior of Please let me know if re-entering a thanks for testing and submitting the issue to |
I'm using the latest development version of
fst
and I find it quite mysterious that after re-entering my RStudio session, the number of threads indicated bythreads_fst()
is changed to 1 from 40.Steps to reproduce:
fst::threads_fst()
which, on my server, returns 40fst::threads_fst()
again and the number of threads becomes 1My session info:
I'm using RStudio Server 1.1.383.
The text was updated successfully, but these errors were encountered: