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

Site Contact