As a general rule of thumb, it is better to use 20 cpus in 1 node since intra-node communication is faster than inter-node communication.
This generally depends upon the problem definition. If you want to use a shared memory programming model (create threads/tasks etc), then 1 node with 20 cpus will be better. You can take advantage of shared memory, caching, less communication overheads. But if your application requires both shared and distributed memory (processes spread among nodes), then using multiple nodes may be beneficial.
But if your problem (shared/distributed) only requires resources of a single node to solve it, then as a generic rule don't take extra nodes, because you don't get any benefit from it. Even if your application uses distributed memory paradigm, use single node because the intra-node communication is very fast and optimised.
As @Poshi's comment, more concrete answer is problem specific. It requires understanding the problem and profiling the application to come up with a specific solution.