0

Is there a mathematical algorithm that can determine whether a problem is parallelizable?

Possibly similar to how the definition for "computable" works out:

https://en.wikipedia.org/wiki/Computable_function

So a parallelizable program is a program that ...?

mavavilj
  • 427
  • 2
  • 8
  • How do you define "parallelizable"? – Wolfgang Bangerth May 05 '22 at 16:04
  • @WolfgangBangerth Length of critical path < total number of operations? Of course by that definition there is very little that is not parallelizable to some extent. – Victor Eijkhout May 05 '22 at 20:23
  • There's a large literature on parallel computational complexity. Some problems can be solved on a polynomial number of processors in polylogarithmic time- this is the class NC. – Brian Borchers May 05 '22 at 22:38
  • @VictorEijkhout I'm thinking about it more from a practical perspective. The diamond dependency graph is parallelizable in the sense that the two middle nodes can be worked on in parallel. But that's not so interesting, in this sense nearly every program can be parallelized. --- As a consequence, I think it would be useful for the OP to say what exactly they are looking for when they use the word. – Wolfgang Bangerth May 06 '22 at 02:57
  • @WolfgangBangerth Parallelizable: the problem or parts of it can be independently solved (possibly at the same time) and combined together afterwards. https://en.wikipedia.org/wiki/Parallel_algorithm But I presumed e.g. that such "determination algorithm" would, possibly, say e.g. that "if the problem contains an iteration in time, then it cannot be parallelizable". – mavavilj May 06 '22 at 08:23
  • What @WolfgangBangerth and I are talking about is that almost every code has some amount of paralleism. https://theartofhpc.com/istc/parallel.html#CriticalpathandBrent'stheorem Even your comment on iteration can maybe be parallelized: https://theartofhpc.com/istc/parallellinear.html#Recursivedoubling – Victor Eijkhout May 06 '22 at 12:27
  • It's important to make the distinction between determining whether an algorithm (or code) can be run in parallel and whether a problem may have parallelizable solutions. It may be that one algorithm for solving a problem can be made to work in parallel while another cannot. – Brian Borchers May 06 '22 at 19:00
  • @mavavilj Take the following example: a=2; b=2*a; c=3*a; d=b+c; Here, b and c can be computed in parallel. So by your definition, the algorithm to compute d is parallelizable, and indeed nearly every modern compiler will detect this. But is this interesting? Maybe yes, if you're into exploiting superscalar architectures of modern CPU cores. Is it what you are curious about? I don't know -- you need to define more clearly what it is you want to know and how you define "parallelizable". – Wolfgang Bangerth May 06 '22 at 19:54

0 Answers0