1
$\begingroup$

Say I want to distribute a task in the following way on the available subkernels:

ParallelSubmit[
 foo[x_] = x;
 Print[foo[3]];
];

ParallelSubmit[
 foo[x_] = x^2;
 Print[foo[3]];
];

WaitAll[%]

Is there a way to re-define foo[x] explicitly for a kernel with a specific ID?

$\endgroup$
  • $\begingroup$ When I saw your question a few days ago, I searched a bit, but couldn't find a simple solution with ParallelSubmit. Can you explain why you want to do this? Normally, computations would be run on the first available subkernel. Is it that some of your subkernels are slow and some are fast? $\endgroup$ – Szabolcs Jan 15 '18 at 19:14
  • $\begingroup$ @Szabolcs: Say I have a task which is evaluated in parallel. According to the result I have to change a specific foo definition for further calculations which are evaluated in parallel. Would this be possible? $\endgroup$ – pawel_winzig Jan 16 '18 at 21:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.