brian-lau / MatlabProcessManager

Matlab class for launching and managing asynchronous processes
BSD 2-Clause "Simplified" License
22 stars 12 forks source link

Infinite trying again #2

Closed avehtari closed 10 years ago

avehtari commented 10 years ago

If there are other error than the "occasional", StanModel.m does not print the true error and gets stuck in infinite retry loop. For example, if using too old Matlab with too old c++-library in the path, stanc does not work. I suggest a following fix % Check that processManager is in path if ~exist('processManager') error('Required MatlabProcessManager is missing') end tries=4; while tries>0 % FIXME, occasionally stanc does not return version? % This is likely a problem with Java running out of file % descriptors. tries=tries-1; try ver = self.stan_version(); [self.defaults,self.validators] = mstan.stan_params(ver); break; catch err disp(err.message) disp('Having a problem getting stan version.'); disp('Trying again.'); end end

brian-lau commented 10 years ago

Good point. Never should have left that potential for an infinite loop there. I will update this in MatlabStan.

brian-lau commented 10 years ago

Updated in MatlabStan 0.6.1 https://github.com/brian-lau/MatlabStan/commit/2ca31f70a71d83972f9adc27865daf55b358a53f