Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
add a few fortran bindings and types to have better support for mpich tests
authorAugustin Degomme <degomme@idpann.imag.fr>
Thu, 25 Oct 2012 15:54:31 +0000 (17:54 +0200)
committerAugustin Degomme <degomme@idpann.imag.fr>
Fri, 26 Oct 2012 08:09:29 +0000 (10:09 +0200)
include/smpi/mpif.h
include/smpi/smpi.h
src/smpi/private.h
src/smpi/smpi_f77.c
src/smpi/smpi_mpi_dt.c

index 5222b5c..6c71f11 100644 (file)
@@ -77,7 +77,7 @@
      >        MPI_INTEGER8, MPI_REAL, MPI_REAL4, MPI_REAL8,
      >        MPI_DOUBLE_PRECISION, MPI_COMPLEX, MPI_DOUBLE_COMPLEX,
      >        MPI_2INTEGER, MPI_LOGICAL1, MPI_LOGICAL2, MPI_LOGICAL4,
      >        MPI_INTEGER8, MPI_REAL, MPI_REAL4, MPI_REAL8,
      >        MPI_DOUBLE_PRECISION, MPI_COMPLEX, MPI_DOUBLE_COMPLEX,
      >        MPI_2INTEGER, MPI_LOGICAL1, MPI_LOGICAL2, MPI_LOGICAL4,
-     >        MPI_LOGICAL8
+     >        MPI_LOGICAL8, MPI_2REAL, MPI_2DOUBLE_PRECISION
       parameter(MPI_DATATYPE_NULL=-1)
       parameter(MPI_BYTE=0)
       parameter(MPI_CHARACTER=1)
       parameter(MPI_DATATYPE_NULL=-1)
       parameter(MPI_BYTE=0)
       parameter(MPI_CHARACTER=1)
@@ -98,6 +98,8 @@
       parameter(MPI_LOGICAL2=16)
       parameter(MPI_LOGICAL4=17)
       parameter(MPI_LOGICAL8=18)
       parameter(MPI_LOGICAL2=16)
       parameter(MPI_LOGICAL4=17)
       parameter(MPI_LOGICAL8=18)
+      parameter(MPI_2REAL=19)
+      parameter(MPI_2DOUBLE_PRECISION=19)
 
 ! These should be ordered as in smpi_f77.c
       integer MPI_OP_NULL,MPI_MAX, MPI_MIN, MPI_MAXLOC, MPI_MINLOC,
 
 ! These should be ordered as in smpi_f77.c
       integer MPI_OP_NULL,MPI_MAX, MPI_MIN, MPI_MAXLOC, MPI_MINLOC,
      >         MPI_ALLTOALL
 
       external MPI_WTIME
      >         MPI_ALLTOALL
 
       external MPI_WTIME
+      external MPI_WTICK
+
       double precision MPI_WTIME
       double precision MPI_WTIME
+      double precision MPI_WTICK
index d032ac3..7a2ea0d 100644 (file)
@@ -129,12 +129,14 @@ XBT_PUBLIC( MPI_Datatype ) MPI_OFFSET;
 XBT_PUBLIC( MPI_Datatype ) MPI_LB;
 XBT_PUBLIC( MPI_Datatype ) MPI_UB;
 //The following are datatypes for the MPI functions MPI_MAXLOC  and MPI_MINLOC.
 XBT_PUBLIC( MPI_Datatype ) MPI_LB;
 XBT_PUBLIC( MPI_Datatype ) MPI_UB;
 //The following are datatypes for the MPI functions MPI_MAXLOC  and MPI_MINLOC.
