Re: Re: MCMC in Mathematica
- To: mathgroup at smc.vnet.net
- Subject: [mg96030] Re: [mg96027] Re: MCMC in Mathematica
- From: "J. McKenzie Alexander" <jalex at lse.ac.uk>
- Date: Mon, 2 Feb 2009 06:20:23 -0500 (EST)
- References: <gm0q4e$rmq$1@smc.vnet.net> <200902010943.EAA22903@smc.vnet.net>
On 1 Feb 2009, at 09:43, Jens-Peer Kuska wrote:
> a simulation written in Mathematica blocks one Mathematica license.
Actually, that's not quite true. A standard Mathematica license, these
days, allows several kernels to be run simultaneously on the same
computer ? that's how the new Parallel functions work, after all.
What this means is that you can assign a write a simulation in
Mathematica and execute it in a kernel specific to *that* notebook,
leaving the default kernel (plus others) free to use on other
computations.
To see how this works, do the following:
1. If you don't have a custom kernel defined, go to "Kernel
Configuration Options" under the Evaluation menu. The list of kernels
by default just includes "Local". Click on "Add" and then type a name
for the new kernel, something like "Spare Kernel". You should probably
also select the option to append the kernel name to the In/Out prompts
so that you don't get confused as to which kernel you are working in
(since definitions are not shared across kernels, by default).
2. Open up a new notebook. Select your new kernel ("Spare Kernel")
under the "Notebook's Kernel" option under the Evaluation menu.
Evaluate some simple stuff, like "x=10".
3. Open up another new notebook. Try evaluating "x" there. If
everything has been done correctly, your first notebook, using "Spare
Kernel" should know the definition of x whereas the second notebook
should not.
4. Start a long computation in the notebook using the "Spare Kernel".
Try something like:
Pause[20];
Plot[Sin[x], {x,0,10}]
and while that's working, go and do some other stuff in the second
notebook.
Even if a computation blocks one *kernel*, since most licenses include
support for several kernels being run on the same machine, a little
bit of care in setting up the computation will allow always allow one
to have a free kernel to work with in Mathematica.
Cheers,
Jason
--
Dr. J. McKenzie Alexander
Department of Philosophy, Logic and Scientific Method
London School of Economics and Political Science
Houghton Street, London, WC2A 2AE
Please access the attached hyperlink for an important electronic communications disclaimer: http://www.lse.ac.uk/collections/secretariat/legal/disclaimer.htm
- References:
- Re: MCMC in Mathematica
- From: Jens-Peer Kuska <kuska@informatik.uni-leipzig.de>
- Re: MCMC in Mathematica