#include "MyMPI.hpp" #include "P2PComm.hpp" #include using std::cout; using std::endl; using namespace MF; int main(int argc, char* argv[]) { const MyMPI* mpi = MyMPI::instance(); const int master = 0; if (mpi->rank() == master) //master { Exchange exchange(13,13); const int tag = 0; Transceiver<> transceiver; for (int dest=1; destsize(); ++dest) { transceiver.send(&exchange, sizeof(Exchange), MPI::BYTE, dest, tag); } } else { const int from = master; const int tag = 0; MPI::Status status; Transceiver<> transceiver; Exchange exchange(0,0); transceiver.recv(&exchange, sizeof(Exchange), MPI::BYTE, from, tag, status); cout << " Stack: " << exchange.getStack() << endl; cout << " Heap: " << exchange.getHeap() << endl; } return 0; }