-
Notifications
You must be signed in to change notification settings - Fork 36
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
Need help to speed up model fitting: How can we go parallel processing using different cores for fitting all the models at the same time? #150
Comments
I understand you want to run several separate processes simultaneously, each with different model setting. Look at the standard package parallel (it is in the default installation of R). If you used You should take care of a couple of details:
|
I do think that parallel processing of your models makes little sense, and sequential processing is a sensible strategy. You increase thin 10-fold in each model and this gives approximately similar 10-fold increase in running time of each model. So the relative running times are 1, 10, 100, 1000, 10000 etc, and all previous models took only 11% of the time needed to run your current model. This means that theoretical maximum saving in computing time is 11% given by the longest running model. Further, the purpose of this sequence of models is not to run them all, but find sufficient thinning. When you run models sequentially from faster to slower, you can analyse the last finished model while the next is running, and if the diagnostics indicate that thinning is sufficient, you can keep that model and terminate the running process (which would take nearly 10 times longer than all models so far). The purpose is not to run all these models, but stop as soon as you can. This makes little sense in parallel processing. Parallel processing can make sense if you have alternative model structures (different fixed effects, random effects, etc.), and you really need to run all these models to compare them later. In that case you can use parallelization tools that are provided by your operating environment and launch several models in parallel. That is a service that is above and outside our Hmsc package. So read guides to parallel package. |
Thanks, Jari, for the directions. Actually, my system has a moderate setup. So, it was taking a colossal time. I asked about this because I want to remotely move the thinning in a supercomputer facility with multiple cores to appoint for parallel processing. |
Parallel processing can be performed at various levels in Hmsc
|
This is the situation --------
[1] "thin = 1; samples = 5"
[1] "Thu Nov 24 13:17:24 2022"
[1] "model = Model1"
setting updater$Gamma2=FALSE due to specified phylogeny matrix
[1] "thin = 1; samples = 250"
[1] "Thu Nov 24 13:20:18 2022"
[1] "model = Model1"
setting updater$Gamma2=FALSE due to specified phylogeny matrix
[1] "thin = 10; samples = 250"
[1] "Thu Nov 24 13:29:33 2022"
[1] "model = Model1"
setting updater$Gamma2=FALSE due to specified phylogeny matrix
[1] "thin = 100; samples = 250"
[1] "Thu Nov 24 13:57:03 2022"
[1] "model = Model1"
setting updater$Gamma2=FALSE due to specified phylogeny matrix
[1] "thin = 1000; samples = 250"
[1] "Thu Nov 24 17:59:58 2022"
[1] "model = Model1"
setting updater$Gamma2=FALSE due to specified phylogeny matrix
How can i speed up this fitting?
The text was updated successfully, but these errors were encountered: