From 2fb90def88ba2b35598a6b4d9cda8c30d1effdab Mon Sep 17 00:00:00 2001
From: Hal Finkel <hfinkel@anl.gov>
Date: Mon, 8 Jun 2020 10:04:57 -0500
Subject: [PATCH] Don't use int as a generic version of MPI_Comm; use
 conditional compilation instead

---
 GenericIO.cxx | 8 +++++---
 GenericIO.h   | 6 +++++-
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/GenericIO.cxx b/GenericIO.cxx
index 4ab1cb3..0899340 100644
--- a/GenericIO.cxx
+++ b/GenericIO.cxx
@@ -395,7 +395,11 @@ static int GetSZDT(GenericIO::Variable &Var) {
     return -1;
 }
 
-void GenericIO::setFH(int R) {
+void GenericIO::setFH(
+#ifndef GENERICIO_NO_MPI
+  MPI_Comm R
+#endif
+  ) {
 #ifndef GENERICIO_NO_MPI
   if (FileIOType == FileIOMPI)
     FH.get() = new GenericFileIO_MPI(R);
@@ -1051,8 +1055,6 @@ void GenericIO::openAndReadHeader(MismatchBehavior MB, int EffRank, bool CheckPa
     setFH(
 #ifndef GENERICIO_NO_MPI
       MPI_COMM_SELF
-#else
-      0
 #endif
     );
 
diff --git a/GenericIO.h b/GenericIO.h
index f4f471b..2e893a3 100644
--- a/GenericIO.h
+++ b/GenericIO.h
@@ -638,7 +638,11 @@ public:
     FHWCnt *CountedFH;
   } FH;
 
-  void setFH(int R);
+  void setFH(
+#ifndef GENERICIO_NO_MPI
+    MPI_Comm R
+#endif
+  );
 };
 
 } /* END namespace cosmotk */
-- 
GitLab