Message Boards Message Boards

0
|
6393 Views
|
4 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Why does LaunchKernels[] sometimes crash the kernel?

Posted 10 years ago

Hello again, community!

In an earlier post, I mentioned a rather serious memory leak issue with the new FEM package in Mathematica 10. Due to this, I've now been experimenting with launching parallel kernels, doing some computations in them, grabbing the results and then closing them. This way, I can work around the memory leak issue, since any leaked memory is freed once the kernel doing the computations is closed. Of course this also has the added benefit of greatly improving the run time of my code.

However, this is where I ran into another issue. I tried repeatedly executing the following type of code:

LaunchKernels[];
% Insert any parallel computations
CloseKernels[];

However, this tends to crash after a number of repetitions (sometimes as little as 4, sometimes as many as 10-12). When I say crash, I mean that the main kernel of the notebook crashes and gets restarted, stopping all computations and dropping all variables/function definitions/etc.

The computations themselves don't seem to be particularly relevant. Here's a sample code that results in a crash

Do[(LaunchKernels[]; CloseKernels[]; Print[i]), {i, 15}]
POSTED BY: Jonatan Lehtonen
4 Replies

Yes, V10 does detect physical cores.

Are you loading any custom startup code from an init.m file?

This is a wild guess, but try to uncheck Preferences -> Internet Conectivity -> Allow the Wolfram System to access the Internet, restart and see if anything changes.

POSTED BY: Ilian Gachevski

I'm not using any custom startup code, and nothing changed after trying your suggestion. I also tried fiddling with the settings in Preferences -> Parallel, to no avail.

I guess it's time to file a bug report, since there doesn't seem to be anything obvious I'm doing wrong.

POSTED BY: Jonatan Lehtonen

No crash on my 4-core Linux machine using the same version (I ran the launch-and-close example, except with 1000 iterations).

If you have V9 installed, could you check if the same problem is present there?

POSTED BY: Ilian Gachevski

That's a good point. I tested it on V9 and had no such problems, the iteration ran up to 1000 without a crash. The problem seems isolated to V10; however, since I need the FEM package, I unfortunately don't have the option of using V9.

I also noticed that V9 is detecting 8 processor cores on my machine, whereas V10 detects 4 (which affects the number of kernels started by default). I'm using a quadcore processor with two threads per core, so apparently V9 is detecting virtual cores whereas V10 detects physical cores.

POSTED BY: Jonatan Lehtonen
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