Commits

Anonymous committed 2966ab7

cleanup, add option to updated printout every m lines

Comments (0)

Files changed (1)

stand_alone/results.awk

 	return res;
 }
 
-BEGIN {
-	PROCINFO["sorted_in"] = "@ind_num_asc";
-	term = ENVIRON["TERM"];
-
-	cup00 = tput("cup 0 0");
-	el0   = tput("el 0");
-	ed0   = tput("ed 0");
-
-	printf("%s%s", cup00, ed0);
-	beg = systime();
-}
-
+function printout()
 {
 	t = systime() - beg;
 	printf("%s", cup00);
 
 	if ($1 ~ /^[^UDFBRL]/) { # using with multi, first field is solver fifo name
-		sol[$1]++;
-		len[NF - 1]++;
-		total += NF - 1;
-
 		printf("|solver              \n");
 		printf("|   |number of solves\n");
 		printf("|---|----------------\n");
 		printf("---------------------\n");
 		printf("    %d\n", NR);
 		printf("%s\n", el0);
-	} else {
-		len[NF]++;
-		total += NF;
 	}
-
 	printf("|length of solve     \n");
 	printf("|  |number of solves \n");
 	printf("|--|-----------------\n");
 	printf("mean  time (seconds):  %g%s\n", t / NR, el0);
 	printf("mean solution length: %g%s\n", total / NR, el0);
 }
+
+BEGIN {
+	PROCINFO["sorted_in"] = "@ind_num_asc";
+	term = ENVIRON["TERM"];
+
+	cup00 = tput("cup 0 0");
+	el0   = tput("el 0");
+	ed0   = tput("ed 0");
+
+	if (!m) m = 1;
+
+	printf("%s%s", cup00, ed0);
+	beg = systime();
+}
+
+{
+	if ($1 ~ /^[^UDFBRL]/) { # using with multi, first field is solver fifo name
+		sol[$1]++;
+		len[NF - 1]++;
+		total += NF - 1;
+	} else {
+		len[NF]++;
+		total += NF;
+	}
+
+	if (NR % m == 0)
+		printout();
+}
+
+END {
+	printout();
+}