From 48c77d83a7e6de7b7c0cf2bd9ed457986c6c03b6 Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 28 Aug 2009 12:36:32 +0100 Subject: [PATCH] added check for outstanding requests --- src/Pstream/mpi/Pstream.C | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Pstream/mpi/Pstream.C b/src/Pstream/mpi/Pstream.C index 074ba1aa28..a535f4804e 100644 --- a/src/Pstream/mpi/Pstream.C +++ b/src/Pstream/mpi/Pstream.C @@ -131,6 +131,19 @@ void Foam::Pstream::exit(int errnum) delete[] buff; # endif + if (PstreamGlobals::outstandingRequests_.size()) + { + label n = PstreamGlobals::outstandingRequests_.size(); + PstreamGlobals::outstandingRequests_.clear(); + + WarningIn("Pstream::exit(int)") + << "There are still " << n << " outstanding MPI_Requests." << endl + << "This means that your code exited before doing a" + << " Pstream::waitRequests()." << endl + << "This should not happen for a normal code exit." + << endl; + } + if (errnum == 0) { MPI_Finalize();