mit-crpg/openmc — pull request #339 by paulromano (2014-11-06 04:19:05+00:00)
Title: Better support for OpenMPI

OpenMC can currently be compiled with older versions of OpenMPI (pre-1.7) when built with f90-size=small, but the newer versions of OpenMPI do not work. This pull request fixes some of the issues related to OpenMPI.

In OpenMPI 1.7/1.8, if the underlying compiler supports non-standard directives for ignoring type/kind/rank, e.g. Intel's `!DEC$ ATTRIBUTES NO_ARG_CHECK`, it takes advantage of this to disable type checking of choice buffers. This allows it to build interfaces that have strict type checking on all non-choice buffers. There were a few cases in OpenMC where routines were passing 8-byte integers rather than 4-byte integers, and this was causing OpenMPI's type checks to prevent compilation. We never saw this with MPICH or older OpenMPI versions because all type checks were ignored.

There is also a bug in OpenMPI 1.7/1.8 (scheduled to be fixed in 1.8.4) where MPI_SIZEOF doesn't exist in any of the Fortran interfaces. I've gotten around this by calling MPI_TYPE_MATCH_SIZE rather than MPI_SIZEOF to perform the same function.