-XBT_PUBLIC( MPI_Datatype ) MPI_FLOAT_INT;
-XBT_PUBLIC( MPI_Datatype ) MPI_LONG_INT;
-XBT_PUBLIC( MPI_Datatype ) MPI_DOUBLE_INT;
-XBT_PUBLIC( MPI_Datatype ) MPI_SHORT_INT;
-XBT_PUBLIC( MPI_Datatype ) MPI_2INT;
-XBT_PUBLIC( MPI_Datatype ) MPI_LONG_DOUBLE_INT;
+extern MPI_Datatype MPI_FLOAT_INT;
+extern MPI_Datatype MPI_LONG_INT;
+extern MPI_Datatype MPI_DOUBLE_INT;
+extern MPI_Datatype MPI_SHORT_INT;
+extern MPI_Datatype MPI_2INT;
+extern MPI_Datatype MPI_LONG_DOUBLE_INT;
+XBT_PUBLIC(MPI_Datatype) MPI_2FLOAT;
+XBT_PUBLIC(MPI_Datatype) MPI_2DOUBLE;
 
 typedef void MPI_User_function(void *invec, void *inoutvec, int *len,
                                MPI_Datatype * datatype);
 
 typedef void MPI_User_function(void *invec, void *inoutvec, int *len,
                                MPI_Datatype * datatype);
index 770d816..fe03a57 100644 (file)
@@ -250,6 +250,7 @@ void mpi_abort__(int* comm, int* errorcode, int* ierr);
 void mpi_comm_rank__(int* comm, int* rank, int* ierr);
 void mpi_comm_size__(int* comm, int* size, int* ierr);
 double mpi_wtime__(void);
 void mpi_comm_rank__(int* comm, int* rank, int* ierr);
 void mpi_comm_size__(int* comm, int* size, int* ierr);
 double mpi_wtime__(void);
+double mpi_wtick__(void);
 
 void mpi_comm_dup__(int* comm, int* newcomm, int* ierr);
 void mpi_comm_split__(int* comm, int* color, int* key, int* comm_out, int* ierr);
 
 void mpi_comm_dup__(int* comm, int* newcomm, int* ierr);
 void mpi_comm_split__(int* comm, int* color, int* key, int* comm_out, int* ierr);
@@ -287,9 +288,20 @@ void mpi_gather__(void* sendbuf, int* sendcount, int* sendtype,
 void mpi_allgather__(void* sendbuf, int* sendcount, int* sendtype,
                      void* recvbuf, int* recvcount, int* recvtype,
                      int* comm, int* ierr);
 void mpi_allgather__(void* sendbuf, int* sendcount, int* sendtype,
                      void* recvbuf, int* recvcount, int* recvtype,
                      int* comm, int* ierr);
+void mpi_allgatherv__(void* sendbuf, int* sendcount, int* sendtype,
+                     void* recvbuf, int* recvcount,int* displs, int* recvtype,
+                     int* comm, int* ierr) ;
+void mpi_type_size__(int* datatype, int *size, int* ierr);
+
 void mpi_scan__(void* sendbuf, void* recvbuf, int* count, int* datatype,
                 int* op, int* comm, int* ierr);
 void mpi_alltoall__(void* sendbuf, int* sendcount, int* sendtype,
                     void* recvbuf, int* recvcount, int* recvtype, int* comm, int* ierr);
 void mpi_scan__(void* sendbuf, void* recvbuf, int* count, int* datatype,
                 int* op, int* comm, int* ierr);
 void mpi_alltoall__(void* sendbuf, int* sendcount, int* sendtype,
                     void* recvbuf, int* recvcount, int* recvtype, int* comm, int* ierr);
+void mpi_get_processor_name__(char *name, int *resultlen, int* ierr);
+void mpi_test__ (int * request, int *flag, MPI_Status * status, int* ierr);
+void mpi_get_count__(MPI_Status * status, int* datatype, int *count, int* ierr);
+void mpi_type_extent__(int* datatype, MPI_Aint * extent, int* ierr);
+void mpi_type_lb__(int* datatype, MPI_Aint * extent, int* ierr);
+void mpi_type_ub__(int* datatype, MPI_Aint * extent, int* ierr);
 
 #endif
 
 #endif
index c467cc8..ffe8916 100644 (file)
@@ -101,6 +101,9 @@ void mpi_init__(int* ierr) {
    new_datatype(MPI_UINT16_T);
    new_datatype(MPI_UINT32_T);
    new_datatype(MPI_UINT64_T);
    new_datatype(MPI_UINT16_T);
    new_datatype(MPI_UINT32_T);
    new_datatype(MPI_UINT64_T);
+   new_datatype(MPI_2FLOAT);
+   new_datatype(MPI_2DOUBLE);
+
 
    op_lookup = xbt_dynar_new(sizeof(MPI_Op), NULL);
    new_op(MPI_MAX);
 
    op_lookup = xbt_dynar_new(sizeof(MPI_Op), NULL);
    new_op(MPI_MAX);
@@ -148,6 +151,10 @@ double mpi_wtime__(void) {
    return MPI_Wtime();
 }
 
    return MPI_Wtime();
 }
 
+double mpi_wtick__(void) {
+  return MPI_Wtick();
+}
+
 void mpi_comm_dup__(int* comm, int* newcomm, int* ierr) {
   MPI_Comm tmp;
 
 void mpi_comm_dup__(int* comm, int* newcomm, int* ierr) {
   MPI_Comm tmp;
 
@@ -311,6 +318,13 @@ void mpi_allgather__(void* sendbuf, int* sendcount, int* sendtype,
                         recvbuf, *recvcount, get_datatype(*recvtype), get_comm(*comm));
 }
 
                         recvbuf, *recvcount, get_datatype(*recvtype), get_comm(*comm));
 }
 
