I am trying to re-write a piece of serial code to work in a parallel environment and am trying to make a diagram detailing all of its processes so that it can be clear which ones can be parallelised. I was wondering if there is a convention for such diagrams and if people could give me some advice on them. I am participially confused with how one might show how these processes make up larger processes (ie how the functions are made up). I am also a little unsure of how I can show loops, especially the difference between independent loops and loops which must be done in series.
Share
What you mostly need to know are the data dependencies. No data dependency between two blocks of code –> they can be parallelized.
There’s a granularity problem: there’s almost always dependency between two pieces of code referencing the same array if we think about the array as the dataflow item; one resolves this by partitioning the array in ranges as determine by how the loops step across the array. This is especially true for loops.
How these dependencies are displayed is another matter. On can simply say, “code block A reads/writes data item P, Q conflicts with code block B writes P and reads Q”. Or, one can draw a graph showing the dataflows. (Where one can isolate the dataflows over a subgraph of code, one can parallelize).