It's highly tied to what you are actually doing, but in general, the less communcation required, the faster your computation is going to be. So the single VM with 8 cores / 16 GB is going to probably be better. I'm also making the assumption that there are 8 "real" cores that are available (and dedicated) for computation and that the VM server is not oversubscribed in terms of cores. I'll also note that any virtualization solution is going to add some amount of overhead vs. doing the same on a bare metal installation.
Note this is a very general answer, you'd need to explain what you are trying to do, what algorithms you are using, and why you are entertaining splitting this up into two separate virtual machines with the "same" compute power versus using the simpler and less complex setup of the single VM.