# Difference between sub MathKernel and MathKernel

When I try to run Mathematica processes in parallel on a Linux based server, I see that my server allows 7 MathKernels and 28 sub MathKernels. I was wondering what the difference is and how I can take advantage of the 28 sub MathKernels. I generally run my job like:

for i in \$var
do
"path"/math -noprompt -script "scriptname" "parameters" &
done


This results in using different MathKernels. Therefore I am able to do this iteration at most 7 times. I was wondering if I could take use of the sub MathKernel licenses, I can somehow tweak this to run 28 times. Is that possible?

-
Use ParallelTable or something similar – acl Aug 8 '12 at 17:28
Hi user1050325, you can of course keep your current user name, but many of us here would really appreciate it if you could personalize it somewhat. – Sjoerd C. de Vries Aug 8 '12 at 19:08
Related: What is Sub Mathematica? – Renan Aug 8 '12 at 19:32
The community views it as customary to accept the best answer provided or if the answers have clearly fallen short of the answer you've asked for then make a clarifying comment to help explain what you need. Such comments will often bring in additional ideas from the community. In any case welcome. – Jagra Aug 12 '12 at 16:42

## 2 Answers

The Sub MathKernel licenses are used for the additional kernels used with parallel processing constructs. With those kernels you do not interact directly, but you can submit jobs to them and collect results. See http://www.wolfram.com/products/mathematica/newin7/content/BuiltInParallelComputing/ for details on the parallel constructs which use those subkernels. Ultimately they are started by LaunchKernels (either explicitly, or implicitly through some command like ParallelTable).

On the other hand, the kernel you directly interact with uses up a MathKernel license (and so does the kernel your script runs on).

-
 So, do you mean to say that I cannot do the tweaking on the linux end and have to change my Mathematica code? right? – preeti Aug 8 '12 at 18:07 @user1050325 -- Mathematica makes it pretty easy to do all of this. Not perfect, but pretty darn good. – Jagra Aug 8 '12 at 18:09 @user1050325: Yes, unless there's a trick I don't know about. BTW, you might be interested in the code in this answer. – celtschk Aug 8 '12 at 18:09

You appear to have access to 7 Mathematica licenses each of which allow running 4 sub Math kernels. This should allow you to address

4 + 28 = 32 kernels


Also of interest, each Mathematica network license comes with a home use license. You could allocate the home use licenses to additional machines (I think even virtual machines) and get another 4 kernels to access.

32 + 4 = 36 kernels


Does anyone know if each of the home licenses can also access 4 other kernels? This starts to get fun.

Also, with a bit of skunkworks ingenuity one could conceivably run CDF's on an unlimited number of machines in parallel to handle certain kinds of parallel problems. The free CDF player essentially carries its own kernel. This introduces some intriguing potential hacks ;-)

Take a look at the following links:

Wolfram Light Weight Grid and parallel computing

Nesting Parallel processes

Server running WolframLightWeightGrid manager loses licensing information

For some of the trials and tribulations of using parallelization in Mathematica.

Also, check out the documentation and tutorials:

Parallel Computing

Parallel Computing Tools User Guide

-