Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

threads > 1 in ulam producing a compilation error #331

Open
sdaza opened this issue Oct 8, 2021 · 1 comment
Open

threads > 1 in ulam producing a compilation error #331

sdaza opened this issue Oct 8, 2021 · 1 comment

Comments

@sdaza
Copy link

sdaza commented Oct 8, 2021

Hello,
I am trying to run this model:

mdata = list(
    mx = test$mx, 
    time = test$time,
    county = test$county
)

f = alist(
    mx ~ normal(mu, sigma),
    mu <- a_cty[county] + b_time_cty[county] * time,
    c(a_cty, b_time_cty)[county] ~ multi_normal(c(a, b_time), Rho, sigma_cty),
    a ~ normal(0, 1),
    b_time ~ normal(0, 0.5),
    c(sigma, sigma_cty) ~ exponential(1),
    Rho ~ lkj_corr(2),
    save> pred <- a_cty[county] + b_time_cty[county] * time
)

model = ulam(
    f, data = mdata, chains = 1, cores = 1, 
    iter = 2000,
    cmdstan = TRUE, 
    threads = 1)

When threads are higher than 1, I got:

Syntax error in '/tmp/RtmpMs4d1l/model-3d5e2f5e7d782b.stan', line 11, column 12 to column 23, parsing error:
   -------------------------------------------------
     9:              vector sigma_cty,
    10:              real sigma,
    11:              corr_matrix[] Rho,
                     ^
    12:              int[] time,
    13:              int[] county ) { 
   -------------------------------------------------

An argument declaration (unsized type followed by identifier) is expected.
make: *** [make/program:47: /tmp/RtmpMs4d1l/model-3d5e2f5e7d782b.hpp] Error 1
Error: An error occured during compilation! See the message above for more information.

Otherwise, the model runs without problems.

@MahShaaban
Copy link

I have a similar issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants