George Bosilca <bosi...@icl.utk.edu> writes:

>> No. The Fortran status must __always__ be 6, because we need enough room to 
>> correctly convert the 3 useful variables to Fortran, plus copy the rest of 
>> the hidden things.These 6 type will be INTEGER (which will then be different 
>> than the C int). The C<->F stuff will do not a memcpy but copy all elements 
>> while casting to the correct Fortran type (ompi_fortran_integer_t).
>> 
>> The fact that we are talking about 3 integers in the Fortran status might 
>> explain the segfault. This number should never be 3 it should be ALWAYS 6 or 
>> the function MPI_Status_c2f will clearly overwrite the memory.
>
> I did manage to try this idea on an -i8 enabled Open MPI version. The test 
> application provided on one of the early email successfully complete without 
> the segfault and with a correct output.
>
>  node=                     0 and size=                      2 : Hello
>  node=                     1 and size=                      2 : Hello
>  Iam =                     1 and my temp value is =                      1
>  Iam =                     0 and my temp value is =                      1
>
> So the fix is trivial, make MPI_STATUS_SIZE always equal to 
> sizeof(MPI_Status)/sizeof(int). Everything else is already taken care of by 
> the current Fortran <-> C infrastructure.

This doesn't seem to have been fixed, and I think it's going to bite
here.  Is this the right change?

--- openmpi-1.6.5/ompi/config/ompi_setup_mpi_fortran.m4~        2012-04-03 
15:30:24.000000000 +0100
+++ openmpi-1.6.5/ompi/config/ompi_setup_mpi_fortran.m4 2013-12-10 
12:23:54.232854527 +0000
@@ -127,8 +127,8 @@
         AC_MSG_RESULT([skipped (no Fortran bindings)])
     else
         bytes=`expr 4 \* $ac_cv_sizeof_int + $ac_cv_sizeof_size_t`
-        num_integers=`expr $bytes / $OMPI_SIZEOF_FORTRAN_INTEGER`
-        sanity=`expr $num_integers \* $OMPI_SIZEOF_FORTRAN_INTEGER`
+        num_integers=`expr $bytes / $ac_cv_sizeof_int`
+        sanity=`expr $num_integers \* $ac_cv_sizeof_int`
         AS_IF([test "$sanity" != "$bytes"],
               [AC_MSG_RESULT([unknown!])
                AC_MSG_WARN([WARNING: Size of C int: $ac_cv_sizeof_int])


Reply via email to