Skip to content

Commit

Permalink
updating file i/o for new standard
Browse files Browse the repository at this point in the history
  • Loading branch information
strassek committed Jul 26, 2011
1 parent f9cd2f1 commit 74a0d8f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions game_of_life/mpi/Life.c
Expand Up @@ -308,7 +308,7 @@ void write_grid (struct life_t * life)
for (i = 1; i <= nrows; i++) {
for (j = 1; j <= ncols; j++) {
if (grid[i][j] == ALIVE)
fprintf(fd, "%d %d\n", i-1, j-lbound-1);
fprintf(fd, "%d %d\n", i-1, j+lbound-1);
}
}
fclose(fd);
Expand All @@ -333,7 +333,7 @@ void write_grid (struct life_t * life)
for (i = 1; i <= nrows; i++) {
for (j = 1; j <= ncols; j++) {
if (grid[i][j] == ALIVE){
sprintf(buffer,"%d %d", i-1, j-lbound-1);
sprintf(buffer,"%d %d", i-1, j+lbound-1);
MPI_Send(buffer, 20, MPI_CHAR, 0, collect_tag, MPI_COMM_WORLD);
}
}
Expand Down

0 comments on commit 74a0d8f

Please sign in to comment.