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