Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: running multiple mathkernel's

  • To: mathgroup at smc.vnet.net
  • Subject: [mg90462] Re: running multiple mathkernel's
  • From: John Jowett <John.M.Jowett at gmail.com>
  • Date: Thu, 10 Jul 2008 06:34:28 -0400 (EDT)
  • References: <g4vjkb$9c3$1@smc.vnet.net>

First of all, it should be said that people often want two different
notebooks to run the same kernel so that's why new notebooks normally
just run the same default kernel. Speaking for myself, I think that's
the most common situation.

Once you have set up a second kernel, its parameters are remembered
from one Front End session to the next so all you have to do is change
a given notebook's kernel in the Evaluation menu.  That's really very
little trouble, in my opinion.

I don't set up non-default kernels to launch automatically on startup:
this would slow down startup and use memory unnecessarily in the
majority of sessions where I only use one kernel.

Personally, I have a few kernels set up (some of them launch on other
computers) for when I need to run separate or background
calculations.

Mathematica's Front End + Kernel design is very flexible:   you can
send expressions from one kernel to another,
use a different kernel for different cells within the same notebook,
etc. etc.

John Jowett





On Jul 8, 1:38 pm, Bob F <deepyog... at gmail.com> wrote:
> Is there a way to automatically have Mathematica v6 run a separate
> MathKernel for two notebooks so that they could run concurrently? I
> was running a really long calculation that ended up taking about an
> hour, and so opened up another notebook to do something else while I
> waited for the other notebook to finish running. I thought that
> Mathematica would run the second MathKernel that is available for this
> second notebook, but the only thing that happened in the second
> notebook was wait for the first one to finish.
>
> So I started looking into setting up a second kernel via the
> "Evaluation/Kernel Configuration Options" menu item, and added a
> second MathKernel to automatically launch on front end startup,
> thinking that Mathematica would use this spare MathKernel on the
> second notebook, but it didn't. I could see the two MathKernel
> processes running, but only one of them would actually run all the
> notebooks that I tried to run at the same time.
>
> What I ended up doing was manually assigning a kernel to the second
> notebook with the "Evaluation/Notebook's Kernel", and then finally it
> would run at the same time as the other. I tried this on both Mac and
> Windows versions of Mathematica V6 with similar behavior and results.
>
> After spending the time in getting all this done, I thought surely
> there must be a way for Mathematica to automatically use as many
> MathKernel's as needed for running more than one notebook at a time,
> within the limit's of your licenses. With a normal Mathematica license
> you can run up to two MathKernel processes and one front end
> Mathematica processor. I even thought that if you had two licenses on
> two different computers that you could conceivably run 4 MathKernel's,
> but this is apparently only possible if you have something called
> network licensing, which costs more money than a normal license. There
> is also something called PersonalGrid that has up to 5 MathKernals (1
> master plus 4 computation kernels) but am guessing it would have the
> same issue of having to manually assign a kernel to a notebook, so
> each notebook program could conceivably run at the same time. Does
> anyone know if this is the case or not? If not how does it really
> work?
>
> What is the purpose of having two MathKernel processes as part of the
> license if you have to go thru all the extra work of manual
> assignment? Why doesn't Mathematica do this automatically for you??  I
> had a suggestion that I should run two copies of Mathematica, but that
> seemed way to much overhead for what I wanted to do. Is this what most
> people do who have a similar situation of one really long calculation
> and wanting to do other work in another notebook while waiting for the
> long one to finish?
>
> Does anyone have any suggestions on how to do this association of
> notebooks to MathKernel processes so that they could be running at the
> same time in some sort of automatic fashion and avoid having to
> manually manage it like I did?? It would seem that with multi-core and
> multi-processor systems becoming more common that this would be of
> interest to more and more people. Any comments or suggestions of how
> this works in Mathematica?
>
> Thanks...
>
> -Bob



  • Prev by Date: Re: How to use package without manually evaluating?
  • Next by Date: Re: Difference between two commands.
  • Previous by thread: Re: running multiple mathkernel's
  • Next by thread: Re: running multiple mathkernel's