Thank you for your e-mail. To save you the trouble of running some experiments, I'd like to let you know what the problem was in our case.

A routine compiled with "Portland" called a routine compiled with "Pathscale".

A logical .TRUE. parameter was passed, so "Portland" passed in a "-1" (If the calling routine had been compiled with "Pathscale", a "+1" would have been passed).

The "pathscale" routine called a "C" routine from the MVAPICH library.

The MVAPICH code said:   

	#ifndef MPI_FORT
	#define MPI_FORT

	/* Define the internal values needed for Fortran support */

	/* Fortran logicals */

	/* Fortran logical values */
	#ifndef _CRAY
	#define MPIR_TO_FLOG(a) ((a) ? MPIR_F_TRUE : MPIR_F_FALSE)
	   Note on true and false.  This code is only an approximation.
	   Some systems define either true or false, and allow some or ALL other
	   patterns for the other.  This is just like C, where 0 is false and 
	   anything not zero is true.  Modify this test as necessary for your
	#define MPIR_FROM_FLOG(a) ( (a) == MPIR_F_TRUE ? 1 : 0 )

	/* CRAY Vector processors only; these are defined in /usr/include/fortran.h 
	   Thanks to */
	#define MPIR_TO_FLOG(a) (_btol(a))
	#define MPIR_FROM_FLOG(a) ( _ltob(&(a)) )    /*(a) must be a pointer */

Obviously MPIR_F_TRUE was set to "1", so the "MPIR_FROM_FLOG" macro converted the "-1" to "0", i.e. "the Portland .TRUE. to a .FALSE."

The value for MPIR_F_TRUE is probably set up in the "configure" stage, and as such would be set to "+1" for Portland and "-1" for Pathscale.

So you see my original comment does still hold.

        You have to be very careful coding and using an ABI.


Greg Lindahl wrote:
On Thu, Mar 17, 2005 at 12:29:22PM +0000, Neil Storer wrote:

Be careful when you say:


I think that you'll find that pathf90 accepts -1 for TRUE, so this is
easily handled by the binding for MPI. I'd have to write some test
programs to be sure, and I'll get back to you on that. I think the
difference is whether the compiler tests the sign bit or non-zero for
TRUE. I'm not sure if either our compiler or PGI's ever does
arithmetic on logical vlues.

This is definitely a bug in our documentation, though, thanks for
pointing that out.

-- greg

users mailing list

| Neil Storer     |    Head: Systems S/W Section    | Operations Dept. |
| ECMWF,          | email:    |    //=\\  //=\\  |
| Shinfield Park, | Tel:   (+44 118) 9499353        |   //   \\//   \\ |
| Reading,        |        (+44 118) 9499000 x 2353 | ECMWF            |
| Berkshire,      | Fax:   (+44 118) 9869450        | ECMWF            |
| RG2 9AX,        |                                 |   \\   //\\   // |
| UK              | URL:    |    \\=//  \\=//  |
   | ECMWF is the European Centre for Medium-Range Weather Forecasts |