From 992e8db3f28cf1b5981ff2f929351f7150a9d992 Mon Sep 17 00:00:00 2001 From: Augustin Degomme Date: Mon, 18 Nov 2019 11:39:57 +0100 Subject: [PATCH] fix fortran + ARM 64 bits. 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 | 2 +- src/smpi/bindings/smpi_f77.cpp | 23 +++++++++++------------ 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/include/smpi/smpi.h b/include/smpi/smpi.h index 2dc0d0be3c..cae3e1f240 100644 --- a/include/smpi/smpi.h +++ b/include/smpi/smpi.h @@ -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 diff --git a/src/smpi/bindings/smpi_f77.cpp b/src/smpi/bindings/smpi_f77.cpp index 9e96429ed9..ad939dad67 100644 --- a/src/smpi/bindings/smpi_f77.cpp +++ b/src/smpi/bindings/smpi_f77.cpp @@ -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 -- 2.20.1