fix thread-safety issue in affinity layout detection
authorSzilard Pall <pszilard@cbr.su.se>
Mon, 27 May 2013 17:23:00 +0000 (19:23 +0200)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Thu, 30 May 2013 09:19:17 +0000 (11:19 +0200)
commite5d22a35ccf1f35af3067ee4c03a75fc54432d1d
treef37a1fb6b8b2efcd112c34f912a0c85b4fbda993
parent34a402e7bfb0c950edd7a7a624acf48334333a2d
fix thread-safety issue in affinity layout detection

The pinning stride variable is shared by thread_mpi ranks and its
value is changed only when its initial value is 0. This posed a
thread-safety issue and in some cases the selected pinning stride was
only reported in the log if rank 0 happened to arrive first to the
affinity layout detection.

Refs #1254

Change-Id: Id32af8cbeacea2205fd15c30b46320ec7dd35e5e
src/gmxlib/gmx_thread_affinity.c