Error compiling MCNP5.1.51 Illegal operand types

I am trying to build the new version (for us) of mcnp5, we are using openmpi/1.3.2 and pgi/8.0, When building with PGI we run into a problem where PGI is saying there are syntax errors.

PGC-S-0103-Illegal operand types for comparison operator (dotcommpi_binary_op.c: 114)
PGC-S-0103-Illegal operand types for comparison operator (dotcommpi_binary_op.c: 168)
PGC-S-0103-Illegal operand types for comparison operator (dotcommpi_binary_op.c: 224)
PGC/x86-64 Linux 8.0-6: compilation completed with severe errors

— dotcommpi_convert.o —
PGC-S-0103-Illegal operand types for comparison operator (dotcommpi_convert.c: 203)
PGC-S-0103-Illegal operand types for comparison operator (dotcommpi_convert.c: 206)
PGC-S-0103-Illegal operand types for comparison operator (dotcommpi_convert.c: 209)
PGC/x86-64 Linux 8.0-6: compilation completed with severe errors


The code compiles fine with gfortran, I also verfied that these lines have not changed from our old version (1.4) built with pgi/6.2.

Example:
Line 114 has
if (operation == DOTCOMM_OP_MAX) {

operation is declared as:
int dotcommpi_binary_op (
const void *src_a,
void *src_b,
DOTCOMM_Datatype datatype,
DOTCOMM_Operation operation,
int count,
void *dest
)

From the prototype of the function.


DOTCOMM_OP_MAX is declared as:
enum DOTCOMM_Operation
{
DOTCOMM_OP_MAX = 1,
DOTCOMM_OP_MIN,
DOTCOMM_OP_SUM
};
typedef enum DOTCOMM_Operation DOTCOMM_Operation;

I don’t see how they don’t match. So I am at a loss. I can’t show anything more, due to licensing problems.

Hi BrockP,

We do have MCNP5 1.4 here in house but don’t see this error when testing with MPICH2. We’ll test again with OpenMPI 1.3.2 and see if it’s specific to this version of MPI. Otherwise, we’ll work on upgrading to version 1.5.

Thanks for the report,
Mat

Hi BrookP,

Our engineer was able to look at the error, but thinks it is correct. What’s happening is that MCNP5 is doing a comparison operation (’==’) between a 'MPI_op" and an Enum. In MPICH2, an ‘MPI_Op’ is a typedef for an int while in OpenMPI ‘MPI_Op’ is a pointer to a struct. pgcc gives an error and gcc gives a warning when comparing a Pointer to an Enum.

Please either use MPICH2 or contact the authors of MCNP5 to see if they can help in using OpenMPI.

  • Mat

Thanks, I will pass onto them.

Brock