You don't say how you are running JAGS in parallel. If you are using any of the R packages that offer parallel computation (e.g. runjags, jagsUI) then these work with the "parallel" package which forks the R process. There is no way to get feedback from the worker processes until they have finished. This is all to the best of my knowledge; someone more informed can contradict me.
If you are using the command line interface and have written a script to dispatch different processes then running in batch mode turns off the progress bar.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am running JAGS in parallel using the "parallel" package so it seems compromised in my case.
However, can you tell me how the progress bar is updated in JAGS (when not run in parallel) ?
Thanks
Last edit: Arnaud 2017-01-12
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm not sure I understand the question, but the basic mechanism is that the requested number of iterations is broken down into 50 shorter updates. So, for example, if you request 1000 iterations then this is broken down into 50 updates of 20 iterations. At the end of each of these short updates the progress bar is refreshed. The front-end used for the progress bar depends on whether you are working on Windows or Unix, or whether you have requested a text or GUI progress bar. I'm not sure if this answers your question.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you really really want a progress bar, you could write you code to pass the model to the workers, which then update the model and then return both the saved samples and the updated model. At this stage you could update the progress bar, and then make a new cluster and send the model back out to the workers.
Also, it might be worth mentioning here that you might consider using one of the r packages designed to parallelize JAGS. In addition to the packages Martyn mentions, I quite like 'dclone' (which also uses 'parallel'). Using these packages doesn't give you a progress bar, but does give you threadsafe initial values and updates, without you needing to worry about it.
Last edit: Jacob Socolar 2017-03-02
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you use runjags::run.jags(..., method='parallel') then you get a progress bar for the first JAGS process. The presumption is that the other JAGS processes are updating at a similar speed, but the R function waits for all of the external JAGS processes to complete before continuing. See:
vignette('UserGuide', package='runjags')
Specifically table 2 (page 13). As far as I know runjags is the only package that can give a progress bar for parallel simulations (as it does not rely on the rjags interface for the parallel method).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I am running JAGS in parallel. However, doing so I lose the progress bar.
Is there a way to recover this info outside each of the "workers" ?
Thanks
I don't think so.
You don't say how you are running JAGS in parallel. If you are using any of the R packages that offer parallel computation (e.g. runjags, jagsUI) then these work with the "parallel" package which forks the R process. There is no way to get feedback from the worker processes until they have finished. This is all to the best of my knowledge; someone more informed can contradict me.
If you are using the command line interface and have written a script to dispatch different processes then running in batch mode turns off the progress bar.
I am running JAGS in parallel using the "parallel" package so it seems compromised in my case.
However, can you tell me how the progress bar is updated in JAGS (when not run in parallel) ?
Thanks
Last edit: Arnaud 2017-01-12
I'm not sure I understand the question, but the basic mechanism is that the requested number of iterations is broken down into 50 shorter updates. So, for example, if you request 1000 iterations then this is broken down into 50 updates of 20 iterations. At the end of each of these short updates the progress bar is refreshed. The front-end used for the progress bar depends on whether you are working on Windows or Unix, or whether you have requested a text or GUI progress bar. I'm not sure if this answers your question.
Is there a way to send the update information to a cross platform external progress bar, for example tcltk ?
Like what is done here
http://blog.revolutionanalytics.com/2015/03/creating-progress-bar-with-foreach-parallel-processing.html
If you really really want a progress bar, you could write you code to pass the model to the workers, which then update the model and then return both the saved samples and the updated model. At this stage you could update the progress bar, and then make a new cluster and send the model back out to the workers.
Also, it might be worth mentioning here that you might consider using one of the r packages designed to parallelize JAGS. In addition to the packages Martyn mentions, I quite like 'dclone' (which also uses 'parallel'). Using these packages doesn't give you a progress bar, but does give you threadsafe initial values and updates, without you needing to worry about it.
Last edit: Jacob Socolar 2017-03-02
If you use runjags::run.jags(..., method='parallel') then you get a progress bar for the first JAGS process. The presumption is that the other JAGS processes are updating at a similar speed, but the R function waits for all of the external JAGS processes to complete before continuing. See:
Specifically table 2 (page 13). As far as I know runjags is the only package that can give a progress bar for parallel simulations (as it does not rely on the rjags interface for the parallel method).