"How do you write pseudo-code for parallel programming? Especially, how do you differentiate local and shared variables? How do you represent operations like scatter, gather, reduce, broadcast, and point-to-point communications? Is there some standards about that?"
Please, note the original question was asked here but it still does NOT have a good acceptable answer.
Re-elaborating other questions, summarizing and keeping the things easy: is there a way of saying in pseudocode "DO ALL THESE THINGS IN PARALLEL"?
I am using the package algorithm2e
with TeXStudio
. How to typeset the parallel code using them?
Best Answer
After some web research, I have realized that a kind of "standard" still does not exits. So here is my personal solution using
algorithm2e
:The result is:
It is based on defining a new command using the expression
\SetKwBlock
. The manual of the package can be found here. Also, I have just added almost the same solution to a similar question on StackOverflow. The answer and the question can be found here.Using the strategy of defining your keywords in order to describe your algorithm with the details you prefer, it should be always possible. Take into consideration that:
The same strategy has been used in journal papers (for instance, see Algorithm 3 and 4 of this IEEE journal paper).