Parallelisation

74 views
Skip to first unread message

stefano palmero

unread,
Oct 11, 2023, 5:17:52 AM10/11/23
to nimble-users
Hello,
I am running a high number of SCR simulations using NIMBLE and I have issues with the speed of the "runMCMC" function. This is inside a long for loop so I tried using foreach but somehow it did not work.
I then found online examples about wrapping the entire code inside a function and using parlapply but these examples always concern simple codes while mine is quite articulated and I have a lot of inputs!
Therefore, I am asking you if there was a way to implement parallelisation into the "runMCMC" function only like it is the case for other functions from other packages using arguments such as "parallel = number of cores".

Thank you very much and I hope you can help me :)

Cheers,
Stefano

Chris Paciorek

unread,
Oct 12, 2023, 8:20:20 PM10/12/23
to stefano palmero, nimble-users
Hi Stefano,

Yeah, we agree that the parallelization support is not what we would like. It would be fairly straightforward to include parallelization in `runMCMC` but we haven't focused on it because of other priorities and because we have ongoing long-term work to build in parallelization in a more complete way.  

Can you say more about why your situation is different than the simple codes you refer to?  I ask because the function that you run in parallel can take as input an object containing the model code and objects for data, constants, etc. So I'm not sure why the number of inputs matter. Can you say more about what you are doing and specifically what makes it hard to follow the approach in the parallelization example? We might be able to make some suggestions that make things easier for you.

-chris

--
You received this message because you are subscribed to the Google Groups "nimble-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nimble-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nimble-users/50ed9780-8cb9-46df-938f-71c8e6f50831n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages