From 506d0e96f4178919473df9c4d51aacf8e250f28f Mon Sep 17 00:00:00 2001
From: Jeff Squyres <jsquyres@cisco.com>
Date: Tue, 22 Oct 2013 14:55:17 +0000
Subject: [PATCH] Fix the IN_PLACE detection for Fortran SCATTER and SCATTERV.

Thanks to Charles Gerlach for identifying the issue.

Oddly, this issue exists in trunk and v1.7, but ''not'' in the v1.6
tree (!).

cmr=v1.7.4:reviewer=hjelmn

This commit was SVN r29463.
---
 ompi/mpi/fortran/mpif-h/scatter_f.c  | 4 ++--
 ompi/mpi/fortran/mpif-h/scatterv_f.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/ompi/mpi/fortran/mpif-h/scatter_f.c b/ompi/mpi/fortran/mpif-h/scatter_f.c
index dd8ed4eb56..a256b754bf 100644
--- a/ompi/mpi/fortran/mpif-h/scatter_f.c
+++ b/ompi/mpi/fortran/mpif-h/scatter_f.c
@@ -9,7 +9,7 @@
  *                         University of Stuttgart.  All rights reserved.
  * Copyright (c) 2004-2005 The Regents of the University of California.
  *                         All rights reserved.
- * Copyright (c) 2011-2012 Cisco Systems, Inc.  All rights reserved.
+ * Copyright (c) 2011-2013 Cisco Systems, Inc.  All rights reserved.
  * $COPYRIGHT$
  * 
  * Additional copyrights may follow
@@ -77,8 +77,8 @@ void ompi_scatter_f(char *sendbuf, MPI_Fint *sendcount,
     c_sendtype = MPI_Type_f2c(*sendtype);
     c_recvtype = MPI_Type_f2c(*recvtype);
 
-    sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf);
     sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf);
+    recvbuf = (char *) OMPI_F2C_IN_PLACE(recvbuf);
     recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf);
 
     c_ierr = MPI_Scatter(sendbuf,OMPI_FINT_2_INT(*sendcount),
diff --git a/ompi/mpi/fortran/mpif-h/scatterv_f.c b/ompi/mpi/fortran/mpif-h/scatterv_f.c
index 013a7f6ff7..28b0532f3f 100644
--- a/ompi/mpi/fortran/mpif-h/scatterv_f.c
+++ b/ompi/mpi/fortran/mpif-h/scatterv_f.c
@@ -9,7 +9,7 @@
  *                         University of Stuttgart.  All rights reserved.
  * Copyright (c) 2004-2005 The Regents of the University of California.
  *                         All rights reserved.
- * Copyright (c) 2011-2012 Cisco Systems, Inc.  All rights reserved.
+ * Copyright (c) 2011-2013 Cisco Systems, Inc.  All rights reserved.
  * $COPYRIGHT$
  * 
  * Additional copyrights may follow
@@ -85,8 +85,8 @@ void ompi_scatterv_f(char *sendbuf, MPI_Fint *sendcounts,
     OMPI_ARRAY_FINT_2_INT(sendcounts, size);
     OMPI_ARRAY_FINT_2_INT(displs, size);
 
-    sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf);
     sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf);
+    recvbuf = (char *) OMPI_F2C_IN_PLACE(recvbuf);
     recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf);
 
     c_ierr = MPI_Scatterv(sendbuf,