2
$\begingroup$

I have access to a Linux cluster and I'm trying to use Parallelize to run the above bellow faster, but whenever I try to place Parallelize in any other parts, besides the loop, where I think it may help (i.e., computing the determinant), I run into errors. I'm looking for any suggestions on how to make the code below matrix.nb running faster.

 LaunchKernels[6]

 Dy[k_, n_] :=
   Module[{f, i, j, a, b, L, c},
     f[i_, j_] :=
       Boole[i != j]*Sum[Product[x[a], {a, s}]*
          Product[y[b], {b,
             Complement[Delete[Range[n], {{i}, {j}}], s]}], {s,
               Subsets[Delete[Range[n], {{i}, {j}}], {k - 1}]}];
 L = List @@ Expand[Det[Array[f, {n, n}]]];
 c = Count[L, _?Internal`SyntacticNegativeQ];
 {c, Length[L]}]

Parallelize[Do[Do[Print[{k+1,k+1+n,Dy[k+1,k+1+n]}],{n,10}],{k,4}]]

I am running it with:

 bsub -q hour -n 8  -M 6 -R "span[hosts=1]" -i matrix.nb -o results math
$\endgroup$
  • 1
    $\begingroup$ It is difficult to say as it also depends on the cluster sometimes. you might be interested in checking ClusterIntegration documentation. $\endgroup$ – Sumit Oct 17 '16 at 11:32

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.