Commit a214d500 authored by Pavan Balaji's avatar Pavan Balaji
Browse files

Revert "Fix for #1804 - Alignment issues in Fortran with MPI_Status"

This reverts commit 81ad170b

.
Signed-off-by: default avatarWilliam Gropp <wgropp@illinois.edu>
parent fc20de53
......@@ -5837,99 +5837,6 @@ if test "$enable_f77" = yes -a -z "$MPI_STATUS_SIZE" ; then
else
AC_MSG_ERROR([MPI_STATUS_SIZE was not defined!])
fi
# Because MPI_Status may contain C integers of different sizes
# and with different alignments, we determine the maximum element
# size and then tell Fortran to enforce maximal alignment.
# A more sophisticated test would determine the required alignment,
# rather than assuming alignment to maximum size
MPIR_COUNT_ALIGNMENT=0
if test $MPI_SIZEOF_COUNT -gt $pac_cv_f77_sizeof_integer ; then
# Alignment test looks at the low address bits, as long
# as the sizeof(MPI_Count) is 2^j.
# If we can't tell, pick a value that forces the Fortran
# wrappers to use a local copy.
case $MPI_SIZEOF_COUNT in
4) MPIR_COUNT_ALIGNMENT="0x3";;
8) MPIR_COUNT_ALIGNMENT="0x7";;
16) MPIR_COUNT_ALIGNMENT="0xF";;
*) MPIR_COUNT_ALIGNMENT=-1 ;;
esac
# Compare the size of MPI_Status to the sizes of the individual
# elements. If the sizeof(MPI_Status) > sum of the sizes, then
# determine if simple padding will work.
# FIXME: DETERMINED TO SEE IF THERE IS PROBLEM BUT NOT YET USED
AC_MSG_CHECKING([whether MPI_Status contains padding])
sum_of_status_element_sizes=`expr 6 \* $ac_cv_sizeof_int + $MPI_SIZEOF_COUNT`
if test $sum_of_status_element_sizes -lt $pac_cv_sizeof_mpi_status ; then
AC_MSG_RESULT([yes])
if test "$enable_fc" = "yes" ; then
# FIXME: We could compute the padding or delete the
# status definition from mpi_constants
AC_MSG_CHECKING([padding size before count field in MPI_Status])
rm -f pac_mpi_status.h
dnl quote with [] since otherwise m4 strips the array declaration out of this
dnl structure
[ cat > pac_mpi_status.h <<_EOF
typedef struct {
int MPI_SOURCE;
int MPI_TAG;
int MPI_ERROR;
$MPI_COUNT count;
int cancelled;
int abi_slush_fund[2];
$EXTRA_STATUS_DECL
} MPI_Status;
MPI_Status mya;
_EOF
]
AC_COMPUTE_INT(pac_cv_fc_pad1,[((char*)&mya.count-(((char*)&mya)+3*sizeof(int)))],[AC_INCLUDES_DEFAULT()
#include "pac_mpi_status.h"])
AC_MSG_RESULT($pac_cv_fc_pad1)
AC_MSG_CHECKING([padding at end of MPI_Status])
AC_COMPUTE_INT(pac_cv_fc_pad2,[((char*)(&mya + 1) - ((char *)(mya.abi_slush_fund+1) + sizeof(int)))],[AC_INCLUDES_DEFAULT()
#include "pac_mpi_status.h"])
AC_MSG_RESULT($pac_cv_fc_pad2)
rm -f pac_mpi_status.h
pac_cv_pad1found=no
pac_cv_pad2found=no
FC_STATUS_PAD1=""
FC_STATUS_PAD2=""
AC_SUBST(FC_STATUS_PAD1)
AC_SUBST(FC_STATUS_PAD2)
if test $pac_cv_fc_pad1 -gt 0 ; then
if test $pac_cv_fc_pad1 -eq $ac_cv_sizeof_int ; then
pac_cv_pad1found=yes
FC_STATUS_PAD1="INTEGER :: PAD1"
fi
else
# No padding needed here, so successfully determined
# padding
pac_cv_pad1found=yes
fi
if test $pac_cv_fc_pad2 -gt 0 ; then
if test $pac_cv_fc_pad2 -eq $ac_cv_sizeof_int ; then
pac_cv_pad2found=yes
FC_STATUS_PAD2="INTEGER :: PAD2"
fi
else
# No padding needed here, so successfully determined
# padding
pac_cv_pad2found=yes
fi
if test $pac_cv_pad1found = "no" -o \
$pac_cv_pad2found = "no" ; then
AC_MSG_ERROR([INTERNAL ERROR: definition of MPI_Status in C and Fortran 90 is incompatible due to padding in the C definition])
fi
fi
else
AC_MSG_RESULT([no])
fi
fi
# Define the alignment of count regardless of whether sizeof(MPI_Count)
# is bigger than a Fortran integer
AC_DEFINE_UNQUOTED([MPIR_COUNT_ALIGNMENT],[$MPIR_COUNT_ALIGNMENT],[Value that anded with an address will give 0 if the address is properly aligned for MPI_Count])
fi # enable_f77 and mpi_status_size not set
AC_SUBST([MPI_STATUS_SIZE])
MPIF_STATUS_SIZE=$MPI_STATUS_SIZE
......
......@@ -46,10 +46,6 @@ $do_fint = 0; # Set to 1 to support C and Fortran integers of a
# different size
$within_fint = 0; # This is set to 1 while generating code for the
# do_fint branch
$fixStatusAlignment = 1; # Set to 1 to generate code that
# handles different alignment rules between
# Fortran (INTEGER) and C (likely MPI_Count)
# Note set by feature value do_fixstatus .
%fintToHandle = ( 'int' => 1, 'MPI_Request' => 1, 'MPI_Group' => 1,
'MPI_Win' => 1, 'MPI_Info' => 1, 'MPI_Errhandler' => 1,
'MPI_File' => 1, 'MPI_Op' => 1, 'MPI_Message' => 1 );
......@@ -72,7 +68,6 @@ $do_logical = 1;
$do_weak = 1;
$do_subdecls = 1;
$do_bufptr = 1;
$do_fixstatus = 1;
$prototype_file = "../../include/mpi.h.in";
# Global hashes used for definitions and to record the locations of the
......@@ -112,8 +107,8 @@ $specialInitString = "\
# Process arguments
#
# Args
# -feature={logical,fint,subdecls,weak,bufptr,fixstatus},
# separated by :, value given by =on or =off, eg
# -feature={logical,fint,subdecls,weak,bufptr}, separated by :, value given
# by =on or =off, eg
# -feature=logical=on:fint=off
# The feature names mean:
# logical - Fortran logicals are converted to/from C
......@@ -122,11 +117,6 @@ $specialInitString = "\
# weak - Use weak symbols
# bufptr - Check for MPI_BOTTOM as a special address. This is
# not needed if a POINTER declaration is available.
# fixstatus - The alignment of a Fortran STATUS array may not always
# be what is required in C (particularly with MPI_Count in
# MPI_Status now). If set, generate code to handle this case.
# Systems without alignment restrictions can set this to off,
# which will remove some tests.
foreach $_ (@ARGV) {
if (/-noprototypes/) { $build_prototypes = 0; }
elsif (/-infile=(.*)/) {
......@@ -171,8 +161,6 @@ foreach $_ (@ARGV) {
print STDERR "Unrecognized argument $_\n";
}
}
# For now, make these equal.
$fixStatusAlignment = $do_fixstatus;
# Note that the code that looks up values strips blanks out of the type name
# No blanks should be used in the key.
......@@ -659,18 +647,18 @@ $fixStatusAlignment = $do_fixstatus;
'Testsome-2' => 'inout:handle_array:*v1:MPI_Request',
'Testsome-3' => 'out:fint2int',
'Testsome-4' => 'out:index_array:*v1:*v3',
'Testsome-5' => 'out:status_array:*v1:*v3:*v3>0',
'Testsome-5' => 'out:status_array:*v1:*v3:l3>0',
'Get_count' => '1', 'Get_count-1' => 'in:status',
'Request_get_status' => '2:3',
'Request_get_status-2' => 'out:logical',
'Request_get_status-3' => 'out:status',
'Status_set_cancelled' => '1:2',
'Status_set_cancelled-1' => 'inout:status',
'Status_set_cancelled-1' => 'in:status',
'Status_set_cancelled-2' => 'in:logical',
'Status_set_elements' => '1',
'Status_set_elements-1' => 'inout:status',
'Status_set_elements-1' => 'out:status',
'Status_set_elements_x' => '1',
'Status_set_elements_x-1' => 'inout:status',
'Status_set_elements_x-1' => 'out:status',
'Type_contiguous' => '2:3',
'Type_contiguous-2' => 'in:handle::MPI_Datatype',
'Type_contiguous-3' => 'out:handle::MPI_Datatype',
......@@ -1812,7 +1800,6 @@ sub bufptr_in_arg {
sub bufptr_ctof {
my $coutvar = $_[0];
my $outvar = $_[1];
my $count = $_[2];
}
# --------------------------------------------------------------------------
# MPI_IN_PLACE buffer pointers
......@@ -1832,7 +1819,6 @@ sub inplace_in_arg {
sub inplace_ctof {
my $coutvar = $_[0];
my $outvar = $_[1];
my $count = $_[2];
}
# --------------------------------------------------------------------------
# MPI_UNWEIGHTED pointers. Note that unweighted is only used to indicate
......@@ -1909,7 +1895,6 @@ sub unweighted_out_arg {
sub unweighted_out_ctof {
my $coutvar = $_[0];
my $outvar = $_[1];
my $count = $_[2];
if ($within_fint) {
# MPI_WEIGHTS_EMPTY should never be an output value from the MPI library
......@@ -1948,7 +1933,6 @@ sub logical_in_arg {
sub logical_out_ctof {
my $coutvar = $_[0];
my $outvar = $_[1];
my $count = $_[2];
if ($do_logical) {
print $OUTFD " if ($errparmlval == MPI_SUCCESS) *$outvar = MPIR_TO_FLOG($coutvar);\n";
}
......@@ -2012,7 +1996,6 @@ sub logical_array_in_arg {
sub logical_array_out_ctof {
my $coutvar = $_[0];
my $outvar = $_[1];
my $count = $_[2];
# Special case if MPI_Fint == int: we use the input variable
# for space.
my $ActSize = $Array_size;
......@@ -2057,7 +2040,6 @@ sub index_ftoc {
sub index_ctof {
my $coutvar = $_[0];
my $outvar = $_[1];
my $count = $_[2];
print $OUTFD " *$outvar = (MPI_Fint)$coutvar;\n";
print $OUTFD " if ($coutvar >= 0) *$outvar = *$outvar + 1;\n";
}
......@@ -2084,7 +2066,6 @@ sub index_array_out_ftoc {
sub index_array_ctof {
my $coutvar = $_[0];
my $outvar = $_[1];
my $count = $_[2];
my $ActSize = $Array_size;
# In the case where the input and out sizes are not the same,
# the output size is in the fourth argument.
......@@ -2157,7 +2138,6 @@ sub handle_inout_ftoc {
sub handle_out_ctof {
my $coutvar = $_[0];
my $outvar = $_[1];
my $count = $_[2];
if ($within_fint) {
print $OUTFD " if ($errparmlval==MPI_SUCCESS) *$outvar = (MPI_Fint)$coutvar;\n";
}
......@@ -2280,8 +2260,7 @@ sub handle_array_out_ftoc {
sub handle_array_inout_ctof {
my $coutvar = $_[0];
my $outvar = $_[1];
my $count = $_[2];
&handle_array_ctof( $coutvar, $outvar, $count );
&handle_array_ctof( $coutvar, $outvar );
}
# Make sure that there is no output processing (other than to free the
......@@ -2289,14 +2268,12 @@ sub handle_array_inout_ctof {
sub handle_array_in_ctof {
my $coutvar = $_[0];
my $outvar = $_[1];
my $count = $_[2];
#&handle_array_ctof( $coutvar, $outvar, $count );
#&handle_array_ctof( $coutvar, $outvar );
}
sub handle_array_ctof {
my $coutvar = $_[0];
my $outvar = $_[1];
my $count = $_[2];
if ($within_fint) {
my $basetype = $nativeType;
$basetype =~ s/MPI_//;
......@@ -2307,7 +2284,7 @@ sub handle_array_ctof {
$asize = "_csize";
}
print $OUTFD "\
/* handle_array_ctof( $coutvar, $outvar, $count ) */
/* handle_array_ctof( $coutvar, $outvar ) */
{int li;
for (li=0; li<$asize; li++) {
$outvar\[li\] = $convfunc( $coutvar\[li\] );
......@@ -2415,7 +2392,6 @@ sub addrint_in_arg {
sub attrint_ctof {
my $fvar = $_[0];
my $cvar = $_[1];
my $count = $_[2];
my $flagarg = 4; # get from option
# The strange cast is due to the following:
# The MPICH attribute code returns an int in the void *. In
......@@ -2472,7 +2448,6 @@ sub addraint_in_arg {
sub attraint_ctof {
my $fvar = $_[0];
my $cvar = $_[1];
my $count = $_[2];
my $flagarg = 4; # get from option
print $OUTFD "
if ((int)*ierr || !l$flagarg) {
......@@ -2510,7 +2485,6 @@ sub bufaddr_out_arg {
sub bufaddr_ctof {
my $fvar = $_[0];
my $cvar = $_[1];
my $count = $_[2];
}
# --------------------------------------------------------------------------
#
......@@ -2531,10 +2505,6 @@ sub status_out_fnulltoc {
if (v$count == MPI_F_STATUS_IGNORE) { l$count = MPI_STATUS_IGNORE; }
else { l$count->MPI_ERROR = (int)(v$count\[2\]); }\n";
}
elsif ($fixStatusAlignment) {
print $OUTFD "\
if (v$count == MPI_F_STATUS_IGNORE) { l$count = MPI_STATUS_IGNORE; }\n";
}
else {
print $OUTFD "\
if (v$count == MPI_F_STATUS_IGNORE) { v$count = (MPI_Fint*)MPI_STATUS_IGNORE; }\n";
......@@ -2546,26 +2516,11 @@ sub status_in_ftoc {
if ($within_fint) {
print $OUTFD " MPI_Status_f2c( v$count, l$count );\n";
}
elsif ($fixStatusAlignment) {
print $OUTFD "\
if ( l$count != MPI_STATUS_IGNORE &&
(((MPI_Aint)v$count) & MPIR_COUNT_ALIGNMENT) == 0 )
l$count = (MPI_Status *)(void*)v$count;
else {
MPI_Status_f2c( v$count, l$count );
}
";
}
}
sub status_inout_ftoc {
my $count = $_[0];
status_in_ftoc( $count );
}
sub status_out_ctof {
my $coutvar = $_[0];
my $outvar = $_[1];
my $count = $_[2];
if ($within_fint) {
my $testFlag = "";
if (defined($condition) && $condition ne "") {
......@@ -2574,58 +2529,24 @@ sub status_out_ctof {
print $OUTFD
" if ($testFlag$coutvar != MPI_STATUS_IGNORE && $errparmlval == MPI_SUCCESS) {
MPI_Status_c2f($coutvar,$outvar);
}\n";
}
elsif ($fixStatusAlignment) {
# only copy if Fortran is not properly aligned
print $OUTFD "\
if ($coutvar != MPI_STATUS_IGNORE && $errparmlval == MPI_SUCCESS && $outvar != (MPI_Fint*)$coutvar) {
MPI_Status_c2f($coutvar,$outvar);
}\n";
}\n"
}
}
sub status_in_decl {
my $count = $_[0];
if ($within_fint || $fixStatusAlignment) {
if ($within_fint) {
print $OUTFD " MPI_Status vtmp$count, *l$count = &vtmp$count;\n";
}
}
sub status_out_decl {
my $count = $_[0];
if ($within_fint || $fixStatusAlignment) {
print $OUTFD " MPI_Status vtmp$count, *l$count = &vtmp$count;\n";
}
}
sub status_inout_decl {
my $count = $_[0];
if ($within_fint || $fixStatusAlignment) {
if ($within_fint) {
print $OUTFD " MPI_Status vtmp$count, *l$count = &vtmp$count;\n";
}
}
sub status_out_ftoc {
my $count = $_[0];
if ($fixStatusAlignment) {
# The first (void *) cast helps suppress compiler warnings about
# casting to a pointer with greater alignment (and which the
# specific runtime check is used to ensure the alignments are
# ok).
# Horrible requirement: MPI Standard (see MPI-3, Section 3.2.5,
# page 30, lines 39-43) implies that the MPI_ERROR field needs
# to be *preserved*. Thus, if we have a temp status, we need to
# either copy it to the temp status (as here) or *not* copy over
# it when storing the result. This is simpler.
print $OUTFD "\
if (l$count != MPI_STATUS_IGNORE) {
if ((((MPI_Aint)v$count) & MPIR_COUNT_ALIGNMENT) == 0)
l$count = (MPI_Status*)(void *)v$count;
else
l$count->MPI_ERROR = ((MPI_Status*)(void*)v$count)->MPI_ERROR;
}\n";
}
}
sub status_out_arg {
my $count = $_[0];
if ($within_fint|| $fixStatusAlignment) {
if ($within_fint) {
print $OUTFD "l$count";
}
else {
......@@ -2634,16 +2555,7 @@ sub status_out_arg {
}
sub status_in_arg {
my $count = $_[0];
if ($within_fint || $fixStatusAlignment) {
print $OUTFD "l$count";
}
else {
print $OUTFD "(MPI_Status *)(v$count)";
}
}
sub status_inout_arg {
my $count = $_[0];
if ($within_fint || $fixStatusAlignment) {
if ($within_fint) {
print $OUTFD "l$count";
}
else {
......@@ -2693,7 +2605,6 @@ sub errcodesignore_out_ftoc {
sub errcodesignore_out_ctof {
my $coutvar = $_[0];
my $outvar = $_[1];
my $count = $_[2];
if ($within_fint) {
$asize = $Array_size;
......@@ -2737,7 +2648,7 @@ sub status_array_out_fnulltoc {
&specialInitStatement( $OUTFD );
my $varname = "v";
my $varcast = "(MPI_Fint *)";
if ($within_fint || $fixStatusAlignment) { $varname = "l"; $varcast = ""; }
if ($within_fint) { $varname = "l"; $varcast = ""; }
print $OUTFD "\
if (v$count == MPI_F_STATUSES_IGNORE) { $varname$count = ${varcast}MPI_STATUSES_IGNORE; }\n";
}
......@@ -2755,26 +2666,11 @@ sub status_array_out_ftoc {
l$count\[li].MPI_ERROR = ((MPI_Status*)(void*)v$count)[li].MPI_ERROR;
}\n";
}
elsif ($fixStatusAlignment) {
print $OUTFD "\
if (l$count != MPI_STATUSES_IGNORE) {
if( (((MPI_Aint)v$count) & MPIR_COUNT_ALIGNMENT) == 0)
l$count = (MPI_Status*)(void *)v$count;
else {
int li;
lalloc$count = 1;
l$count = (MPI_Status*)$malloc($Array_size * sizeof(MPI_Status));
for (li=0; li<$Array_size; li++)
l$count\[li].MPI_ERROR = ((MPI_Status*)(void*)v$count)[li].MPI_ERROR;
}
}\n";
}
}
sub status_array_ctof {
my $coutvar = $_[0];
my $outvar = $_[1];
my $count = $_[2];
if ($within_fint) {
my $ActSize = $Array_size;
......@@ -2794,38 +2690,17 @@ sub status_array_ctof {
}\n";
$clean_up .= " if ($coutvar != MPI_STATUSES_IGNORE) { $free($coutvar); }\n";
}
elsif ($fixStatusAlignment) {
my $ActSize = $Array_size;
if (defined($nativeType) && $nativeType ne "") {
$ActSize = $nativeType;
}
my $testFlag = "";
if (defined($condition) && $condition ne "") {
$testFlag = "$condition && "
}
print $OUTFD
" if (${testFlag}lalloc$count) {
int li;
for (li=0; li<$ActSize; li++) {
MPI_Status_c2f($coutvar+li,$outvar+li*MPIF_STATUS_SIZE);
}
}\n";
$clean_up .= " if (lalloc$count) { $free($coutvar); }\n";
}
}
sub status_array_out_decl {
my $count = $_[0];
if ($within_fint) {
print $OUTFD " MPI_Status *l$count=0;\n";
}
elsif ($fixStatusAlignment) {
print $OUTFD " MPI_Status *l$count=0;\n int lalloc$count=0;\n";
}
}
sub status_array_out_arg {
my $count = $_[0];
if ($within_fint || $fixStatusAlignment) {
if ($within_fint) {
print $OUTFD "l$count";
}
else {
......@@ -2837,7 +2712,6 @@ sub status_array_out_arg {
sub aintToInt_ctof {
my $coutvar = $_[0];
my $outvar = $_[1];
my $count = $_[2];
print $OUTFD " if ($errparmlval == MPI_SUCCESS) *$outvar = (MPI_Fint)($coutvar);\n";
}
sub aintToInt_out_decl {
......@@ -2875,7 +2749,6 @@ sub fint2int_ftoc {
sub fint2int_ctof {
my $coutvar = $_[0];
my $outvar = $_[1];
my $count = $_[2];
if ($within_fint) {
print $OUTFD " if ($errparmlval == MPI_SUCCESS) *$outvar = (MPI_Fint)$coutvar;\n";
}
......@@ -2991,7 +2864,6 @@ sub fint2int_array_out_ftoc {
sub fint2int_array_out_ctof {
my $coutvar = $_[0];
my $outvar = $_[1];
my $count = $_[2];
if ($within_fint) {
my $asize = $Array_size;
if ($Array_size =~ /_commsize/) {
......@@ -3225,16 +3097,16 @@ sub print_post_call {
$processing_routine = "${method}_${direction}_ctof";
# Prefer a specific choice matching the direction
if (defined(&$processing_routine)) {
&$processing_routine( "l$count", "v$count", $count );
&$processing_routine( "l$count", "v$count" );
}
elsif ($direction eq "inout" &&
defined(&$processing_out_routine)) {
&$processing_out_routine( "l$count", "v$count", $count );
&$processing_out_routine( "l$count", "v$count" );
}
else {
$processing_routine = "${method}_ctof";
if (defined(&$processing_routine)) {
&$processing_routine( "l$count", "v$count", $count );
&$processing_routine( "l$count", "v$count" );
}
elsif ($direction ne "in") {
print STDERR "Missing $processing_routine for $routine_name\n";
......@@ -3282,7 +3154,6 @@ sub blankpad_out_ftoc {
sub blankpad_ctof {
my $coutvar = $_[0];
my $outvar = $_[1];
my $count = $_[2];
# find the null character. Replace with blanks from there to the
# end of the string. The declared lenght is given by a variable
......@@ -3325,7 +3196,6 @@ sub blankpadonflag_out_ftoc {
sub blankpadonflag_ctof {
my $coutvar = $_[0];
my $outvar = $_[1];
my $count = $_[2];
# find the null character. Replace with blanks from there to the
# end of the string. The declared lenght is given by a variable
......@@ -3649,7 +3519,6 @@ sub intToAintArr_in_arg {
sub intToAintArr_in_ctof {
my $lname = $_[0];
my $vname = $_[1];
my $count = $_[2];
print $OUTFD "
#ifdef HAVE_AINT_LARGER_THAN_FINT
if ($lname) { $free($lname); }
......@@ -3695,7 +3564,6 @@ sub FileToFint_out_decl {
sub FileToFint_ctof {
my $lvar = $_[0];
my $gvar = $_[1];
my $count = $_[2];
print $OUTFD " *$gvar = MPI_File_c2f($lvar);\n";
}
sub FileToFint_out_arg {
......@@ -4710,7 +4578,6 @@ print $OUTFD "\
return MPIR_Err_return_comm( 0, \"MPI_Status_f2c\", mpi_errno );
}\n";
if ($do_fint) {
#FIXME: Invalid alignment assumptions on MPI_Count field.
print $OUTFD "\
#ifdef HAVE_FINT_IS_INT
*c_status = *(MPI_Status *) f_status;
......@@ -4749,11 +4616,7 @@ print $OUTFD "\
#include \"mpi_fortimpl.h\"
/* mpierrs.h and mpierror.h for the error code creation */
#include \"mpierrs.h\"
#include <stdio.h>\n";
if ($fixStatusAlignment) {
print $OUTFD "#include <string.h>\n";
}
print $OUTFD "\
#include <stdio.h>
#include \"mpierror.h\"
/* -- Begin Profiling Symbol Block for routine MPI_Status_c2f */
......@@ -4789,8 +4652,6 @@ int MPI_Status_c2f( const MPI_Status *c_status, MPI_Fint *f_status )
return MPIR_Err_return_comm( 0, \"MPI_Status_c2f\", mpi_errno );
}\n";
if ($do_fint) {
#FIXME: Copy to f_status of MPI_Count data makes invalid alignment
# data.
print $OUTFD "\
#ifdef HAVE_FINT_IS_INT
*(MPI_Status *)f_status = *c_status;
......@@ -4803,24 +4664,14 @@ int MPI_Status_c2f( const MPI_Status *c_status, MPI_Fint *f_status )
#endif\n";
}
else {
if ($fixStatusAlignment) {
# Within this routine, MPI_STATUS_IGNORE is invalid
print $OUTFD "\
if ( (((MPI_Aint)f_status) & MPIR_COUNT_ALIGNMENT) == 0 )
*(MPI_Status*)(void *)f_status = *c_status;
else
memcpy(f_status,c_status,sizeof(MPI_Status));
\n";
}
else {
print $OUTFD " *(MPI_Status *)f_status = *c_status;\n";
}
print $OUTFD " *(MPI_Status *)f_status = *c_status;\n";
}
print $OUTFD "
return MPI_SUCCESS;
}\n";
close ($OUTFD);
&ReplaceIfDifferent( $filename, $filename . ".new" );
}
sub print_mpif_int {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment