rbchan / unmarked

R package for hierarchical models in ecological research
https://rbchan.github.io/unmarked/
37 stars 25 forks source link

Add 'coresToUse' argument to 'parboot' #149

Closed mikemeredith closed 4 years ago

mikemeredith commented 4 years ago

Running parboot with parallel=TRUE obviously makes sense, but that currently means running workers on all-but-one of the available cores. If there are other apps using multiple cores, that causes problems.

I often have multiple instances of R running on a 24-core box, generally with jagsUI::jags taking 3 cores each. Trying to run a script with parboot on 23 cores at the same time is messy and means the timings from jags are meaningless.

It should be straightforward to add coresToUse to the arguments list, with something like if(missing(coresToUse)) coresToUse <- detectCores() - 1.

Thanks, Mike

rbchan commented 4 years ago

Good idea. @adamdsmith any chance you might have time to add this? @

adamdsmith commented 4 years ago

I’ll try to knock it out this morning.

rbchan commented 4 years ago

Great, thanks. What do you think about calling the argument nCores or n.cores or something shorter than coresToUse?

kenkellner commented 4 years ago

This also should be added to crossVal. I can add that based on whatever Adam calls the argument.

adamdsmith commented 4 years ago

The parboot function already has an argument nsim so to avoid multiple case types within the same function call I'll go with ncores unless there's strong objection.

rbchan commented 4 years ago

Sounds good to me

mikemeredith commented 4 years ago

Great, thanks a lot! -- Mike

jaroyle commented 4 years ago

hi fellas, thanks a lot for this... I will recompile and upload a new unmarked next week I hope. I got some hate mail from CRAN about some issue with the current version which might get the package yanked if it doesn't get resolved... (something that doesn't work with R 4.0). Will send this email around.. regards andy

On Fri, Dec 6, 2019 at 6:22 PM mikemeredith notifications@github.com wrote:

Great, thanks a lot! -- Mike

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/rbchan/unmarked/issues/149?email_source=notifications&email_token=AAHGZC5MJWABDQBBYXLIMOLQXLNEZA5CNFSM4JWI4362YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGFVH4Y#issuecomment-562779123, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHGZC7A7MWTSIBENMRRFPDQXLNEZANCNFSM4JWI436Q .

kenkellner commented 4 years ago

Regarding that error, see #151