Imagine a simple loop:
constexpr int N; // some big number
#pragma omp parallel for
for(int i=0; i<N; ++i)
{
// some not very demanding computation like
// c[i] = a[i] + b[i]
}
How can I determine (approximately), if such loop is suitable for parallelization with respect to size N?
For example, if I have a 20-core CPU, this #pragma changes nothing compared to normal version in terms of speed for N = 400.
However it obviously does for something like N = 1e+7.
What should I know about hardware/operation cost/etc to estimate the speed-up(or down) of multithreading?