diff --git a/src/OpenFOAM/parallel/globalIndex/globalIndex.H b/src/OpenFOAM/parallel/globalIndex/globalIndex.H
index 707dd1d3f50ab0a2106e179ad65e29f6ea5114f3..a14f1942fbf50c8a7ae971c0baba8d7c9cce10dc 100644
--- a/src/OpenFOAM/parallel/globalIndex/globalIndex.H
+++ b/src/OpenFOAM/parallel/globalIndex/globalIndex.H
@@ -489,12 +489,12 @@ public:
 
         //- Collect indirect data in processor order on master
         //  Handles contiguous/non-contiguous data, skips empty fields.
-        template<class Type, class Addr>
+        template<class ProcIDsContainer, class Type, class Addr>
         static void gather
         (
             const labelUList& offsets,  //!< offsets (master only)
             const label comm,           //!< communicator
-            const UList<int>& procIDs,
+            const ProcIDsContainer& procIDs,
             const IndirectListBase<Type, Addr>& fld,
             List<Type>& allFld,         //! output field (master only)
             const int tag = UPstream::msgType(),
diff --git a/src/OpenFOAM/parallel/globalIndex/globalIndexTemplates.C b/src/OpenFOAM/parallel/globalIndex/globalIndexTemplates.C
index f1b60ac033588080547c13c2d10cca8abf3de9c8..c069603602441faf26610590b92a7e6a08009a29 100644
--- a/src/OpenFOAM/parallel/globalIndex/globalIndexTemplates.C
+++ b/src/OpenFOAM/parallel/globalIndex/globalIndexTemplates.C
@@ -6,7 +6,7 @@
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
     Copyright (C) 2013-2017 OpenFOAM Foundation
-    Copyright (C) 2019-2022 OpenCFD Ltd.
+    Copyright (C) 2019-2023 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -248,12 +248,12 @@ void Foam::globalIndex::gather
 }
 
 
-template<class Type, class Addr>
+template<class ProcIDsContainer, class Type, class Addr>
 void Foam::globalIndex::gather
 (
     const labelUList& off,  // needed on master only
     const label comm,
-    const UList<int>& procIDs,
+    const ProcIDsContainer& procIDs,
     const IndirectListBase<Type, Addr>& fld,
     List<Type>& allFld,
     const int tag,
@@ -368,7 +368,7 @@ void Foam::globalIndex::gather
         (
             offsets_,  // needed on master only
             comm,
-            UPstream::procID(comm),
+            UPstream::allProcs(comm),   // All communicator ranks
             sendData,
             allData,
             tag,
@@ -404,7 +404,7 @@ void Foam::globalIndex::gather
         (
             offsets_,  // needed on master only
             comm,
-            UPstream::procID(comm),
+            UPstream::allProcs(comm),   // All communicator ranks
             sendData,
             allData,
             tag,
@@ -622,7 +622,7 @@ void Foam::globalIndex::mpiGather
             (
                 offsets_,  // needed on master only
                 comm,
-                UPstream::procID(comm),
+                UPstream::allProcs(comm),   // All communicator ranks
                 sendData,
                 allData,
                 tag,
@@ -967,7 +967,7 @@ void Foam::globalIndex::scatter
         (
             offsets_,  // needed on master only
             comm,
-            UPstream::procID(comm),
+            UPstream::allProcs(comm),  // All communicator ranks
             allData,
             localData,
             tag,
diff --git a/src/parallel/distributed/distributedTriSurfaceMesh/distributedTriSurfaceMesh.C b/src/parallel/distributed/distributedTriSurfaceMesh/distributedTriSurfaceMesh.C
index 5d53b49ead59c8506fd2704c20982c4911f17321..1448ea964468917b237ab42fac4dff6547dd90ce 100644
--- a/src/parallel/distributed/distributedTriSurfaceMesh/distributedTriSurfaceMesh.C
+++ b/src/parallel/distributed/distributedTriSurfaceMesh/distributedTriSurfaceMesh.C
@@ -1949,7 +1949,7 @@ Foam::distributedTriSurfaceMesh::independentlyDistributedBbs
 //        //globalBorderTris.gather
 //        //(
 //        //    UPstream::worldComm,
-//        //    UPstream::procID(Pstream::worldComm),
+//        //    UPstream::allProcs(UPstream::worldComm),
 //        //    globalBorderCentres
 //        //);
 //        pointField globalBorderCentres(allCentres);
@@ -1996,7 +1996,7 @@ Foam::distributedTriSurfaceMesh::independentlyDistributedBbs
 //        //globalBorderTris.scatter
 //        //(
 //        //    UPstream::worldComm,
-//        //    UPstream::procID(Pstream::worldComm),
+//        //    UPstream::allProcs(UPstream::worldComm),
 //        //    isMasterPoint
 //        //);
 //        //boolList isMasterBorder(s.size(), false);
@@ -2094,7 +2094,7 @@ Foam::distributedTriSurfaceMesh::independentlyDistributedBbs
             globalTris().gather
             (
                 UPstream::worldComm,
-                UPstream::procID(Pstream::worldComm),
+                UPstream::allProcs(UPstream::worldComm),
                 allCentres
             );
         }
@@ -2144,7 +2144,7 @@ Foam::distributedTriSurfaceMesh::independentlyDistributedBbs
             globalTris().scatter
             (
                 UPstream::worldComm,
-                UPstream::procID(Pstream::worldComm),
+                UPstream::allProcs(UPstream::worldComm),
                 allDistribution,
                 distribution
             );