Is it possible to specify particular task to a particular kernel to be evaluated in parallel?
1 Answer
$\begingroup$
$\endgroup$
2
krs=LaunchKernels[]; (*It launches 6 kernels by default on my PC*)
ParallelEvaluate[a = 1 + 1, krs[[5]]];
ParallelEvaluate[Names["a"]]
The output is like:
{{}, {}, {}, {}, {"a"}, {}}
-
$\begingroup$ What I am looking for is to evaluate two expressions with each executed on different kernel in parallel. For example, I want to evaluate 1+1 on kernel 1, and 2+2 on kernel 2. $\endgroup$ Commented May 23, 2020 at 13:34
-
$\begingroup$ @SleekTitan, I understood. Try
ParallelEvaluate
as I shown with corresponding second argument for choosing the kernel. Thekrs[[5]]
means the fifth one. $\endgroup$– Rom38Commented May 24, 2020 at 3:13