Go to the documentation of this file.00001 #include "SundanceCollectiveExceptionCheck.hpp"
00002 #include "Teuchos_MPIComm.hpp"
00003
00004 using namespace Sundance;
00005 using namespace Teuchos;
00006
00007 namespace Sundance
00008 {
00009 void reportFailure(const MPIComm& comm)
00010 {
00011 int myBad = 1;
00012 int anyBad = 0;
00013 comm.allReduce((void*) &myBad, (void*) &anyBad, 1, MPIComm::INT,
00014 MPIComm::SUM);
00015 }
00016
00017 bool checkForFailures(const MPIComm& comm)
00018 {
00019 int myBad = 0;
00020 int anyBad = 0;
00021 comm.allReduce((void*) &myBad, (void*) &anyBad, 1, MPIComm::INT,
00022 MPIComm::SUM);
00023 return anyBad > 0;
00024 }
00025
00026
00027 }
00028
00029
00030
00031
00032
00033
00034
00035
00036