Monday, November 9, 2009

Loop Parallelism - Task Queue - Graph Partitioning

These pattrens are neatly documented and easy to understand while i was reading. I will try to answer James questions on these to continue conversation...

Loop Parallelism

1. The author says the goal of incremental parallelization is to "evolve" a sequential program into a parallel program. If you have experience in refactoring code from sequential to parallel, how did your approach differ from the steps presented in the paper?

Paper gave good approach in my view. If it were me, probably I start with mostly used areas (frequency) and analyze it first and then combine with rest of the code. If the entire app is difficult to change then look for the pieces that can be improved and apply parallelism to them.

2. Many of us have used Eclipse or another IDE, with their respective plugins, for execution profiling. What has been your experience with these tools? What is your preferred method of locating the code in question (automatic or manual)?

I have used profiling facilities that are provided in Rational Software Architect (It is based on the eclipse platform). I used it to write a plug-in which will give us the code coverage analysis (How much of your code is covered through your test cases). My preferred method is automatic.

3. The author states, "The application of many transformations to many loops may be necessary before efficient performance is achieved." What is your opinion on this statement?

It depends on complexity and also understanding of the underlying loop more than anything else. So more you know about the loop and its potential transformation the more you can optimize the transformation.

Task Queue

How would you compare the Task Queue pattern to other similar distribution patterns like divide-and-conquer and fork/join pattern?

We have a queue or queues that have multiple tasks coming in, so we take each task (divide) and work on it and when we are done with it we post the results to caller(conquer step).

Graph Partitioning

This was probably one of the more math-oriented patterns I have seen and/or read. How often have you experienced a situation where the graph partition strategy would have been useful? If never, can you think of any future situations where this pattern might be come in handy and could be applied

Any situation that can be represented as graph and have some known structure (like bipartite or so on) then we should be able to use this pattern. I can think of a situation where I need to program matching and find best matching of the pairs (which is typical graph theory app) and we can represent that as bipartite graph and use this pattern. It may not be anytime soon using this pattern in my work…

No comments:

Post a Comment