#include "MyMPI.hpp" #include "P2PComm.hpp" #include using namespace MF; using std::cout; using std::endl; int main(int argc, char* argv[]) { const MyMPI* mpi = MyMPI::instance(); const int master = 0; if (mpi->rank() == master) //master { Transceiver transceiver; const double toSend = 13.13; const int cnt = 1; const int tag = 0; for (int dest=1; destsize(); ++dest) { transceiver.send(&toSend, cnt, MPI::DOUBLE, dest, tag); } } else { double toRecv; const int cnt = 1; const int from = master; const int tag = 0; MPI::Status status; Transceiver<> transceiver; transceiver.recv(&toRecv, cnt, MPI::DOUBLE, from, tag, status); cout << toRecv << endl; } return 0; }