Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: Re: [OMPI users] Prototypes for Fortran MPI_ commands using 64-bit indexing
From: Jeff Squyres (jsquyres) (jsquyres_at_[hidden])
Date: 2013-11-12 13:47:55

On Nov 12, 2013, at 4:42 AM, George Bosilca <bosilca_at_[hidden]> wrote:

>> 2. In the 64 bit case, you'll have a difficult time extracting the MPI status values from the 8-byte INTEGERs in the status array in Fortran (because the first 2 of 3 each really be 2 4-byte integers).
> My understanding is that in Fortran explicitly types variables will retain their expected size. Thus, instead of declaring
> one should go for
> This should make it work right now.

You are correct. That's a good workaround.

> However, it is a non-standard solution, and we should fix the status handling internally in Open MPI.
> Looking at the code I think that correctly detecting the type of our ompi_fortran_integer_t during configure (which should be a breeze if the correct flags are passed) should solve all issues here as we are protecting the status conversion between C and Fortran.

Not quite. We do already correctly determine ompi_fortran_integer_t as a C "int" or "long long" (that's what I saw yesterday when I tested this myself).

However, the key here is that MPI_STATUS_SIZE is set to be the size of a ***C*** MPI_Status (but expressed in units of Fortran INTEGER size -- so in the sizeof(int)==sizeof(INTEGER)==4 case, MPI_STATUS_SIZE is 6. But in the sizeof(int)==4, sizeof(INTEGER)==8 case, MPI_STATUS_SIZE is 3.

That being said, we *could* change this so that MPI_STATUS_SIZE is always 6, and have the C<-->Fortran status routines just do the Right Thing depending on the size/type of ompi_fortran_integer_t.

Either way, as you say, it's a nonstandard solution. So I don't know which way is "more correct". On the one hand, we've had it this way for *years* (so perhaps there's code out there that uses the George workaround and is working fine). But OTOH, it's different than what you would have to do in the non-dash-i8 case, and so we should make MPI_STATUS_SIZE be 6 and then Fortran code will work identically (without INTEGER*4) regardless of whether you used -i8 or not.


> Jim, can you go in the include directory on your Open MPI installation and grep for the definition of ompi_fortran_integer_t please.
> George.
> _______________________________________________
> users mailing list
> users_at_[hidden]

Jeff Squyres
For corporate legal information go to: