MATLAB Engine RunOptions do not seem to work with parfeval
1 view (last 30 days)
Show older comments
Nolin Borrero Jr
on 10 Apr 2024
Answered: Nolin Borrero Jr
on 17 Apr 2024
I am using MATLAB Engine with 2023b. When I specify a TextWriter in RunOptions, the expected behavior is that all disp() functions well send the value to the TextWriter. This works for the client portion of the function. If I create a worker thread using parfeval and provide a dataQueue, I expected to be able to make calls to disp basically the same way.
msg = parallel.pool.DataQueue;
msg.afterEach(@disp);
However, the behavior that I'm seeing is that these messages end up in the MATLAB Command Window.
Is there any way around this? Can I get the disp calls from the worker thread to use the same TextWriter that was specified in RunOptions?
Also, if I use MATLAB Runtime, then the messages in afterEach(@disp) do not show up at all.
2 Comments
Sam Marshalik
on 11 Apr 2024
Hey Nolin, can you provide a bit more information about your situation and goal.
Are you looking to create a DataQueue between multiple threaded workers or something else?
parfeval workers run in the background, so how are you looking to collect their displays output?
Accepted Answer
More Answers (0)
See Also
Categories
Find more on C Shared Library Integration in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!