Project

General

Profile

Bug #2365

UtilityUnitTests is broken on ppc64le, aarch64, ppc64, s390x and armv7hl

Added by Christoph Junghans over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Affected version - extra info:
Affected version:
Difficulty:
uncategorized
Close

Description

Found here:
https://koji.fedoraproject.org/koji/taskinfo?taskID=23831365

Dominik Mierzejewski already did some research here:
https://src.fedoraproject.org/rpms/lmfit/pull-request/1#comment-2707

I quote:

Example failure (ppc64le):

/builddir/build/BUILD/gromacs-2018-beta3/src/gromacs/utility/tests/basedefinitions.cpp:79: Failure
Value of: addr3 % 8
  Actual: 4
Expected: 0

This comes from http://redmine.gromacs.org/projects/gromacs/repository/entry/src/gromacs/utility/tests/basedefinitions.cpp?utf8=%E2%9C%93&rev=release-2018#L79 .

Indeed, gcc warns about over-alignment here (and in many other places):

/builddir/build/BUILD/gromacs-2018-beta3/src/gromacs/utility/tests/basedefinitions.cpp: In member function 'virtual void gmx::BasedefinitionsTest_GmxAlignedDeclaresAlignedVariable_Test::TestBody()':
/builddir/build/BUILD/gromacs-2018-beta3/src/gromacs/utility/tests/basedefinitions.cpp:59:27: warning: requested alignment 32 is larger than 16 [-Wattributes]
     GMX_ALIGNED(real, 8)  r3;
                           ^~
/builddir/build/BUILD/gromacs-2018-beta3/src/gromacs/utility/tests/basedefinitions.cpp:71:27: warning: requested alignment 32 is larger than 16 [-Wattributes]
     GMX_ALIGNED(int, 8)   i3;
                           ^~

It looks like max alignment by gcc on ppc64le is 16, so I guess the GMX_ALIGNED macro needs to be fixed not to request anything more than BIGGEST_ALIGNMENT. Unfortunately, this is gcc-specific: https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html.

According to gcc upstream, non-working over-alignment is not a bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68267.


Related issues

Related to GROMACS - Task #2367: construct pbc_simd less oftenNew

Associated revisions

Revision 43a0002e (diff)
Added by Roland Schulz over 1 year ago

Replace GMX_ALIGNED with alignas and SIMD alignment define

This allows each platform to define its required or
preferred SIMD alignment, and we avoid using alignments
larger than what might be supported on each architecture.
Also fix overalignment in pairs.

Fixes #2365

Change-Id: I4793adf31d186eade8a1fd8c920ab75c685ad53f

History

#1 Updated by Dominik Mierzejewski over 1 year ago

Christoph Junghans wrote:
[...]

Indeed, gcc warns about over-alignment here (and in many other places):

Actually, just one other place:
https://redmine.gromacs.org/projects/gromacs/repository/revisions/release-2018/entry/src/gromacs/listed-forces/pairs.cpp#L555
These are the warnings:

