brian-lau / matlabprocessmanager Goto Github PK
View Code? Open in Web Editor NEWMatlab class for launching and managing asynchronous processes
License: BSD 2-Clause "Simplified" License
Matlab class for launching and managing asynchronous processes
License: BSD 2-Clause "Simplified" License
I'm using this in conjunction with MatlabStan. When I call the compile method on the StanModel object, I get this error
Error using processManager/start (line 411)
Looks like command doesn't exist. Check spelling or path?
Error in processManager/set.command (line 215)
self.start();
Error in processManager (line 178)
self.command = p.Results.command;
Error in StanModel/compile (line 846)
p = processManager('id','compile',...
I've been using MatlabProcessManager and MatlabStan happily for ages. I suspect the bug was introduced in the last commit to this repo. Would appreciate any pointers.
Ctrl-C on OSX terminates whatever is running in the Matlab session, but leaves any processes controlled by processManager running.
On Windows (Windows 7, 64-bit, Matlab 2011b), Ctrl-C also terminates the processes controlled by processManager.
Doesn't seem to be any way to make the behavior consistent?
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
Default should be unique to instance
Would be useful to change priority of process. Doesn't seem to be a way to do this using Runtime, but at least on Unix systems, we could renice the process after launch.
In my code, I create a processManager object. When it goes out of scope, i.e., when Matlab decides to call the destructor, I sporadically¹ see this error message:
The following error was caught while executing 'processManager' class destructor:
Error using timer/stop (line 34)
Invalid timer object. This object has been deleted and should be removed from your workspace using CLEAR.
Error in processManager/delete (line 483)
stop(self.pollTimer);
I guess that this is a race condition between the destructor and the timer's stop()
function calling pollTimerStop()
.
Would it help to turn pollTimerStop()
into a non-static function which not only deletes the timer at the end, but also sets this.pollTimer = [];
?
¹ sporadically in this context means something like once in 100 executions.
Hello, I'm facing a problem which cannot allow me to launch an executable whether I don't prepend /usr/bin folder.
processManager("command", "java"); // KO
processManager("command", "/usr/bin/java"); // OK
The path is already set.
Environment info:
Lubuntu (Linux 5.11.0-18-generic)
Matlab R2021a
Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
Hello,
when the 'file_overwrite' is set to true in model.set, for example multiple calls of Stan from Matlab without the need for new Stan model name, then the fit results get mixed from each iteration. Most probably the Matlab wrapper does not wait until one fit is complete and the next begins. Any suggestion how to fix it ?
Regards
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.