Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
move some content to the SynchroRaw dtor
[simgrid.git] / src / smpi / smpi_f77.cpp
index 93dfe83..09cb210 100644 (file)
@@ -6,7 +6,7 @@
 
 #include <limits.h>
 #include <stdio.h>
-
+#include "smpi_mpi_dt_private.h"
 #include "private.h"
 #include "xbt.h"
 
@@ -66,43 +66,44 @@ static void smpi_init_fortran_types(){
      datatype_lookup = xbt_dict_new_homogeneous(NULL);
      win_lookup = xbt_dict_new_homogeneous(NULL);
      info_lookup = xbt_dict_new_homogeneous(NULL);
-     smpi_type_c2f(MPI_BYTE);
-     smpi_type_c2f(MPI_CHAR);
+     smpi_type_c2f(MPI_BYTE);//MPI_BYTE
+     smpi_type_c2f(MPI_CHAR);//MPI_CHARACTER
      #if defined(__alpha__) || defined(__sparc64__) || defined(__x86_64__) || defined(__ia64__)
-     smpi_type_c2f(MPI_INT);
-     smpi_type_c2f(MPI_INT);
+     smpi_type_c2f(MPI_INT);//MPI_LOGICAL
+     smpi_type_c2f(MPI_INT);//MPI_INTEGER
      #else
-     smpi_type_c2f(MPI_LONG);
-     smpi_type_c2f(MPI_LONG);
+     smpi_type_c2f(MPI_LONG);//MPI_LOGICAL
+     smpi_type_c2f(MPI_LONG);//MPI_INTEGER
      #endif
-     smpi_type_c2f(MPI_INT8_T);
-     smpi_type_c2f(MPI_INT16_T);
-     smpi_type_c2f(MPI_INT32_T);
-     smpi_type_c2f(MPI_INT64_T);
-     smpi_type_c2f(MPI_FLOAT);
-     smpi_type_c2f(MPI_FLOAT);
-     smpi_type_c2f(MPI_DOUBLE);
-     smpi_type_c2f(MPI_DOUBLE);
-     smpi_type_c2f(MPI_C_FLOAT_COMPLEX);
-     smpi_type_c2f(MPI_C_DOUBLE_COMPLEX);
+     smpi_type_c2f(MPI_INT8_T);//MPI_INTEGER1
+     smpi_type_c2f(MPI_INT16_T);//MPI_INTEGER2
+     smpi_type_c2f(MPI_INT32_T);//MPI_INTEGER4
+     smpi_type_c2f(MPI_INT64_T);//MPI_INTEGER8
+     smpi_type_c2f(MPI_FLOAT);//MPI_REAL
+     smpi_type_c2f(MPI_FLOAT);//MPI_REAL4
+     smpi_type_c2f(MPI_DOUBLE);//MPI_REAL8
+     smpi_type_c2f(MPI_DOUBLE);//MPI_DOUBLE_PRECISION
+     smpi_type_c2f(MPI_C_FLOAT_COMPLEX);//MPI_COMPLEX
+     smpi_type_c2f(MPI_C_DOUBLE_COMPLEX);//MPI_DOUBLE_COMPLEX
      #if defined(__alpha__) || defined(__sparc64__) || defined(__x86_64__) || defined(__ia64__)
-     smpi_type_c2f(MPI_2INT);
+     smpi_type_c2f(MPI_2INT);//MPI_2INTEGER
      #else
-     smpi_type_c2f(MPI_2LONG);
+     smpi_type_c2f(MPI_2LONG);//MPI_2INTEGER
      #endif
-     smpi_type_c2f(MPI_UINT8_T);
-     smpi_type_c2f(MPI_UINT16_T);
-     smpi_type_c2f(MPI_UINT32_T);
-     smpi_type_c2f(MPI_UINT64_T);
-     smpi_type_c2f(MPI_2FLOAT);
-     smpi_type_c2f(MPI_2DOUBLE);
-     smpi_type_c2f(MPI_DOUBLE);
-     smpi_type_c2f(MPI_DOUBLE);
-     smpi_type_c2f(MPI_INT);
-     smpi_type_c2f(MPI_DATATYPE_NULL);
-     smpi_type_c2f(MPI_DATATYPE_NULL);
-     smpi_type_c2f(MPI_DATATYPE_NULL);
-     smpi_type_c2f(MPI_DATATYPE_NULL);
+     smpi_type_c2f(MPI_UINT8_T);//MPI_LOGICAL1
+     smpi_type_c2f(MPI_UINT16_T);//MPI_LOGICAL2
+     smpi_type_c2f(MPI_UINT32_T);//MPI_LOGICAL4
+     smpi_type_c2f(MPI_UINT64_T);//MPI_LOGICAL8
+     smpi_type_c2f(MPI_2FLOAT);//MPI_2REAL
+     smpi_type_c2f(MPI_2DOUBLE);//MPI_2DOUBLE_PRECISION
+     smpi_type_c2f(MPI_PTR);//MPI_AINT
+     smpi_type_c2f(MPI_UINT64_T);//MPI_OFFSET
+     smpi_type_c2f(MPI_UINT64_T);//MPI_COUNT
+     smpi_type_c2f(MPI_DATATYPE_NULL);//MPI_REAL16
+     smpi_type_c2f(MPI_DATATYPE_NULL);//MPI_COMPLEX8
+     smpi_type_c2f(MPI_DATATYPE_NULL);//MPI_COMPLEX16
+     smpi_type_c2f(MPI_DATATYPE_NULL);//MPI_COMPLEX32
+     smpi_type_c2f(MPI_DATATYPE_NULL);//MPI_PACKED
      op_lookup = xbt_dict_new_homogeneous(NULL);
      smpi_op_c2f(MPI_MAX);
      smpi_op_c2f(MPI_MIN);
@@ -283,6 +284,7 @@ void mpi_finalize_(int* ierr) {
      xbt_dict_free(&group_lookup);
      xbt_dict_free(&comm_lookup);
      xbt_dict_free(&win_lookup);
+     xbt_dict_free(&info_lookup);
    }
 }
 
@@ -785,9 +787,15 @@ void mpi_info_get_ (int* info,char *key,int* valuelen, char *value, int *flag, i
  tkey[keylen]='\0';
  *ierr = MPI_Info_get(smpi_info_f2c(*info),tkey,*valuelen, value, flag);
  xbt_free(tkey);
- int i = 0;
- for (i=strlen(value); i<*valuelen; i++)
- value[i]=' ';
+ if(*flag==true){
+   int replace=0, i=0;
+   for (i=0; i<*valuelen; i++){
+     if(value[i]=='\0')
+       replace=1;
+     if(replace)
+       value[i]=' ';
+   }
+ } 
 }
 
 void mpi_info_free_(int* info, int* ierr){