[Solved] MPI: parallelize a buffer over and over [closed]
MPI_INIT() and MPI_FINALIZE can only be called once per program, as your error hints at. This old answer from half a year ago sketches how to get MPI to run some parts of your program in parallel: int main(int argc, char *argv[]) { MPI_Init(&argc, &argv); MPI_Comm_size(MPI_COMM_WORLD,&numprocs); MPI_Comm_rank(MPI_COMM_WORLD,&myid); if (myid == 0) { // Do the … Read more