I have installed Mathematica 8, but I think the commands for parallelizations do not work! Even when I try to test the example in the Help of Mathematica, I face with

ParallelDo::nopar: No parallel kernels available; proceeding with sequential evaluation.

Please guide me how to resolve this problem. In fact I wish to then use ParalledDo in the following code to reduce the computational time:

ClearAll[n, A, V, Id, b, L, i, pr]
n = 1000;
A = SparseArray[{{i_, i_} -> 3 i, {i_, j_} /; i == j + 1 -> j}, {n, 
b = SparseArray[Table[1, {i, n}]];
DA = Diagonal[A];
B = SparseArray[Table[(1/DA[[i]])^1, {i, 1, n}]];
Id = SparseArray[{{i_, i_} -> 1}, {n, n}];
V = SparseArray[DiagonalMatrix[B]];
VV = SparseArray[A.V];
  V = SparseArray[V].SparseArray[2 Id - VV];
  L[i] = Norm[N[SparseArray[b - SparseArray[A].SparseArray[V.b]]]];
  Print["The residual norm of the linear system solution is:" 
    Column[{i}, Frame -> All, FrameStyle -> Directive[Blue]] 
    Column[{L[i]}, Frame -> All, FrameStyle -> Directive[Blue]]];
  , {i, 4}] // Timing

I will be thankful if anyone gives me some tips to reduce the computational cost of matrix-by-matrix multiplications in the above written code.

  • $\begingroup$ BTW the nopar message suggests that you either have a single core CPU or you set Mathematica not to launch any parallel kernels. You can launch kernels manually using LaunchKernels even on a single core machine. $\endgroup$ – Szabolcs May 26 '12 at 19:45

Do you have parallel kernels set up? This is done from the options:

enter image description here

You need to make sure Local Kernels are not disabled. If they're enabled and the options set as shown, then evaluating, for example, ParallelDo[Pause[1]; f[i], {i, 4}] without parallel kernels launched automatically launches them.

| improve this answer | |

Your Answer

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

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