Per
authorjsquyres
Wed Feb 20 21:57:48 2013 +0000 (3 months ago)
changeset 21422bb7eb4fa2809
parent 21421 c743601b3f9f
child 21423 942d973464e2
Per
http://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html,
the sizes of Java types are fixed. So we just assign them to their
corresponding MPI fixed-size datatypes where possible.
ompi/mpi/java/c/mpi_Datatype.c
     1.1 --- a/ompi/mpi/java/c/mpi_Datatype.c	Wed Feb 20 21:42:13 2013 +0000
     1.2 +++ b/ompi/mpi/java/c/mpi_Datatype.c	Wed Feb 20 21:57:48 2013 +0000
     1.3 @@ -55,14 +55,28 @@
     1.4   *
     1.5   *   ...
     1.6   * }
     1.7 + *
     1.8 + * Per
     1.9 + * http://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html,
    1.10 + * the sizes of Java types are fixed.  So we just assign them to their
    1.11 + * corresponding MPI fixed-size datatypes.
    1.12   */
    1.13  
    1.14 -
    1.15 -MPI_Datatype Dts[] = { MPI_DATATYPE_NULL, MPI_BYTE,  MPI_SHORT, 
    1.16 -                       MPI_SHORT,         MPI_BYTE,  MPI_INT, 
    1.17 -                       MPI_LONG_INT,      MPI_FLOAT, MPI_DOUBLE,
    1.18 -                       MPI_PACKED,        MPI_LB,    MPI_UB, 
    1.19 -                       MPI_BYTE };
    1.20 +MPI_Datatype Dts[] = { MPI_DATATYPE_NULL,  /* NULL */
    1.21 +                       MPI_UINT8_T,  /* BYTE */
    1.22 +                       MPI_UINT8_T,  /* CHAR */
    1.23 +                       MPI_INT16_T,  /* SHORT */
    1.24 +                       MPI_UINT8_T,  /* BOOLEAN (let's hope Java is
    1.25 +                                        one byte..) */
    1.26 +                       MPI_INT32_T,  /* INT */
    1.27 +                       MPI_INT64_T,  /* LONG */
    1.28 +                       MPI_FLOAT,    /* FLOAT (let's hope it's the same!) */
    1.29 +                       MPI_DOUBLE,   /* DOUBLE (let's hoe it's the same!) */
    1.30 +                       MPI_PACKED,   /* PACKED */
    1.31 +                       MPI_LB,       /* LB */
    1.32 +                       MPI_UB,       /* UB */
    1.33 +                       MPI_BYTE      /* JMS This one needs to go... */
    1.34 +};
    1.35  
    1.36  void ompi_java_init_native_Datatype(void)
    1.37  {