This commit is contained in:
Fabio Salvini 2016-11-13 13:24:26 +01:00
parent 14541623a4
commit c38550c8aa

View File

@ -159,7 +159,7 @@ double *compute_jacobi(int n, double init_value, double threshold, borders b, in
if (rank == 0) {
complete_x = create_sa_matrix(n + 2, n + 2);
memcpy(complete_x, x, (rows + 1) * (n + 2) * sizeof(double)); /* rows + 2 if rank == numprocs - 1 */
memcpy(complete_x, x, (rows + ((rank == numprocs - 1) ? 2 : 1)) * (n + 2) * sizeof(double));
rows_to_transmit = n / numprocs;
receive_pos = rows + 1;
for (i = 1; i < numprocs; i++) {