This question is related to this quesion. The goal is to use ParallelMap
to map a function to a nested Table
to get the FinestGrained distribution of calculation. But after that, I want to recover the original nested data structure instead of a flat one.
For example, say I have a nested Table
like this
Table[
Table[{line, honeycombnum, distance}, {line, 1,
honeycombnum + 1}, {distance, 1, 4}], {honeycombnum, 2, 5}]
as you can see, this nested table structure is not of equal length .
Then what is the general way to recover the data structure after using
ParallelMap[f[#[[1]], #[[2]], #[[3]]] &, Flatten[Table[
Table[{line, honeycombnum, distance}, {line, 1,
honeycombnum + 1}, {distance, 1, 4}], {honeycombnum, 2, 5}], 2], Method -> "FinestGrained"]
By the word "general ", I mean the method should be suitable for arbitrary complex Table
structure.