Question: Compute the following code so that the token sent in the ring is a massive array around the size of 1 Gb. Run the code
Compute the following code so that the token sent in the ring is a massive array around the size of 1 Gb. Run the code using parallel and openMP and num threads.

Untitled - Notepad File Edit Format View Help #include #include #include int main(int argc, char** argv) // Initialize the MPI environment MPI_Init (NULL, NULL); // Find out rank, size int world_rank; MPI_Comm_rank (MPI_COMM WORLD, &world_rank); int world _size; MPI Comm size(MPI COMM WORLD, &world size); int token; // Receive from the lower process and send to the higher process. Take care // of the special case when you are the first process to prevent deadlock if (world-rank != 0) { MPI Recy(&token, 1, MPI INT, world rank - 1, 0, MPI COMM WORLD MPI-STATUS-IGNORE) ; printf("Process %d received token %d from process %d ", world-rank, token, world_rank - 1); else // Set the token's value if you are process token -1; MPI-Send(&token, 1, MPI-INT, (world-rank + 1) % world-size, 0, MPI_COMM WORLD); // Now process 0 can receive from the last process. This makes sure that at // least one MPI Send is initialized before all MPI Recvs (again, to prevent /I deadlock) if (world-rank-0) { MPI Recv(&token, 1, MPI INT, world size - 1, 0 MPI COMM WORLD MPI-STATUS-IGNORE) ; printf("Process %d received token %d from process %d ", world-rank, token, world size - 1); MPI_Finalize); Untitled - Notepad File Edit Format View Help #include #include #include int main(int argc, char** argv) // Initialize the MPI environment MPI_Init (NULL, NULL); // Find out rank, size int world_rank; MPI_Comm_rank (MPI_COMM WORLD, &world_rank); int world _size; MPI Comm size(MPI COMM WORLD, &world size); int token; // Receive from the lower process and send to the higher process. Take care // of the special case when you are the first process to prevent deadlock if (world-rank != 0) { MPI Recy(&token, 1, MPI INT, world rank - 1, 0, MPI COMM WORLD MPI-STATUS-IGNORE) ; printf("Process %d received token %d from process %d ", world-rank, token, world_rank - 1); else // Set the token's value if you are process token -1; MPI-Send(&token, 1, MPI-INT, (world-rank + 1) % world-size, 0, MPI_COMM WORLD); // Now process 0 can receive from the last process. This makes sure that at // least one MPI Send is initialized before all MPI Recvs (again, to prevent /I deadlock) if (world-rank-0) { MPI Recv(&token, 1, MPI INT, world size - 1, 0 MPI COMM WORLD MPI-STATUS-IGNORE) ; printf("Process %d received token %d from process %d ", world-rank, token, world size - 1); MPI_Finalize)