2
$\begingroup$

I am trying to figure out what would be best for running some simulations using multiple computers where each has it's own mma 8 licence. The main part of the computation involves a parallelized table which runs the algorithm for different values.

The computers are :

  • intel i7 quad core PC
  • intel core duo laptop (from where I will be controlling the PC)

Looking around I found two basic options :

  • using ssh on Mathematica to run parallel computations
  • using remote desktop to control the PC

I am leaning towards the second for two main reasons. First, I assume that I can only use a total of 4 cores in the whole grid given the home licensing (am I wrong or does this only apply to a single license for the whole grid). Given this limitation, if I use remote desktop, I can run two simulations. This would allow me to fully benefit from the quad core PC, while still running stuff on my laptop or even work on some more code.

Is my thinking flawed? Did I miss something in the ssh options/licencing limitations that would make me lean more towards this option?

EDIT :

So it turns out that with multiple licences you can have more than 4 kernels running. Quoting Jagra :

each license will typically grant access to a minimum of 4 parallel kernels + a control kernel

So in my case, I would have 4 kernels on the quad core and 2 on my core duo, plus one control kernel. So I could really see the benefits of running the Grid for parallel kernels, even though I would only be able to use one instance of Mathematica, and not work on code while the algorithm is running. The positive side of LW Grid, as Jagra pointed out, is that you don't need to be sending input/output files between the remote PC and your control PC which can be very time and resource consuming if they are very large.

EDIT 2:

After contacting Wolfram support, they informed me that Trial licences also provide 4 kernels to the grid. (I was thinking of adding a PC which only has a trial licence for MMA9)

$\endgroup$
1

1 Answer 1

4
$\begingroup$

If each computer has a full license, each license will typically grant access to a minimum of 4 parallel kernels + a control kernel.

Also, a home license counts!

So if you have a license at work and a home license associated with it one could access (if you had the processors on the respective machines):

4 work kernels + 4 home kernels + 1 control kernel = 9 total kernels

I currently run 4 licenses across 2 servers. Each server have a pair of quad core processors (I know a bit dated but stable and robust). I control parallel processing from a dual core iMac running a home license. This lets me run a total of 18 kernels at a time. If I had a quad core in the iMac I could run 20 kernels under my license.

If you use remote desktop you may find that sending data back and forth takes a lot of time. Consider strategies like storing input data for the parallel calculations on the remote machine. I do all of my parallel processing on a wired network to avoid that kind of thing as much as possible.

ssh might prove more efficient over all, much will depend on the parallel task.

But why not set up a VLAN. Presumably you have installed the lightweight grid manager. Then Mathematica would simply recognize the remote kernels as available when you run the following from a notebook:

Needs["LightweightGridClient`"]
LaunchKernels[]

Also, consider that CDFs have their own kernel so they can run on machines without a Mathematica license (I've mentioned this in an earlier question). With some thought and planning, one could distribute as many CDFs as you have available machines (real or virtual).

$\endgroup$
6
  • $\begingroup$ That's pretty awesome. So in my case I would have 4 kernels on the quad core, plus 2 on my core duo laptop, and one control. Is there any impact on performance when using two very different cores (ie mine are clocked much lower than the quad core)? Each parallel part (item in table) runs for about 14 min on my laptop. The algorithm is the large part of the computation, and the input and output files are not very big at all, so transferring wouldn't be a problem. $\endgroup$
    – Emy
    Commented Dec 3, 2012 at 13:33
  • $\begingroup$ re: Is there any impact on performance when using two very different cores (ie mine are clocked much lower than the quad core)? This will depend on the relative performance of the different cores. Say you had a batch of 20 calculations and each of 4 identical kernels cued them up and likely end up doing 5 of the 20 each. Introduce an additional couple of kernels that run at 25% of the speed of the original ones and they might actually slow down the total processing time. If you know the capacity and throughput of the processors you can usually design your code to optimize these things. $\endgroup$
    – Jagra
    Commented Dec 3, 2012 at 16:45
  • $\begingroup$ @Emy -- Welcome to the site. Give the community a day or so to provide other answers. If one answers the question select it as an answer. Spend some time checking out the site. Lots here. $\endgroup$
    – Jagra
    Commented Dec 3, 2012 at 16:49
  • $\begingroup$ Will do, thanks. One more related question though: Does the demo licence have the same restrictions on kernels as the home? I wanted to test the benefits of adding yet another PC (which only has a demo licence) to the grid. $\endgroup$
    – Emy
    Commented Dec 3, 2012 at 17:32
  • $\begingroup$ @Emy -- Not certain about a demo license. It should at minimum make 1 more kernel available (maybe 4). $\endgroup$
    – Jagra
    Commented Dec 3, 2012 at 17:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.