mandymejia / BayesfMRI

BayesfMRI R package
GNU General Public License v3.0
24 stars 7 forks source link

INLA License Error #15

Closed smeisler closed 2 years ago

smeisler commented 2 years ago

Hello,

The code to get the INLA license inla.pardiso() results in the following error:

Error in browseURL("https://pardiso-project.org/r-inla/") : 
  'browser' must be a non-empty character string

Getting a 12-month license (free) from the INLA website does work though.

Best, Steven

danieladamspencer commented 2 years ago

Hi Steven,

This looks like an issue with the browseURL function, which by default assigns browser = getOption"browser"). What happens when you try to browse another URL (i.e. browseURL("https://www.google.com")? Do you have a default browser set in your OS?

When you run the inla.pardiso() function, you should get the following output:

`

inla.pardiso()

The R-INLA page at the PARDISO project should open in your browser, which gives more information (https://pardiso-project.org/r-inla)

The PARDISO package is a thread-safe, high-performance, and easy to use software for solving sparse symmetric that arises in the R-INLA approach to Bayesian inference within the R project for Statistical Computing. R-INLA supports PARDISO for MacOSX and Linux. Windows is not supported for the moment.

To improve R-INLA within parallel and high-performance computing, we need a modern sparse-matrix library to build upon, and and for this, PARDISO, is the very best choice in our opinion.

The PARDISO library is not enabled by default when calling inla(). You can you can enable it, by

  1. Obtaining a license key from pardiso-project.org/r-inla The licenses is tied up to the username, so the same license can be used one all computers where you have the same username. (You can also collect various licenses in the same file, each connected with different usernames.)
  2. Add the license key to R-INLA, by assigning the full path of the license-file to variable 'pardiso.license', for example, library(INLA) inla.setOption(pardiso.license="~/sys/licenses/pardiso.lic")
  3. That is it!
  4. You can check that PARDISO is enabled and is working, by inla.pardiso.check()

    Using remote computing with inla.call="remote", you may need to add the full path to the license file (on the remote host) in the ~/.inlarc file: PardisoLicenseFile="FullPathToTheLicenseFile" Otherwise, your local license file will be used if its available.

    You can also request PARDISO explicitely with control.compute=list(openmp.strategy="pardiso"), Nested parallelism, is controlled by the "num.threads" argument num.threads="A:B" with A threads in the outer layer and B threads in the inner. (Think of this as dealing with A matrices at the same time, and using B threads on each of them.) Good choices are

    • A=number.of.hyperparameters+1 or A=2*number.of.hyperparameters
    • B=a low number like 1, 2, 4, ... higher for huge models. You also need to take the number of cores/threads available into account. A zero can be used for both A and B and their values will be set by the program.

    PARDISO support is still under development, and changes in the interface/behaviour might occour.

    Please report problems to help@r-inla.org

    Havard Rue & Olaf Schenk May 2018 Updated August 2020 `

After receiving this output, you should be taken to the URL mentioned in your error message: https://pardiso-project.org/r-inla/

In any case, you should be able to use the package without having R link to your browser once your follow the steps in the output I pasted above.

I hope that helps! Dan

smeisler commented 2 years ago

Hi Dan,

Thanks for the helpful response! I imagine my issues are ultimately stemming from working on a HPC and not my local machine. Either way, just going to the website manually and getting the license has worked, so I'll close this.

Steven