#include #include int main(int argc, char* argv[]) { int rank, size; MPI_Status status; MPI_Request req; //inicializácia MPI MPI_Init(&argc, &argv); //zistenie poradového čísla procesu - rank MPI_Comm_rank(MPI_COMM_WORLD, &rank); //zistenie celkového počtu procesov - size MPI_Comm_size(MPI_COMM_WORLD, &size); int send_buf, recv_buf, sum=0, odosielatel, adresat; send_buf = rank; //výpočet rankov odosielateľa a adresáta odosielatel = (rank - 1 + size) % size; adresat = (rank + 1) % size; for(int i=0; i