Say if I wanted to parallelise an algorithm. Only certain parts of this algorithm can be parallelised. The other parts are trivial and not worth distributing. Do I do all of these trivial calculations on my master node and then broadcast the data to all remaining nodes OR do I conduct these calculations on ALL processors?
If the operation is as trivial as you say, and each node has all the information necessary to carry out the operation, then the communication will be substantially more expensive than recomputing locally on each node. That said, it's a good exercise to write both implementations and compare; experiment is better than the advice of strangers on the internet.
The break-even point when a task becomes non-trivial will depend on how the problem has been parallelized. It's much lower for shared-memory parallelism on the same machine than it is for distributed-memory parallelism across a cluster. For that matter, it probably depends on whether your cluster is using ethernet or infiniband. A handy reference that I often come back to is Latency Numbers Every Programmer Should Know. It's 6 years old at this point but the same principle still applies.
An addition to @Daniel Shapero's answer.
It might also be important to know if there are computations that can lead to different results depending on which machine they are launched (or just vary from launch to launch) – and how sensitive is your code to those fluctuations.
These will be even more pronounced if the cluster you are working on is inhomogeneous (nodes can be different).
- Computations that depend on random number generator (with non-fixed seed)
- Floating-point calculations. Which might slightly differ from machine-to-machine (if the architecture/OS is different) or even on the same machine (say, OpenMP reduction has been performed).
Now, if this is the case and your future calculation are really sensitive to that, you might consider broadcasting instead of everybody calculating this step individually.
Again, the benchmarking will give you the ultimate answer.
Since you tagged this with "MPI": there is no master node. The stuff that is too trivial should be done redundantly on every process.
Bear in mind that even sending a single byte through an MPI message is the equivalent of (tens of) thousands of operations.