gaynorr / AlphaSimR

R package for breeding program simulations
https://gaynorr.github.io/AlphaSimR/
Other
40 stars 17 forks source link

Check user interrupt #137

Closed maxecoulter closed 3 months ago

maxecoulter commented 1 year ago

Hi, Very small thing - I notice when using runMacs (this function can take some time with a large founder population) that if I try and stop it (ctl C/ SIGINT) it either does nothing or crashes my R session (could this be due to the signal being sent to a thread?). Kind of annoying. You need a Rcpp::checkUserInterrupt in there, it needs to be on the main thread.

Would you like me to add this in? Of course you are using openmp so this might be a bit tricky but I'm sure there is a work around.

As I said, minor issue, but let me know if you would like me to add this in (or if you could add it in that would be great!)

Cheers,

Max

gregorgorjanc commented 1 year ago

PR's are welcome;)

maxecoulter commented 1 year ago

I'll give it a play and get back to you

gaynorr commented 3 months ago

Probably nothing that can be as long as we're using OpenMP.

https://stackoverflow.com/questions/66588483/rcppcheckuserinterrupt-in-openmp-parallelized-loop-throwing-stack-imbalance