From cc8e29435d7b4c50f0ec6c861e7721b39c567ea0 Mon Sep 17 00:00:00 2001
From: Jan David Mol <mol@astron.nl>
Date: Fri, 28 Oct 2011 07:44:48 +0000
Subject: [PATCH] Task #2680: Fixed for MPI platforms

---
 RTCP/CNProc/test/tCN_Processing_alloc.cc | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/RTCP/CNProc/test/tCN_Processing_alloc.cc b/RTCP/CNProc/test/tCN_Processing_alloc.cc
index 2e635ad7ce1..e995b0eda74 100644
--- a/RTCP/CNProc/test/tCN_Processing_alloc.cc
+++ b/RTCP/CNProc/test/tCN_Processing_alloc.cc
@@ -28,6 +28,11 @@
 #include <Stream/NullStream.h>
 #include <cstdlib>
 
+#if defined HAVE_MPI
+#define MPICH_IGNORE_CXX_SEEK
+#include <mpi.h>
+#endif
+
 using namespace LOFAR;
 using namespace LOFAR::RTCP;
 
@@ -39,7 +44,13 @@ Stream *createIONstream(unsigned channel, const LocationInfo &locationInfo)
   return new NullStream();
 }
 
-int main() {
+int main(int argc, char **argv) {
+#if defined HAVE_MPI
+  MPI_Init(&argc, &argv);
+#else
+  argc = argc; argv = argv;    // Keep compiler happy ;-)
+#endif
+
   setenv("NR_PSETS", "64", 1);
   setenv("PSET_SIZE", "64", 1);
 
@@ -66,6 +77,10 @@ int main() {
 
   // postprocess
   delete proc;
+
+#if defined HAVE_MPI
+  MPI_Finalize();
+#endif
   
   return 0;
 }
-- 
GitLab