INLA crashing when num.threads > 1

341 views
Skip to first unread message

pierre...@hotmail.fr

unread,
Nov 14, 2016, 11:49:15 AM11/14/16
to R-inla discussion group
Hello,

I try to run the model below with 5 covariates (with one interaction) with one random effect and with one a SPDE model.

formula = y ~ -1 + intercept + a + b + x + c + a:b + f(u, model="iid) + f(spatial.field, model=spde)
model<-inla(formula,data=inla.stack.data(stack, spde=spde), family="gaussian", control.predictor=list(A=inla.stack.A(stack)), control.compute=list(dic=TRUE,cpo=TRUE))

The model consists of 76,147 observations and the mesh has 373 vertices.

This model is running when I add num.threads = 1, but it kept crashing when num.threads > 1. I added control.inla= list(strategy = "gaussian", int.strategy = "eb") to fix the problem but it kept crashing when num.threads was superior to 1.

Does the model will run faster if num.threads > 1 ? If so, is there a way to run the model with more threads ? 

I work on Mac OS Sierra 10.12.1, 4 Core, with 16Gb RAM, and below I add the error message and the last lines of the message when verbose=TRUE.

Thanks,

Pierre Barry



The error message is : 

Error in inla.inlaprogram.has.crashed() :
  The inla-program exited with an error. Unless you interupted it yourself, please rerun with verbose=TRUE and check the output carefully.
  If this does not help, please contact the developers at <he...@r-inla.org>.


And here are the last lines the message when I add verbose = TRUE

        Index table: number of entries[9], total length[100340]
                tag                            start-index     length
                Predictor                               0      99919
                u                                   99919         42
                spatial.field                       99961        373
                intercept                          100334          1
                a                                  100335          1
                b                                  100336          1
                c                                  100337          1
                x                                  100338          1
                a:b                                100339          1
        parse section=[11] name=[INLA.Parameters] type=[INLA]
        inla_parse_INLA...
                section[INLA.Parameters]
                        lincomb.derived.only = [Yes]
                        lincomb.derived.correlation.matrix = [No]
                global_node.factor = 2.000
                global_node.degree = 2147483647
                reordering = -1
Contents of ai_param 0x7fcfcbd6bc70
        Optimiser: DEFAULT METHOD
                Option for domin-BFGS: epsx = 0.005
                Option for domin-BFGS: epsf = 1e-05 (rounding error)
                Option for domin-BFGS: epsg = 0.005
                Option for GSL-BFGS2: tol  = 0.1
                Option for GSL-BFGS2: step_size = 1
                Option for GSL-BFGS2: epsx = 0.005
                Option for GSL-BFGS2: epsf = 0.000353553
                Option for GSL-BFGS2: epsg = 0.005
                Restart: 0
                Mode known: No
        Gaussian approximation:
                abserr_func = 0.0005
                abserr_step = 0.0005
                optpar_fp = 0
                optpar_nr_step_factor = -0.1
        Gaussian data: Yes
        Strategy:       Use a mean-skew corrected Gaussian by fitting a Skew-Normal
        Fast mode:      On
        Use linear approximation to log(|Q +c|)? Yes
                Method:  Compute the derivative exact
        Parameters for improved approximations
                Number of points evaluate:       9
                Step length to compute derivatives numerically:  0.000100002
                Stencil to compute derivatives numerically:      5
                Cutoff value to construct local neigborhood:     0.0001
        Log calculations:        On
        Log calculated marginal for the hyperparameters:         On
        Integration strategy:    Automatic (GRID for dim(theta)=1 and 2 and otherwise CCD)
                f0 (CCD only):   1.100000
                dz (GRID only):  0.750000
                Adjust weights (GRID only):      On
                Difference in log-density limit (GRID only):     4.000000
                Skip configurations with (presumed) small density (GRID only):                                                                               On
        Gradient is computed using Central difference with step-length 0.010000
        Hessian is computed using Central difference with step-length 0.100000
        Hessian matrix is forced to be a diagonal matrix? [No]
        Compute effective number of parameters? [Yes]
        Perform a Monte Carlo error-test? [No]
        Interpolator [Auto]
        CPO required diff in log-density [3]
        Stupid search mode:
                Status     [On]
                Max iter   [1000]
                Factor     [1.05]
        Numerical integration of hyperparameters:
                Maximum number of function evaluations [100000]
                Relative error ....................... [1e-05]
                Absolute error ....................... [1e-06]
        To stabilise the numerical optimisation:
                Minimum value of the -Hessian [-inf]
        CPO manual calculation[No]
        Laplace-correction is Disabled.

inla_build: check for unused entries in[/var/folders/5w/jb_mh_dx7p95wnjmrfrx09_0                                                                             0000gp/T//Rtmpu4whHv/file10b661425d56/Model.ini]
inla_INLA...
        Strategy = [DEFAULT]
        Size is [100340]
        Chose OpenMP-strategy [HUGE]
        Chose density-strategy [LOW]
        Size of graph=[100340] constraints=[0]
        Found optimal reordering=[amdbarc] nnz(L)=[39790117] and use_global_nodes(user)=[no]
        List of hyperparameters:
                theta[0] = [Log precision for the Gaussian observations]
                theta[1] = [Log precision for u]
                theta[2] = [Theta1 for spatial.field]
                theta[3] = [Theta2 for spatial.field]
Optimise using DEFAULT METHOD



INLA help

unread,
Nov 14, 2016, 2:51:55 PM11/14/16
to pierre...@hotmail.fr, R-inla discussion group
On Mon, 2016-11-14 at 08:49 -0800, pierre...@hotmail.fr wrote:
> Hello,
>
> I try to run the model below with 5 covariates (with one interaction)
> with one random effect and with one a SPDE model.
>
> formula = y ~ -1 + intercept + a + b + x + c + a:b + f(u, model="iid)
> + f(spatial.field, model=spde)
> model<-inla(formula,data=inla.stack.data(stack, spde=spde),
> family="gaussian", control.predictor=list(A=inla.stack.A(stack)),
> control.compute=list(dic=TRUE,cpo=TRUE))
>
> The model consists of 76,147 observations and the mesh has 373
> vertices.
>
> This model is running when I add num.threads = 1, but it kept
> crashing when num.threads > 1. I added control.inla= list(strategy =
> "gaussian", int.strategy = "eb") to fix the problem but it kept
> crashing when num.threads was superior to 1.
>
> Does the model will run faster if num.threads > 1 ? If so, is there a
> way to run the model with more threads ? 
>
> I work on Mac OS Sierra 10.12.1, 4 Core, with 16Gb RAM, and below I
> add the error message and the last lines of the message when
> verbose=TRUE.


Hi,

yes, it will run faster with more threads (up to some limit).

could you try adding

control.inla = list(reordering = "metis")

?


--
Håvard Rue
he...@r-inla.org

pierre...@hotmail.fr

unread,
Nov 15, 2016, 9:10:52 AM11/15/16
to R-inla discussion group, pierre...@hotmail.fr, he...@r-inla.org


Le lundi 14 novembre 2016 19:51:55 UTC, help help a écrit :
Hi,

yes, it will run faster with more threads (up to some limit).

could you try adding

control.inla = list(reordering = "metis")

?


--
Håvard Rue
he...@r-inla.org


Hello,

Thanks for the response.

No it kept crashing either when num.threads > 1 or when I remove num.threads. 

Below the last lines when verbose = TRUE. The reordering parameter changed from -1 to 3. 

Thanks,

Pierre Barry

                output:
                        summary=[1]
                        return.marginals=[1]
                        nquantiles=[3]  [ 0.025 0.5 0.975 ]
                        ncdf=[0]  [ ]
        Index table: number of entries[9], total length[100340]
                tag                            start-index     length
                Predictor                               0      99919
                u                                   99919         42
                spatial.field                       99961        373
                intercept                          100334          1
                a                                  100335          1
                b                                  100336          1
                c                                  100337          1
                x                                  100338          1
                a:b                                100339          1
        parse section=[11] name=[INLA.Parameters] type=[INLA]
        inla_parse_INLA...
                section[INLA.Parameters]
                        lincomb.derived.only = [Yes]
                        lincomb.derived.correlation.matrix = [No]
                global_node.factor = 2.000
                global_node.degree = 2147483647
                reordering = 3
Contents of ai_param 0x7fddaae15db0
inla_build: check for unused entries in[/var/folders/5w/jb_mh_dx7p95wnjmrfrx09_0                                                                             0000gp/T//RtmpvHD4W1/file183a4227b405/Model.ini]
inla_INLA...
        Strategy = [DEFAULT]
        Size is [100340]
        Chose OpenMP-strategy [HUGE]
        Chose density-strategy [LOW]
        Size of graph=[100340] constraints=[0]

INLA help

unread,
Nov 15, 2016, 9:52:06 AM11/15/16
to pierre...@hotmail.fr, R-inla discussion group

if you can send me stuff so I can rerun it here, I can check

H
> -- 
> You received this message because you are subscribed to the Google
> Groups "R-inla discussion group" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to r-inla-discussion...@googlegroups.com
> .
> To post to this group, send email to r-inla-discussion-group@googlegr
> oups.com.
> Visit this group at https://groups.google.com/group/r-inla-discussion
> -group.
> For more options, visit https://groups.google.com/d/optout.

--
Håvard Rue
he...@r-inla.org
Reply all
Reply to author
Forward
0 new messages