[OMPI users] MPI_Win_create with size=0 expose memory anyway

2011-02-11 Thread Patrick Le Dot
Hi all,
I am testing the one-sided message passing (MPI_Put, MPI_Get)
and it seems to me that the size parameter of MPI_Win_create()
is definitly not taken into account.

Then I can put/get messages using a window created with size=0
(or put/get after any others limits between 0 and the original buffer size).

I know that size=0 is not an usual practice but the man page say :
"A process may elect to expose no memory by specifying size = 0."

I might still have misunderstood something ?

Hereafter a simple test to reproduce the  with Open MPI 1.5

Thx,
Patrick


/*
 * compilation :
 * mpicc -o a.out a.c
 *
 * execution :
 * srun --resv-ports -n2 -N2 a.out
 *
 */

#include "mpi.h"

#define SIZE_10 10
#define RANK_1   1

int main(int argc, char *argv[]) {
  int i, rank, nprocs, A[SIZE_10], B[SIZE_10];
  MPI_Win win;
  int errs = 0;

  MPI_Init(&argc, &argv);
  MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
  MPI_Comm_rank(MPI_COMM_WORLD, &rank);

  if (nprocs != 2) {
printf("%d is a bad process number : srun -n2 -N2 a.out \n", nprocs);
MPI_Finalize();
return -1;
  }

  for (i=0; i

Re: [OMPI users] MPI_COMPLEX16

2012-05-23 Thread Patrick Le Dot
David Singleton  anu.edu.au> writes:

> 
> 
> I should have checked earlier - same for MPI_COMPLEX and MPI_COMPLEX8.
> 
> David
> 
> On 04/27/2012 08:43 AM, David Singleton wrote:
> >
> > Apologies if this has already been covered somewhere. One of our users
> > has noticed that MPI_COMPLEX16 is flagged as an invalid type in 1.5.4
> > but not in 1.4.3 while MPI_DOUBLE_COMPLEX is accepted for both. This is
> > with either gfortran or intel-fc.
> > ...

Hi,

I hit the same problem : MPI_COMPLEX8 and MPI_COMPLEX16 were available
in v1.4 but were removes in v1.5 and I don't understand why, except that
this types are not into the standard...

I have a patch to reintroduce them again so let me know what you think.

Thanks,
Patrick




Re: [OMPI users] MPI_COMPLEX16

2012-05-25 Thread Patrick Le Dot
Jeff Squyres  cisco.com> writes:

> 
> Sorry for taking so long to respond to this.  
> 
> Patrick -- I just created https://svn.open-mpi.org/trac/ompi/ticket/3109 to
track this issue.  Could
> you attach your patch to that ticket?
> 

Attached to ticket 3109 :

Patch for openmpi-1.6.0
Fix missing MPI_COMPLEX8 and MPI_COMPLEX16 types.
Add also MPI_COMPLEX32 even this last one still turned off by configure.

Note for David : if you want to backport the fix on openmpi-1.5.*
ompi/op/op.c should be updated too.

Patrick

-- 

$ hg diff

diff -r 922a81be964b ompi/datatype/ompi_datatype_module.c
--- a/ompi/datatype/ompi_datatype_module.c  Thu May 10 14:03:17 2012 +
+++ b/ompi/datatype/ompi_datatype_module.c  Fri May 25 08:45:26 2012 +0200
@@ -467,6 +467,21 @@
 DECLARE_MPI2_COMPOSED_STRUCT_DDT( &ompi_mpi_cplex.dt,
OMPI_DATATYPE_COMPLEX, "MPI_COMPLEX",
   float, float, OMPI_DATATYPE_MPI_FLOAT,
OMPI_DATATYPE_MPI_FLOAT,
   OMPI_DATATYPE_FLAG_DATA_FORTRAN |
OMPI_DATATYPE_FLAG_DATA_FLOAT );
+#if OMPI_HAVE_FORTRAN_COMPLEX8
+DECLARE_MPI2_COMPOSED_STRUCT_DDT( &ompi_mpi_complex8.dt,
OMPI_DATATYPE_COMPLEX8, "MPI_COMPLEX8",
+  float, float, OMPI_DATATYPE_MPI_FLOAT,
OMPI_DATATYPE_MPI_FLOAT,
+  OMPI_DATATYPE_FLAG_DATA_FORTRAN |
OMPI_DATATYPE_FLAG_DATA_FLOAT );
+#endif  /* OMPI_HAVE_FORTRAN_COMPLEX8 */
+#if OMPI_HAVE_FORTRAN_COMPLEX16
+DECLARE_MPI2_COMPOSED_STRUCT_DDT( &ompi_mpi_complex16.dt,
OMPI_DATATYPE_COMPLEX16, "MPI_COMPLEX16",
+  double, double, OMPI_DATATYPE_MPI_DOUBLE,
OMPI_DATATYPE_MPI_DOUBLE,
+  OMPI_DATATYPE_FLAG_DATA_FORTRAN |
OMPI_DATATYPE_FLAG_DATA_FLOAT );
+#endif  /* OMPI_HAVE_FORTRAN_COMPLEX16 */
+#if OMPI_HAVE_FORTRAN_COMPLEX32
+DECLARE_MPI2_COMPOSED_STRUCT_DDT( &ompi_mpi_complex32.dt,
OMPI_DATATYPE_COMPLEX32, "MPI_COMPLEX32",
+  long double, long double,
OMPI_DATATYPE_MPI_LONG_DOUBLE, OMPI_DATATYPE_MPI_LONG_DOUBLE,
+  OMPI_DATATYPE_FLAG_DATA_FORTRAN |
OMPI_DATATYPE_FLAG_DATA_FLOAT );
+#endif  /* OMPI_HAVE_FORTRAN_COMPLEX32 */
 DECLARE_MPI2_COMPOSED_STRUCT_DDT( &ompi_mpi_dblcplex.dt,
OMPI_DATATYPE_DOUBLE_COMPLEX, "MPI_DOUBLE_COMPLEX",
   double, double, OMPI_DATATYPE_MPI_DOUBLE,
OMPI_DATATYPE_MPI_DOUBLE,
   OMPI_DATATYPE_FLAG_DATA_FORTRAN |
OMPI_DATATYPE_FLAG_DATA_FLOAT );