'Optimal number of parallel processes for computation with a CPU with 6 cores and 12 threads

On a computer with an Intel CPU marketed "6 cores / 12 threads", I want to run as many processes as possible, each of them doing math similar computations (each process has a single thread) with different input data. There is no GPU involved, and no inter-process communication is needed.

What is the optimal number of parallel processes of the same executable doing math computations?

Should I run 6 processes (one per physical core)? Or 12 processes (one per thread / virtual core)?

If one process does, say, 1000 computations per second, I'm pretty sure that running 6 of them will run at ~1000/sec each (so a total of ~6000/sec).

But won't running 12 processes make them only 500 computations per second each?

TL;DR: should I run one process per "core" or one process per "thread" on a "6 cores/12 threads Intel CPU"?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source