MATLAB Engine RunOptions do not seem to work with parfeval
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Nolin Borrero Jr
le 10 Avr 2024
Réponse apportée : Nolin Borrero Jr
le 17 Avr 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 commentaires
Sam Marshalik
le 11 Avr 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?
Réponse acceptée
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur C Shared Library Integration dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!