Write two C programs for computing dot product that will run on any number of cores or comptuers using MPI. Use the skeleton code. The two versions are: (a) point to point comunication using MPI_Send() and MPI_Recv() and (b) collective communication using MPI_Scatter() and MPI_Gather() as we will discuss in class shortly. Use the following MPI constructs.
MPI_Recv(&tmp_prod, 1, MPI_INT, i, 123, MPI_COMM_WORLD, &status); MPI_Send(&prod, 1, MPI_INT, MASTER, 123, MPI_COMM_WORLD); MPI_Scatter(vector_x,size,MPI_INT,vector_x+sidx,size,MPI_INT,MASTER,world); MPI_Scatter(vector_y,size,MPI_INT,vector_y+sidx,size,MPI_INT,MASTER,world); MPI_Gather(&prod,1,MPI_INT,partial_prods,1,MPI_INT,MASTER,world);