Errors when running MatlabStan

219 views
Skip to first unread message

Jan Peters

unread,
Nov 26, 2014, 11:18:02 AM11/26/14
to stan-...@googlegroups.com
Hi everyone,
Thanks for putting in so much work, I just started playing around with MatlabStan, and I am really excited about it.
I seem to be running into some problems at the sampling stage. My model compiled without errors after some debugging, but now I get a bunch of error messages:

Warning: # of chains > # of cores.
> In StanModel>StanModel.set.chains at 470
  In StanModel>StanModel.StanModel at 224
  In stan at 108
  In PD_singlesub_stan at 10
  In hg_fit_pd_stan at 28
Warning: # of chains > # of cores.
> In StanModel>StanModel.set.chains at 470
  In StanModel>StanModel.set at 279
  In StanModel>StanModel.StanModel at 234
  In stan at 108
  In PD_singlesub_stan at 10
  In hg_fit_pd_stan at 28
Warning: # of chains > # of cores.
> In StanModel>StanModel.set.chains at 470
  In StanModel>StanModel.set at 294
  In StanModel>StanModel.StanModel at 234
  In stan at 108
  In PD_singlesub_stan at 10
  In hg_fit_pd_stan at 28

I also get these when calling stan with the 'chains' argument set to 1.

Then I get:

Warning: Stan seems to have exited badly.
> In StanFit>StanFit.process_exit_failure at 198
  In StanFit>StanFit.process_exit at 143
  In StanFit>@(src,evnt)process_exit(self,src,evnt)
  In processState>processState.set.exitValue at 30
  In processManager>processManager.pollTimerStop at 504
  In timer.timercb at 30
  In timercb at 13

This is using Stan 2.5, Matlab2014b, Debian Linux 7.

Any ideas?

Any help is greatly appreciated!

Best, Jan

Brian Lau

unread,
Nov 26, 2014, 12:36:15 PM11/26/14
to stan-...@googlegroups.com
Hi Jan,

The first message is a warning, which shouldn't happen when chains=1. I'm guessing that the number of cores is not reported correctly on your machine? Can you try

java.lang.Runtime.getRuntime.availableProcessors

at the matlab prompt and let me know what you see?

The second issue is strange, because the 143 error code indicates that the process was abruptly terminated. Can you send minimal model code/script that reproduces this message?

Thanks,
brian

Jan Peters

unread,
Nov 27, 2014, 4:11:43 AM11/27/14
to stan-...@googlegroups.com
Hi Brian, thanks for getting back to me so quickly.

regarding the first issue:

>>
>> java.lang.Runtime.getRuntime.availableProcessors
ans =
     2
>>

Regarding the 143 Error code, I'll need some time to come up with a minimal code to reproduce this.

Thanks for your help,
Jan

Jan Peters

unread,
Nov 27, 2014, 6:39:18 AM11/27/14
to stan-...@googlegroups.com
Hi, just an update, the 143 Error turned out to be due to an error in the model!

Brian Lau

unread,
Nov 27, 2014, 11:01:23 AM11/27/14
to stan-...@googlegroups.com
Hi Jan,

Does this mean you can run a simpler model without problem? Eg., something from: https://github.com/brian-lau/MatlabStan/wiki/Getting-Started

Regarding the warning, I don't understand how you are getting them, since you have 2 cores. However, it should run fine with the warning. If you like, you can suppress the message with "warning off;"

-b

Jan Peters

unread,
Nov 28, 2014, 8:07:55 AM11/28/14
to stan-...@googlegroups.com
Yes, simpler models run without problems. Thanks again!
Reply all
Reply to author
Forward
0 new messages