/* * bug.c * * Created on: May 4, 2009 * Author: motonacciu */ #include #include #include #include void create_matrix(float*** m, int N, int M){ int i; float* matrix = malloc(sizeof(float) * N * M); // create the main matrix *m = (float**) malloc(sizeof(float*) * N); // create and indexes vector for(i=0; i0) MPI_Sendrecv(A[i-1], N, MPI_FLOAT, top, 0, row, N, MPI_FLOAT, bottom, 0, MPI_COMM_WORLD, &status); } MPI_Barrier(MPI_COMM_WORLD); total = MPI_Wtime() - total; if(rank==0) printf("%d, %d, %0.3f\n", ntasks, N, total); MPI_Finalize(); free(*A); free(A); return 0; }