From f07d4a0c031954ec9ab15f750ae3310e2bf9cd10 Mon Sep 17 00:00:00 2001
From: Dorian Stoll <dorian.stoll@uni-potsdam.de>
Date: Tue, 11 Jun 2024 09:02:50 +0200
Subject: [PATCH] zellularautomat: c: Remove unused RNG spinning

---
 src/benchmarks/zellularautomat/c/ca_common.c | 11 +----------
 src/benchmarks/zellularautomat/c/ca_common.h |  2 +-
 src/benchmarks/zellularautomat/c/ca_openmp.c |  2 +-
 3 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/src/benchmarks/zellularautomat/c/ca_common.c b/src/benchmarks/zellularautomat/c/ca_common.c
index 7f44e97c..3e0d9ace 100644
--- a/src/benchmarks/zellularautomat/c/ca_common.c
+++ b/src/benchmarks/zellularautomat/c/ca_common.c
@@ -25,19 +25,10 @@ void ca_init(int argc, char** argv, int *lines, int *its)
 }
 
 /* random starting configuration */
-void ca_init_config(line_t *buf, int lines, int skip_lines)
+void ca_init_config(line_t *buf, int lines)
 {
-	volatile int scratch;
-
 	srand(424243);
 
-	/* let the RNG spin for some rounds (used for distributed initialization) */
-	for (int y = 1;  y <= skip_lines;  y++) {
-		for (int x = 1;  x <= XSIZE;  x++) {
-			scratch = scratch + (rand() % 2);
-		}
-	}
-
 	for (int y = 1;  y <= lines;  y++) {
 		for (int x = 1;  x <= XSIZE;  x++) {
 			buf[y][x] = rand() % 2;
diff --git a/src/benchmarks/zellularautomat/c/ca_common.h b/src/benchmarks/zellularautomat/c/ca_common.h
index 7d764f91..2ef4d570 100644
--- a/src/benchmarks/zellularautomat/c/ca_common.h
+++ b/src/benchmarks/zellularautomat/c/ca_common.h
@@ -25,7 +25,7 @@ typedef uint8_t cell_state_t;
 typedef cell_state_t line_t[XSIZE + 2];
 
 void ca_init(int argc, char** argv, int *lines, int *its);
-void ca_init_config(line_t *buf, int lines, int skip_lines);
+void ca_init_config(line_t *buf, int lines);
 void ca_report(line_t *buf, int lines);
 
 #ifdef __cplusplus
diff --git a/src/benchmarks/zellularautomat/c/ca_openmp.c b/src/benchmarks/zellularautomat/c/ca_openmp.c
index 4e0e9480..00a3fb2d 100644
--- a/src/benchmarks/zellularautomat/c/ca_openmp.c
+++ b/src/benchmarks/zellularautomat/c/ca_openmp.c
@@ -75,7 +75,7 @@ int main(int argc, char** argv)
 	line_t *from = calloc((lines + 2), sizeof(line_t));
 	line_t *to = calloc((lines + 2), sizeof(line_t));
 
-	ca_init_config(from, lines, 0);
+	ca_init_config(from, lines);
 
 	for (int i = 0; i < its; i++) {
 		boundary(from, lines);
-- 
GitLab