High Performance Computing (HPC) is surging in popularity. Building INLA package on the HPC systems with the Anaconda environment sometimes can be tricky due to the Linux distributions and glibc versions. This article is to suggest a workaround with container images using Apptainer (formerly known as Singularity) because Docker requires root access and is usually not available on HPC. Apptainer can pull Docker images. Despite its convenience, the image size can be large.
2. Type the code below to pull the [rocker/geospatial](https://rocker-project.org/images/versioned/rstudio.html) Singularity Image Format (SIF) file with the latest R version. For illustration, we will assume the file is stored at `./your_container.sif`. In a shell: ```{bash apptainer-shell, eval=FALSE} # To pull the docker image apptainer pull your_container.sif docker://rocker/geospatial:latest # once the sif is downloaded, get into an interactive shell apptainer shell your_container.sif # Inside the interactive shell, one can install INLA on a personal library path R --verbose
In R:
# Now, in a R environment options(repos = c( INLA = "https://inla.r-inla-download.org/R/testing", CRAN = "https://cloud.r-project.org" )) install.packages("INLA") # One may be asked to create a personal library path. install.packages("inlabru") # quit R q()
```{bash exec, eval=FALSE}
apptainer exec ./your_container.sif Rscript --no-restore --no-save --verbose file_to_run.R ```
Note: Use inla.setOption(num.threads = ncpu)
to limit the number of threads (ncpu)
since INLA does not set it automatically. The ncpu
also directly links to RAM
requirements.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.