[Octopus-devel] [Octopus-notify] svn commit: r4417 - in trunk/src: grid h_sys states sternheimer by dstrubbe
xavier at tddft.org
Sun Jul 27 07:38:14 WEST 2008
On Fri, 25 Jul 2008, octopus-notify at tddft.org wrote:
> *) Changed explicit loops over NP in calc_beta to vector expressions
> with 1:NP instead -- isn't this potentially more efficient, as well as
> more compact in the code?
In theory, yes. But in practice, no. Many compilers (intel for example)
take an expression like
a(1:n) = b(1:n) + c(1:n) + d(1:n)
and calculate it like this
tmp(1:n) = c(1:n) + d(1:n)
a(1:n) = b(1:n) + tmp(1:n)
which is clearly less efficient and requires extra memory. That is why we
use explicit loops in performance critical parts.
More information about the Octopus-devel