#include "mpi_test_incl.h" using namespace std; class Master : public MasterBase { public: Master(int slaves, int iters, FILE* fpLog) : MasterBase(slaves, iters, fpLog) { mRcvRequests.resize(mSlaves); } void Rcv_WaitAny(); protected: vector mRcvRequests; virtual void updateOnFail(); }; void Master::updateOnFail() { vector::iterator it = mIsSlaveLives.begin(); for(int slaveIdx=0; it!= mIsSlaveLives.end(); ++it, ++slaveIdx) { if(!*it) mRcvRequests[slaveIdx] = MPI_REQUEST_NULL; } } void Master::Rcv_WaitAny() { MPI_Request send_request, recv_request; MPI_Status status; int retErr = MPI_SUCCESS, testErr = MPI_SUCCESS; int testSndNum; int slaveRank; int slaveIdx; int flag; for(slaveIdx=0; slaveIdx