Message Boards Message Boards

0
|
9530 Views
|
3 Replies
|
0 Total Likes
View groups...
Share
Share this post:

The kernel is not responding to a dynamic evaluation - but where?

Posted 5 years ago

As a basic user of Mathematica 12, on a Mac (10.14 / 10.15), I was rather pleased that I got parallize working. What I had was the following:

Parallelize[Table[Fold[montecarlofunction[#1, baseValue, #2] &, startValue,aRandomSelection[[aSelection]]], (aSelection, numberOfTrials)]]

This was all working nicely until I tried to add a bit of logging into the 'montecarlofunction'. The logging was used to verify the function for a single run. The result was very slow Parallelize (reason was an append to a list being used as the log). When I finally realised my error I then aborted the calculation removed the logging and reran the Parallelize. It came up with "the kernel is not responding to a dynamic evaluation". Since then the Paralelizing always fails with the error. Without Parallelize it ran. Until today. Even in the single run run of my function I got the the "kernel is not responding to a dynamic evaluation". This single run has been working without problems for at least a year.

Even better - after a clean install of Mathematica I still get the error, lots of beach ball. Today I got the error if I open help, if the mouse goes over a graphic, etc, in fact when ever Mathematica randomly decides to do so. The way to stop it is to stop the Kernel but that's not a solution. So what is it's cause? If there a way to find out what is causing the dynamic evaluation. The very odd thing about all of this is that the error appeared from one moment to the next. My first reaction was it must be something Apple changed in the OS or firmware due to an overnight update. But that seems rather unlikely as more user would have this problem. Assuming that somewhere in my code I have something that is causing this. How would I go about finding this?

Any suggestion?

POSTED BY: mark hazelhoff
3 Replies
Anonymous User
Anonymous User
Posted 5 years ago

Even better - after a clean install of Mathematica I still get the error, lots of beach ball.

I would guess your Global` or other context you had Symbol definitions that you subsequently lost you were un-aware of (happens to Mathematica users "all the time", that after resetting things no longer work or that they won't work until after resetting). i would guess you had multiple definitions of "montecarlo". without all the code i cannot test it myself.

It certainly has nothing to do with Apple's new Catalina OS.

POSTED BY: Anonymous User

This will require the full code in order to have any chance for diagnosing the issue.

POSTED BY: Daniel Lichtblau
Posted 5 years ago

Assuming that the cause of the error lies between the keyboard and chair I cleaned up (rewrote) my code. What I discovered was that a list (of lists) was causing a memory problem.

aListOfData = RandomInteger[10, {10000, 4}];

(this mimics my data set) followed by

howManyRandoms = 1 000 000;
aFixedListofRandoms =  Table[RandomChoice[aListOfData, 220], {howManyRandoms}];

This list, the purpose of which is to allow the Monte Carlo sim to run against a fixed list, causes the allocated memory of the Wolfram Kernel to increase hugely each run of the assignment On a 2012 MacBook Pro with 16 GB running 10.14.6, running Mathematica 12 I have seen the following memory jumps (each row is a restart of Mathematica):

164 MB, 7GB, 13GB, 20GB, 30GB

164 MB,7GB, 27GB

These memory increase are not surprising considering the size of the table being created. I also ran a trial version of Mathematica on a windows computer with similar memory increases.

Even when the memory in use was a'mere' 6GB I begin to notice a slow down of cell calculation and general responsiveness of Mathematica, and of course the 'dynamic evaluation' error. The original value of 'howManyRandoms' was 100; I used 1 000 000 elsewhere in my coe and obviously set this one incorrectly without realizing - thus falling under the heading of "un-aware" & "all the time" . Returning this back to 100 allows Parallezie to function again.

Whether or not 'aFixedListofRandoms' is used in further calculations (i.e the Monte Carlo simulation) with a 'size' of 100 or 1 000 000 is irrelevant to the slow down of Parallize. As long as the huge table was created somewhere (and therefore assign to some Out[]), there is the slow down .

So thanks for looking into this. I have learned some more about Mathematica, which is always good.

POSTED BY: Updating Name
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract