I am using NDSolve
on a workstation with 6 kernels. To speed up the simulation I have used LaunchKernels[]
to load all the available parallel kernels. I am not sure whether or not this simple command makes the simulation a parallel computation? However, I found that the running time with LaunchKernels[]
is the nearly the same order of that without LaunchKernels[]
.
My questions are:
What on earth does
LaunchKernels[]
do for a particular computation? Or under what circumstances should I useLaunchKernels[]
?How do you tell Mathematica to compute parallelly on a workstation or a dual-core laptop? For example, how to parallelize this example:
fsol = NDSolve[{D[u[x, t], t] == D[u[x, t], x, x], u[x, 0] == 1 - Sin[4*Pi*x]/(4*Pi), u[0, t] == 1, u[1, t] + Derivative[1, 0][u][1, t] == 0}, u, {x, 0, 1}, {t, 0, 1}, Method -> {"MethodOfLines", "SpatialDiscretization" -> {"TensorProductGrid", "MinPoints" -> 100}}]; Plot[First[u[1, t] + Derivative[1, 0][u][1, t] /. fsol], {t, 0, 1}, PlotRange -> All]
Parallelize
,ParallelTable
and so on $\endgroup$NDSolve[]
is parallelizable. $\endgroup$