Re: MCMC in Mathematica

*To*: mathgroup at smc.vnet.net*Subject*: [mg96043] Re: MCMC in Mathematica*From*: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>*Date*: Tue, 3 Feb 2009 06:31:02 -0500 (EST)*Organization*: Uni Leipzig*References*: <gm0q4e$rmq$1@smc.vnet.net> <200902010943.EAA22903@smc.vnet.net> <gm6kti$a11$1@smc.vnet.net>*Reply-to*: kuska at informatik.uni-leipzig.de

Hi, and the old Mathematica licenses allow at least two FrontEnds and two Kernels, and if you run one of those two kernels, you can only run *one* second kernel and so one running kernel block on Mathematica process. This is even true if your license allow you to run 100 Kernels, if you run one of the Kernels you have only 99 Kernels left. And so >> a simulation written in Mathematica blocks one Mathematica license. it true as long as you are only allowed to run a finite (<Infinity) number of Mathematica kernels. And even, if it seems to you, that " A standard Mathematica license" allows more kernels than you can count (2 kernels running as masters and 8 running as workers to be precise) it is still a finite number. And the master Kernels count. This means you may be able to do the simulation on a single of the worker kernels but the master Kernel will always wait until it get an answer. So you have still only 2 master Kernels and only for parallel computing the 8 worker kernels. And if you run an simulation on a parallel setup, it will not only block one kernel it will block 1+4 kernels -- that is the situation in "these days". Your setup of several kernels by defining new kernels will also no help, because when you run more than two kernels in two notebooks you can't start a third kernel. So, keeping one kernel busy with a simulation will block you on kernel. While the most things done rather quick in Mathematica, a simulation can run several days and so you may run into the case, that you miss the license to answer the Mathematica newsgroup because you have a Mathematica 6 and a Mathematica 7 open, to check your answer with both versions ... Regards Jens J. McKenzie Alexander wrote: > 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 =EF=BF=BD that's how the new Parallel functions work, after al= l. > 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 commun= ications disclaimer: http://www.lse.ac.uk/collections/secretariat/legal/d= isclaimer.htm >

**Follow-Ups**:**Re: Re: MCMC in Mathematica***From:*Andrzej Kozlowski <akoz@mimuw.edu.pl>

**References**:**Re: MCMC in Mathematica***From:*Jens-Peer Kuska <kuska@informatik.uni-leipzig.de>