petsc/petsc-use_int64_t_with_mpiuni.patch
2024-02-08 15:46:51 +01:00

48 lines
2.1 KiB
Diff

From ab86aa04d4d69fee965a3829143bef835b6ec081 Mon Sep 17 00:00:00 2001
From: Satish Balay <balay@mcs.anl.gov>
Date: Tue, 6 Feb 2024 15:17:17 -0600
Subject: [PATCH] petsc64: use int64_t with mpiuni [in sync with metis]
---
include/petsc/mpiuni/mpi.h | 1 +
include/petscsystypes.h | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/include/petsc/mpiuni/mpi.h b/include/petsc/mpiuni/mpi.h
index ea27c6628f4..d51a924e089 100644
--- a/include/petsc/mpiuni/mpi.h
+++ b/include/petsc/mpiuni/mpi.h
@@ -229,6 +229,7 @@ typedef int MPI_Datatype;
#define MPI_INT8_T (5 << 20 | 1 << 8 | (int)sizeof(int8_t))
#define MPI_INT16_T (5 << 20 | 1 << 8 | (int)sizeof(int16_t))
#define MPI_INT32_T (5 << 20 | 1 << 8 | (int)sizeof(int32_t))
+#define MPI_INT64_T (5 << 20 | 1 << 8 | (int)sizeof(int64_t))
#define MPI_UNSIGNED_SHORT (5 << 20 | 1 << 8 | (int)sizeof(unsigned short))
#define MPI_UNSIGNED (5 << 20 | 1 << 8 | (int)sizeof(unsigned))
diff --git a/include/petscsystypes.h b/include/petscsystypes.h
index 86f7dba1c33..6e4d549bbe6 100644
--- a/include/petscsystypes.h
+++ b/include/petscsystypes.h
@@ -253,7 +253,7 @@ M*/
#endif
#endif
-#if defined(PETSC_HAVE_STDINT_H) && defined(PETSC_HAVE_INTTYPES_H) && defined(PETSC_HAVE_MPI_INT64_T) /* MPI_INT64_T is not guaranteed to be a macro */
+#if defined(PETSC_HAVE_STDINT_H) && defined(PETSC_HAVE_INTTYPES_H) && (defined(PETSC_HAVE_MPIUNI) || defined(PETSC_HAVE_MPI_INT64_T)) /* MPI_INT64_T is not guaranteed to be a macro */
typedef int64_t PetscInt64;
#define PETSC_INT64_MIN INT64_MIN
@@ -300,7 +300,7 @@ enum {
#define PETSC_MAX_INT PETSC_INT_MAX
#define PETSC_MAX_UINT16 65535
-#if defined(PETSC_HAVE_STDINT_H) && defined(PETSC_HAVE_INTTYPES_H) && defined(PETSC_HAVE_MPI_INT64_T) /* MPI_INT64_T is not guaranteed to be a macro */
+#if defined(PETSC_HAVE_STDINT_H) && defined(PETSC_HAVE_INTTYPES_H) && (defined(PETSC_HAVE_MPIUNI) || defined(PETSC_HAVE_MPI_INT64_T)) /* MPI_INT64_T is not guaranteed to be a macro */
#define MPIU_INT64 MPI_INT64_T
#define PetscInt64_FMT PRId64
#elif (PETSC_SIZEOF_LONG_LONG == 8)
--
GitLab