Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix fortran + ARM 64 bits.
authorAugustin Degomme <adegomme@users.noreply.github.com>
Mon, 18 Nov 2019 10:39:57 +0000 (11:39 +0100)
committerAugustin Degomme <adegomme@users.noreply.github.com>
Mon, 18 Nov 2019 10:53:47 +0000 (11:53 +0100)
I would like to get rid of these lists of architectures, and rely on cmake sizeof_voidp ... but this would mean relying on internal_config from smpi.h, and this is bad practice in simgrid :p Any idea ? Feel free to change it.
Anyway I changed the one in a cpp file that handles 99% of the cases, le .h is there for some ugly corner cases... This should not trigger too many errors in case of a new 64bits architecture popping.

include/smpi/smpi.h
src/smpi/bindings/smpi_f77.cpp

index 2dc0d0b..cae3e1f 100644 (file)
@@ -298,7 +298,7 @@ XBT_PUBLIC_DATA const MPI_Datatype MPI_INTEGER16;
 XBT_PUBLIC_DATA const MPI_Datatype MPI_COUNT;
 
 //defines for fortran compatibility
-#if defined(__alpha__) || defined(__sparc64__) || defined(__x86_64__) || defined(__ia64__)
+#if defined(__alpha__) || defined(__sparc64__) || defined(__x86_64__) || defined(__ia64__) || defined(__aarch64__)
 #define MPI_INTEGER MPI_INT
 #define MPI_2INTEGER MPI_2INT
 #define MPI_LOGICAL MPI_INT
index 9e96429..ad939da 100644 (file)
@@ -19,13 +19,13 @@ void smpi_init_fortran_types(){
      MPI_COMM_WORLD->add_f();
      MPI_BYTE->add_f();//MPI_BYTE
      MPI_CHAR->add_f();//MPI_CHARACTER
-#if defined(__alpha__) || defined(__sparc64__) || defined(__x86_64__) || defined(__ia64__)
-     MPI_C_BOOL->add_f();//MPI_LOGICAL
-     MPI_INT->add_f();//MPI_INTEGER
-#else
-     MPI_C_BOOL->add_f();//MPI_LOGICAL
-     MPI_LONG->add_f();//MPI_INTEGER
-#endif
+     if(sizeof(void*)==8) {
+       MPI_C_BOOL->add_f();//MPI_LOGICAL
+       MPI_INT->add_f();//MPI_INTEGER
+     } else {
+       MPI_C_BOOL->add_f();//MPI_LOGICAL
+       MPI_LONG->add_f();//MPI_INTEGER
+     }
      MPI_INT8_T->add_f();//MPI_INTEGER1
      MPI_INT16_T->add_f();//MPI_INTEGER2
      MPI_INT32_T->add_f();//MPI_INTEGER4
@@ -36,11 +36,10 @@ void smpi_init_fortran_types(){
      MPI_DOUBLE->add_f();//MPI_DOUBLE_PRECISION
      MPI_COMPLEX8->add_f();//MPI_COMPLEX
      MPI_COMPLEX16->add_f();//MPI_DOUBLE_COMPLEX
-#if defined(__alpha__) || defined(__sparc64__) || defined(__x86_64__) || defined(__ia64__)
-     MPI_2INT->add_f();//MPI_2INTEGER
-#else
-     MPI_2LONG->add_f();//MPI_2INTEGER
-#endif
+     if(sizeof(void*)==8)
+       MPI_2INT->add_f();//MPI_2INTEGER
+     else
+       MPI_2LONG->add_f();//MPI_2INTEGER
      MPI_UINT8_T->add_f();//MPI_LOGICAL1
      MPI_UINT16_T->add_f();//MPI_LOGICAL2
      MPI_UINT32_T->add_f();//MPI_LOGICAL4