Avoid using function calls in OpenMP directives
authorErik Lindahl <erik@kth.se>
Tue, 12 Aug 2014 12:15:30 +0000 (14:15 +0200)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Tue, 30 Sep 2014 11:09:27 +0000 (13:09 +0200)
The direct calls to gmx_omp_nthreads_get() that were
included in some OpenMP pragmas caused memory
corruption and later segfaults on PGI compilers. This
is likely a compiler bug, but we can work around it
by assigning the function return value to a variable
that we use in the pragma.

Such variables are unused when OpenMP is not in use, which might
offend some compiler some time, so adding a gmx_unused attribute is
useful. However, uncrustify needs to be taught about our custom
attributes, which is also done here.

Change-Id: I3b482bdc2401b40a043975ffd4a741f65efd0cfc


No differences found