Skip to content

Commit c1443fd

Browse files
updated Makefile
1 parent 80090f9 commit c1443fd

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

assignment2/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
all:
1+
parallel:
22
gcc -fopenmp gameOfLife.c
3-
3+
serial:
4+
gcc gameOfLife.c
45
clean:
56
del -f output.txt a.exe

assignment2/gameOfLife.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,15 @@ char** make_array(int columns, int rows) {
8080

8181
void copy_array_parallel(char** dst, char** src, int rows, int columns) {
8282

83-
int i = 0, j = 0;
83+
int i = 0;
8484

85-
#pragma omp parallel for private (i, j)
85+
#pragma omp parallel for private (i)
8686
for(i = 0; i < rows; i++){
87-
for(j = 0; j < columns; j++)
88-
dst[i][j] = src[i][j];
87+
strcpy(dst[i],src[i]);
8988
}
9089

9190
}
9291

93-
9492
char** read_file(const char* fileName, int* _rows, int* _columns) {
9593

9694
FILE* file = fopen(fileName,"r");

0 commit comments

Comments
 (0)