I am new to the world of Parallel computing and that is why don't know exactly where I should look at or search to get the answer.
Is there any theorem or just general theory determining which code can be split into parts to run parallelly and then merge answers? Maybe some analysis algorithm exists that allows to tell whether the code is "splittable"? For example, like data-flow analysis which shows whether a chunk of code is used, or maybe to optimize the code, etc. I guess, I have an intuition that if the problem consists of calculating values of elements in an array that depend on the previous ones, then the problem cannot be divided as we don't know future values.
So, basically this is a reference request but I will appreciate more in-depth explanation of related things. Thanks in advance!