MathGroup Archive 2011

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

Search the Archive

Re: How to distribute specific tasks to specific subkernels?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg121638] Re: How to distribute specific tasks to specific subkernels?
  • From: "Oleksandr Rasputinov" <oleksandr_rasputinov at hmamail.com>
  • Date: Fri, 23 Sep 2011 03:44:19 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <j5f67m$q7o$1@smc.vnet.net>

On Thu, 22 Sep 2011 12:29:58 +0100, Davi <davi3070008 at me.com> wrote:

> Hi,
>
> I am having trouble on using the automatic "Parallelize" to do my
> parallel computations, and I would like to know if there is a
> straightforward way to manually select which tasks should be run in
> each subkernel.
>
> A workaround I know is to open multiple Mathematica sessions, but
> there should be a less time-consuming option.
>
> Thanks for the help.
>
> Davi
>

See Parallel`Developer`ParallelDispatch. Regrettably this is now  
completely undocumented, so I quote from the older but much more complete  
Parallel Computing Toolkit documentation:

ParallelDispatch[h[e_1, e_2, ..., e_n], {k_1, k_2, ..., k_m}] evaluates  
e_i on kernel k_i and returns h[r_1, r_2, ..., r_n], where r_i is the  
result of evaluating e_i. The default list of kernels is Kernels[]. The  
number m of kernels must be at least as large as the number m of  
expressions. ParallelDispatch has HoldFirst so that h[e_1, e_2, ..., e_n]  
is not evaluated on the master kernel before the parallelization.  
ParallelDispatch[{e_1, e_2, ..., e_n}, {k_1, k_2, ..., k_m}] is equivalent  
to Parallel`Developer`Receive[Inner[Parallel`Developer`Send, {k_1, k_2,  
...., k_n}, {e_1, e_2, ..., e_n}]].

If the current documentation is judged good enough and not worth investing  
extra effort to bring up to the very high standard set originally by  
Maeder, it would be very helpful if WRI would put the PCT documentation up  
on MathSource for the benefit of those for whom the present documentation  
is not sufficient. (In fact, why not just put the whole PCT package up,  
given that it's no longer available to buy.)




  • Prev by Date: Re: Artistic impression of cloudy structures
  • Next by Date: Re: Bug with Sequence and Assignment by Part...
  • Previous by thread: How to distribute specific tasks to specific subkernels?
  • Next by thread: Re: How to distribute specific tasks to specific subkernels?