/builddir/build/BUILD/gromacs-2018-beta3/src/gromacs/listed-forces/pairs.cpp:555:43: warning: requested alignment 64 is larger than 16 [-Wattributes]
/builddir/build/BUILD/gromacs-2018-beta3/src/gromacs/listed-forces/pairs.cpp:556:43: warning: requested alignment 64 is larger than 16 [-Wattributes]
/builddir/build/BUILD/gromacs-2018-beta3/src/gromacs/listed-forces/pairs.cpp:557:48: warning: requested alignment 64 is larger than 16 [-Wattributes]
/builddir/build/BUILD/gromacs-2018-beta3/src/gromacs/listed-forces/pairs.cpp:555:43: warning: requested alignment 64 is larger than 16 [-Wattributes]
/builddir/build/BUILD/gromacs-2018-beta3/src/gromacs/listed-forces/pairs.cpp:556:43: warning: requested alignment 64 is larger than 16 [-Wattributes]
/builddir/build/BUILD/gromacs-2018-beta3/src/gromacs/listed-forces/pairs.cpp:557:48: warning: requested alignment 128 is larger than 16 [-Wattributes]
/builddir/build/BUILD/gromacs-2018-beta3/src/gromacs/listed-forces/pairs.cpp:555:43: warning: requested alignment 64 is larger than 16 [-Wattributes]
/builddir/build/BUILD/gromacs-2018-beta3/src/gromacs/listed-forces/pairs.cpp:556:43: warning: requested alignment 64 is larger than 16 [-Wattributes]
/builddir/build/BUILD/gromacs-2018-beta3/src/gromacs/listed-forces/pairs.cpp:557:48: warning: requested alignment 64 is larger than 16 [-Wattributes]
/builddir/build/BUILD/gromacs-2018-beta3/src/gromacs/listed-forces/pairs.cpp:555:43: warning: requested alignment 64 is larger than 16 [-Wattributes]
/builddir/build/BUILD/gromacs-2018-beta3/src/gromacs/listed-forces/pairs.cpp:556:43: warning: requested alignment 64 is larger than 16 [-Wattributes]
/builddir/build/BUILD/gromacs-2018-beta3/src/gromacs/listed-forces/pairs.cpp:557:48: warning: requested alignment 128 is larger than 16 [-Wattributes]
/builddir/build/BUILD/gromacs-2018-beta3/src/gromacs/listed-forces/pairs.cpp:555:43: warning: requested alignment 64 is larger than 16 [-Wattributes]
/builddir/build/BUILD/gromacs-2018-beta3/src/gromacs/listed-forces/pairs.cpp:556:43: warning: requested alignment 64 is larger than 16 [-Wattributes]
/builddir/build/BUILD/gromacs-2018-beta3/src/gromacs/listed-forces/pairs.cpp:557:48: warning: requested alignment 64 is larger than 16 [-Wattributes]
/builddir/build/BUILD/gromacs-2018-beta3/src/gromacs/listed-forces/pairs.cpp:555:43: warning: requested alignment 64 is larger than 16 [-Wattributes]
/builddir/build/BUILD/gromacs-2018-beta3/src/gromacs/listed-forces/pairs.cpp:556:43: warning: requested alignment 64 is larger than 16 [-Wattributes]
/builddir/build/BUILD/gromacs-2018-beta3/src/gromacs/listed-forces/pairs.cpp:557:48: warning: requested alignment 128 is larger than 16 [-Wattributes]

#2 Updated by Gerrit Code Review Bot over 1 year ago

Gerrit received a related patchset '1' for Issue #2365.
Uploader: Erik Lindahl ()
Change-Id: gromacs~release-2018~I9bc7000da44ca905f90783ea9963bf9808d0f99e
Gerrit URL: https://gerrit.gromacs.org/7387

#3 Updated by Erik Lindahl over 1 year ago

  • Status changed from New to Fix uploaded

#4 Updated by Christoph Junghans over 1 year ago

I used that patch in https://koji.fedoraproject.org/koji/taskinfo?taskID=23901386 and it seems to fix the issue, but now HardwareTopologyTest.NumaCacheSelfconsistency fails on aarch64, which is a different issue (#2366).

#5 Updated by Erik Lindahl over 1 year ago

AFAIK (from the hwloc documentation) the remaining issue is with hwloc rather than Gromacs.

#6 Updated by Mark Abraham over 1 year ago

  • Related to Task #2367: construct pbc_simd less often added

#7 Updated by Gerrit Code Review Bot over 1 year ago

Gerrit received a related patchset '2' for Issue #2365.
Uploader: Roland Schulz ()
Change-Id: gromacs~release-2018~If70d5432e0811d2195464725ea4fa0906fe5d49e
Gerrit URL: https://gerrit.gromacs.org/7391

#8 Updated by Gerrit Code Review Bot over 1 year ago

Gerrit received a related patchset '1' for Issue #2365.
Uploader: Mark Abraham ()
Change-Id: gromacs~release-2018~I2329d6114cd4c065666084d3076489012e93f5e4
Gerrit URL: https://gerrit.gromacs.org/7393

#9 Updated by Gerrit Code Review Bot over 1 year ago

Gerrit received a related patchset '1' for Issue #2365.
Uploader: Roland Schulz ()
Change-Id: gromacs~release-2018~I4793adf31d186eade8a1fd8c920ab75c685ad53f
Gerrit URL: https://gerrit.gromacs.org/7395

#11 Updated by Erik Lindahl over 1 year ago

  • Status changed from Fix uploaded to Resolved

#12 Updated by Erik Lindahl over 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF