Hello,
I would like to name the variables dynamically, e.g. so that their names depend on the number of the thread being executed. Something like below:
n = 3;(*numer wątku*)
ParallelDo[
Subscript[t, i] = Table[Random[], {10}], {i, n}];
t = Table[0, {10}];
Do[t += Subscript[t, i], {i, n}];
t
Unfortunately, table t has all zeros.
I tried to sum in a loop, I tried to use the $KernelID variable. Unfortunately, it didn't help.
The program "sees" the results because it can write them out:
n = 3;(*numer wątku*)
ParallelDo[
Subscript[t, i] = Table[Random[], {10}];
Print[Subscript[t, i]], {i, n}]
I am asking for a hint (it is certainly not very simple).
If "n" is greater than the number of threads, will the program (after the prompt) also work?
Best regards, DM