+void mpi_allgatherv__(void* sendbuf, int* sendcount, int* sendtype,
+                     void* recvbuf, int* recvcount,int* displs, int* recvtype,
+                     int* comm, int* ierr) {
+  *ierr = MPI_Allgatherv(sendbuf, *sendcount, get_datatype(*sendtype),
+                        recvbuf, recvcount, displs, get_datatype(*recvtype), get_comm(*comm));
+}
+
 void mpi_scan__(void* sendbuf, void* recvbuf, int* count, int* datatype,
                 int* op, int* comm, int* ierr) {
   *ierr = MPI_Scan(sendbuf, recvbuf, *count, get_datatype(*datatype),
 void mpi_scan__(void* sendbuf, void* recvbuf, int* count, int* datatype,
                 int* op, int* comm, int* ierr) {
   *ierr = MPI_Scan(sendbuf, recvbuf, *count, get_datatype(*datatype),
@@ -322,3 +336,32 @@ void mpi_alltoall__(void* sendbuf, int* sendcount, int* sendtype,
   *ierr = MPI_Alltoall(sendbuf, *sendcount, get_datatype(*sendtype),
                        recvbuf, *recvcount, get_datatype(*recvtype), get_comm(*comm));
 }
   *ierr = MPI_Alltoall(sendbuf, *sendcount, get_datatype(*sendtype),
                        recvbuf, *recvcount, get_datatype(*recvtype), get_comm(*comm));
 }
+
+void mpi_test__ (int * request, int *flag, MPI_Status * status, int* ierr){
+  MPI_Request req = find_request(*request);
+  *ierr= MPI_Test(&req, flag, status);
+}
+void mpi_get_processor_name__(char *name, int *resultlen, int* ierr){
+  *ierr = MPI_Get_processor_name(name, resultlen);
+}
+
+void mpi_get_count__(MPI_Status * status, int* datatype, int *count, int* ierr){
+  *ierr = MPI_Get_count(status, get_datatype(*datatype), count);
+}
+
+void mpi_type_extent__(int* datatype, MPI_Aint * extent, int* ierr){
+  *ierr= MPI_Type_extent(get_datatype(*datatype),  extent);
+}
+
+void mpi_type_ub__(int* datatype, MPI_Aint * disp, int* ierr){
+  *ierr= MPI_Type_ub(get_datatype(*datatype), disp);
+}
+
+void mpi_type_lb__(int* datatype, MPI_Aint * extent, int* ierr){
+  *ierr= MPI_Type_extent(get_datatype(*datatype), extent);
+}
+
+void mpi_type_size__(int* datatype, int *size, int* ierr)
+{
+  *ierr = MPI_Type_size(get_datatype(*datatype), size);
+}
index efc7f6b..1477cec 100644 (file)
@@ -44,6 +44,14 @@ typedef struct {
   float value;
   int index;
 } float_int;
   float value;
   int index;
 } float_int;
+typedef struct {
+  float value;
+  float index;
+} float_float;
+typedef struct {
+  double value;
+  double index;
+} double_double;
 typedef struct {
   long value;
   int index;
 typedef struct {
   long value;
   int index;
@@ -101,6 +109,9 @@ CREATE_MPI_DATATYPE(MPI_LONG_INT, long_int);
 CREATE_MPI_DATATYPE(MPI_DOUBLE_INT, double_int);
 CREATE_MPI_DATATYPE(MPI_SHORT_INT, short_int);
 CREATE_MPI_DATATYPE(MPI_2INT, int_int);
 CREATE_MPI_DATATYPE(MPI_DOUBLE_INT, double_int);
 CREATE_MPI_DATATYPE(MPI_SHORT_INT, short_int);
 CREATE_MPI_DATATYPE(MPI_2INT, int_int);
+CREATE_MPI_DATATYPE(MPI_2FLOAT, float_float);
+CREATE_MPI_DATATYPE(MPI_2DOUBLE, double_double);
+
 CREATE_MPI_DATATYPE(MPI_LONG_DOUBLE_INT, long_double_int);
 
 CREATE_MPI_DATATYPE_NULL(MPI_UB);
 CREATE_MPI_DATATYPE(MPI_LONG_DOUBLE_INT, long_double_int);
 
 CREATE_MPI_DATATYPE_NULL(MPI_UB);
@@ -1148,6 +1159,10 @@ static void minloc_func(void *a, void *b, int *length,
     APPLY_FUNC(a, b, length, int_int, MINLOC_OP);
   } else if (*datatype == MPI_LONG_DOUBLE_INT) {
     APPLY_FUNC(a, b, length, long_double_int, MINLOC_OP);
     APPLY_FUNC(a, b, length, int_int, MINLOC_OP);
   } else if (*datatype == MPI_LONG_DOUBLE_INT) {
     APPLY_FUNC(a, b, length, long_double_int, MINLOC_OP);
+  } else if (*datatype == MPI_2FLOAT) {
+    APPLY_FUNC(a, b, length, float_float, MINLOC_OP);
+  } else if (*datatype == MPI_2DOUBLE) {
+    APPLY_FUNC(a, b, length, double_double, MINLOC_OP);
   }
 }
 
   }
 }
 
@@ -1166,6 +1181,10 @@ static void maxloc_func(void *a, void *b, int *length,
     APPLY_FUNC(a, b, length, int_int, MAXLOC_OP);
   } else if (*datatype == MPI_LONG_DOUBLE_INT) {
     APPLY_FUNC(a, b, length, long_double_int, MAXLOC_OP);
     APPLY_FUNC(a, b, length, int_int, MAXLOC_OP);
   } else if (*datatype == MPI_LONG_DOUBLE_INT) {
     APPLY_FUNC(a, b, length, long_double_int, MAXLOC_OP);
+  } else if (*datatype == MPI_2FLOAT) {
+    APPLY_FUNC(a, b, length, float_float, MAXLOC_OP);
+  } else if (*datatype == MPI_2DOUBLE) {
+    APPLY_FUNC(a, b, length, double_double, MAXLOC_OP);
   }
 }
 
   }
 }