Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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, 
    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]];
ParallelDo[
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.

share|improve this question

migrated from superuser.com May 28 '12 at 10:24

This question came from our site for computer enthusiasts and power users.

    
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. –  Szabolcs May 26 '12 at 19:45

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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