#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; const unsigned int count = 26 + 1; MPI::Datatype Alphabet = MPI::CHAR.Create_contiguous(count); Alphabet.Commit(); if (mpi->rank() == master) //master { char alphabet[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; const int tag = 0; Transceiver<> transceiver; for (int dest=1; destsize(); ++dest) { transceiver.send(&alphabet, 1, Alphabet, dest, tag); } } else { const int from = master; const int tag = 0; MPI::Status status; Transceiver<> transceiver; char toRecv[count]; transceiver.recv(&toRecv, 1, Alphabet, from, tag, status); cout << *mpi->instance() << " received: " << toRecv << endl; } Alphabet.Free(); return 0; }