0

I am running a batched analysis on a server (using SBATCH slurm) using glmfit() 106 times and it keeps outputting warning files that don't appear when I run on local. I get multiple types of warning types

Warning: Iteration limit reached

Warning: The estimated coefficients perfectly separate failures from successes

...

All warnings are generated in glmfit() with warning(message(...))

As a result I can't look at my debug outputs. I include warning('off','all') at the top of every script in the analysis but I am still getting multiple warning outputs to an output file I write to with

#SBATCH -o <analysis_name>-%j.out
#SBATCH -e <analysis_name>-%j.out

I've tried dropping the -e line but still received the error logs (because they were MATLAB, not system errors).

Brendan Frick
  • 1,047
  • 6
  • 19

1 Answers1

0

Encountered this issue now exactly as described and this is what solved it. With this change the warning shows once. If you are running a parallel loop, then it will show once for every worker.

At the head of the iteration do:

lastwarn('', '');

Then, after, where the warning happens, do:

[warnMsg, warnId] = lastwarn();
if (~isempty(warnId))
    warning('off', warnId);
end