Warning: Error occurred while evaluating listener callback. (problem with parfor?)

5 views (last 30 days)
I get the following error randomly sometimes after my MATLAB program hangs and I press ctrl-c. I'm not using any object oriented code myself, though I do use 3rd party libraries that might (they also use mex files if that matters).
It uses some fairly long-running loops and so is not very easy to test -- usually the problem does not occur; maybe if I knew a bit more about the message I could come up with a test case. Here is the error:
??? Warning: Error occurred while evaluating listener callback. > In dataToFluxFixMulti at 14 In yeastAnalysis at 163 In yeastResults at 37 ??? Error using ==> parallel_function at 598
Error in ==> dataToFluxFixMulti at 14 parfor i = 1:nReps
Error in ==> yeastAnalysis at 163 [v_fix, ~, v_fix_s, ~] = dataToFluxFixMulti( ...
Error in ==> yeastResults at 37
If it helps, here is the rather short function that has the parfor loop:
function [v_sol, lIter, v_sol_s, lIter_s] = ...
dataToFluxFixMulti(m, r, r_sd, nReps)
% This is like dataToFlux, but returns a mean and std
% for v_sol and lIter, and saves the flux distributions.
nRxns = length(m.rxns);
v_sol_Dist = zeros(nReps, nRxns);
lIter_Dist = zeros(nReps, nRxns);
timeInit = num2str(now());
parfor i = 1:nReps
[v_sol, lIter] = dataToFluxFix(m, r, r_sd);
v_sol_Dist(i, :) = columnVector(v_sol)';
lIter_Dist(i) = lIter;
end
v_sol = mean(v_sol_Dist)';
lIter = mean(lIter_Dist);
v_sol_s = std(v_sol_Dist)';
lIter_s = std(lIter_Dist);
fileNameOut = ['dataToFlux_' num2str(nReps) '_' timeInit '.mat'];
save(fileNameOut, 'v_sol', 'v_sol_s', 'v_sol_Dist', ...
'lIter', 'lIter_s', 'lIter_Dist');

Answers (0)

Categories

Find more on Interactive Control and Callbacks 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!