[R-sig-ME] glmmTMB, OpenMP and Ubuntu
Ben Bolker
bbo|ker @end|ng |rom gm@||@com
Mon Sep 7 20:48:09 CEST 2020
Try running TMB::openmp() . If you already have R installed with
OpenMP support, that should tell you how many cores OpenMP is configured
to run with.
In general R automatically gets built with OpenMP support if a given
OS/compiler combination supports it; I don't know much about how to
troubleshoot that if it *doesn't* happen automatically, but there seems
to be a little information here
https://cran.r-project.org/web/packages/ProFit/vignettes/ProFit-OpenCL-OpenMP.html
After it's installed, you could try running some fairly big models
with glmmTMB(..., control=glmmTMBControl(parallel=xx)) where xx is
either 1 or >1 (NULL, the default, automatically sets the max number of
OpenMP threads to the number of available cores on my machine). Use
system.time() to check the elapsed time (if you want to be more
systematic and your examples are fast enough to run several times, you
can use one of the available R benchmarking package). I would also
suggest using 'top' or some system monitoring GUI to check the CPU load
while your job is running ... the expectation is that the CPU % listed
for your R process will reflect the number of OpenMP threads being used.
If you encounter anything particularly interesting you could report
it at https://github.com/glmmTMB/glmmTMB/issues/620 ...
On 9/7/20 5:56 AM, mega-x using gmx.net wrote:
> Dear all,
>
>
>
> I am currently fitting a complex model with glmmTMB that involves random
> effects and covariance structures (spatiotemporal autocorrelation). I would
> like to try the experimental parallel optimization feature
> <https://cran.r-project.org/web/packages/glmmTMB/vignettes/parallel.html>
> to reduce computation time. To do this I've setup a virtual machine running
> Ubuntu 20.04 on 16+ cores. However, I found no information in how to setup
> OpenMP, R and glmmTMB. Is there a step by step guide that I can follow?
>
>
>
> The Vignette states the following:
>
> "If your OS supports OpenMP parallelization and R was installed using
> OpenMP, glmmTMB will automatically pick up the OpenMP flags from R's
> Makevars and compile the C++ model with OpenMP support."
>
> I was not able to find any information on how to install R using OpenMP.
>
>
>
> Best,
>
>
>
> Xaver
>
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-mixed-models using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>
More information about the R-sig-mixed-models
mailing list