From eb8f6f73f90dc1a8ee4eb9ea0bdc3a5f44f259ef Mon Sep 17 00:00:00 2001
From: Simon Schwitanski <schwitanski@itc.rwth-aachen.de>
Date: Fri, 12 Apr 2024 10:42:39 +0200
Subject: [PATCH] Add TypeART output patch

---
 Dockerfile                   |  1 +
 patches/typeart-output.patch | 17 +++++++++++++++++
 2 files changed, 18 insertions(+)
 create mode 100644 patches/typeart-output.patch

diff --git a/Dockerfile b/Dockerfile
index 8486771..e143cb2 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -105,6 +105,7 @@ RUN wget https://hpc.rwth-aachen.de/must/files/MUST-v${MUST_VERSION}.tar.gz && \
 RUN cd MUST-v${MUST_VERSION} && \
     patch utility/mustrun2.sh < /patches/mustrun-env.patch && \
     patch externals/typeart/scripts/typeart-wrapper.in < /patches/typeart-fpic.patch && \
+    patch modules/MpiTypeArt/MpiTypeArt.cpp < /patches/typeart-output.patch && \
     cd build && \
     CC=clang CXX=clang++ MPICH_CC=clang MPICH_CXX=clang++ OMPI_CC=clang OMPI_CXX=clang \
       cmake .. -DCMAKE_INSTALL_PREFIX=/opt/must -DUSE_BACKWARD=ON -DENABLE_TESTS=ON -DENABLE_FORTRAN=ON -DLLVM_FILECHECK_PATH=$(which FileCheck) -DCMAKE_BUILD_TYPE=Release && \
diff --git a/patches/typeart-output.patch b/patches/typeart-output.patch
new file mode 100644
index 0000000..b2a40f2
--- /dev/null
+++ b/patches/typeart-output.patch
@@ -0,0 +1,17 @@
+--- modules/MpiTypeArt/MpiTypeArt.cpp
++++ modules/MpiTypeArt/MpiTypeArt.cpp
+@@ -377,9 +377,11 @@ GTI_ANALYSIS_RETURN MpiTypeArt::checkSendOrRecv(
+         } else {
+             const char* typeart_recorded_name = typeart_get_type_name(typeart_type_info);
+             std::stringstream stream;
+-            stream << "Incompatible buffer of type " << typeart_type_info << " ("
+-                   << typeart_recorded_name << ") - expected "
+-                   << must_type_info->getPredefinedName() << " instead";
++            stream << "Incompatible buffer of type " << typeart_type_info
++                   << " (" << typeart_recorded_name << ") - expected "
++                   << get_mpi_name_for(must_type_info)
++                   << " with base type " << myDatMod->getPredefinedName(baseType->getPredefinedInfo())
++                   << " instead";
+             createMessage(pId, lId, stream.str(), MUST_ERROR_TYPEMATCH_MISMATCH);
+         }
+
-- 
GitLab