İyi akşamlar arkadaşlar benim C ile MPI paralel programlama üzerine sizlerden yardım isteyecektim. Elimde mpi ile paralelleştirilmiş bir C kodu var. #include <stdio.h> #include "mpi.h" int main(int argc, char *argv[]) { int rank, size, next, prev, message, tag = 201; /* Start up MPI */ MPI_Init(&argc, &argv); MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Comm_size(MPI_COMM_WORLD, &size); next = (rank + 1) % size; prev = (rank + size - 1) % size; if (0 == rank) { message = 10; printf("Process 0 sending %d to %d, tag %d (%d processes in ring)\n", message, next, tag, size); MPI_Send(&message, 1, MPI_INT, next, tag, MPI_COMM_WORLD); printf("Process 0 sent to %d\n", next); } while (1) { MPI_Recv(&message, 1, MPI_INT, prev, tag, MPI_COMM_WORLD, MPI_STATUS_IGNORE); if (0 == rank) { --message; printf("Process 0 decremented value: %d\n", message); } MPI_Send(&message, 1, MPI_INT, next, tag, MPI_COMM_WORLD); if (0 == message) { printf("Process %d exiting\n", rank); break; } } if (0 == rank) { MPI_Recv(&message, 1, MPI_INT, prev, tag, MPI_COMM_WORLD, MPI_STATUS_IGNORE); } /* All done */ MPI_Finalize(); return 0; } Bu kod üzerine elimden geldiğince bir çalışma yaptım ve alttaki kodu hazırladım fakat hata veriyor. #include <stdio.h> #include "mpi.h" int main(int argc, char *argv[]) { int rank, size, next, prev, message, tag = 201; /* Start up MPI */ MPI_Init(&argc, &argv); MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Comm_size(MPI_COMM_WORLD, &size); MPI_Request myRequest[4]; MPI_Status myStatus[4]; next = (rank + 1) % size; prev = (rank + size - 1) % size; if (0 == rank) { message = 10; printf("Process 0 sending %d to %d, tag %d (%d processes in ring)\n", message, next, tag, size); MPI_Status myStatus; MPI_Isend(&message, 1, MPI_INT, next, tag, MPI_COMM_WORLD, &myRequest[0]); printf("Process 0 sent to %d\n", next); MPI_Wait(&myRequest[0], &myStatus[0]); MPI_Wait(&myRequest[1], &myStatus[1]); } while (1) { MPI_Irecv(&message, 1, MPI_INT, prev, tag, MPI_COMM_WORLD, MPI_STATUS_IGNORE, &myRequest[1]); MPI_Wait(&myRequest, &myStatus); if (0 == rank) { --message; printf("Process 0 decremented value: %d\n", message); } MPI_Isend(&message, 1, MPI_INT, next, tag, MPI_COMM_WORLD[2]); MPI_Wait(&myRequest[2], &myStatus[2]); MPI_Wait(&myRequest[3], &myStatus[3]); if (0 == message) { printf("Process %d exiting\n", rank); break; } } if (0 == rank) { MPI_Irecv(&message, 1, MPI_INT, prev, tag, MPI_COMM_WORLD, MPI_STATUS_IGNORE, &myRequest[3]); MPI_Wait(&myRequest, &myStatus); } /* All done */ MPI_Finalize(); return 0; } Hatalarımı düzeltmeme yardımcı olabilirseniz çok teşekkür ederim şimdiden.