# Issue with re-assigning values for ParallelTable

I am solving a differential equation of two closed functions using ParallelTable.

For the attached code, I thought the computation time should be approximately proportional to `ltau`, because the `k` is iterated once. However, the time is roughly proportional to square of `ltau`. I think that `Total[s[[1;;i,i]]]` in the reassignment of `r` drags computation. I thought I should use `Unevaluated` for `Total[s[[1;;i,i]]]` to reduce time, but it doesn’t work. Would you help me with this? Is there any better way to improve the parallelization? I assume the parallelization should reduce the computation time for two iterations in `i` and `j`.

``ClearAll["Global`*"];  S = {}; RR = {};  lz = 10.; ltau = 1000.;  AbsoluteTiming[ r = ParallelTable[1., {i, lz}]; s = ParallelTable[0., {i, lz}, {j, lz}]; Do[AppendTo[RR, r]; AppendTo[S, s]; If[k == ltau, Break,  s = ParallelTable[  s[[i, j]] + (r[[i]]*Total[s[[1;;i,j]]]+r[[j]]*Total[s[[i,1;;j]]])+    If[i >j, r[[i]]*(1 + r[[j]])/2, r[[j]]*(1 + r[[i]])/2], {i, lz}, {j, lz}]; r = ParallelTable[r[[i]] - Total[s[[1 ;; i, i]]], {i, lz}];];, {k, 1, ltau}];] ``
Posted on Categories cheapest proxies