-ipo COMMON padding breaks legacy MPI_Bcast

-ipo COMMON padding breaks legacy MPI_Bcast

MPI_Bcast sometimes is used in legacy code with the buffer set up in labeled COMMON. It relies on no padding ever being added in the COMMON, contrary to Fortran standard. With ifort 11.0 and 11.1 for Intel64, -ipo inserts padding even when the legacy rule is followed about always setting the COMMON in order of decreasing data object size. Adding -no-ansi-alias- along with /Qipo, where MPI_Bcast is called, will prevent the error. It appears preferable to set up the Bcast buffer in an explicit array or SEQUENCE type.

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Quoting - tim18
MPI_Bcast sometimes is used in legacy code with the buffer set up in labeled COMMON. It relies on no padding ever being added in the COMMON, contrary to Fortran standard. With ifort 11.0 and 11.1 for Intel64, -ipo inserts padding even when the legacy rule is followed about always setting the COMMON in order of decreasing data object size. Adding -no-ansi-alias- along with /Qipo, where MPI_Bcast is called, will prevent the error. It appears preferable to set up the Bcast buffer in an explicit array or SEQUENCE type.

Padding COMMONs for alignment is non-standard, a may be a compiler bug, unless one of your compiler flags changed the default behavior. You might try the compiler option "-align nocommons" to explicitly request no alignment padding.

The "legacy rule" of decreasing object size is just one way to avoid alignment errors, but doesn't always work. In particular, if some objects are strings, they should always come last if using the decreasing-size rule. Also, a pair of 4-byte objects can be put in sequence with 8-byte objects with no problem.

Leave a Comment

Please sign in to add a comment. Not a member? Join today