From 73ec86a2c9ef47c1fa25f23bdc58ace345635ef1 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sat, 13 Dec 2014 01:09:06 +0100 Subject: [PATCH] Use the new pgn-extract partitioning to get the file offsets right. --- find-pgn-split-point.sh | 6 +----- parallel-parse-pgn.sh | 6 +++++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/find-pgn-split-point.sh b/find-pgn-split-point.sh index b23bc33..111beae 100755 --- a/find-pgn-split-point.sh +++ b/find-pgn-split-point.sh @@ -24,8 +24,4 @@ split_point() { fi } -FROM=$( split_point "$FILE" $P $NUM ) -TO=$( split_point "$FILE" $(( P + 1 )) $NUM ) -SIZE=$(( TO - FROM )) - -tail -c +$FROM "$FILE" | head -c $SIZE +split_point "$FILE" $P $NUM diff --git a/parallel-parse-pgn.sh b/parallel-parse-pgn.sh index 37ce2e4..cfb61bc 100755 --- a/parallel-parse-pgn.sh +++ b/parallel-parse-pgn.sh @@ -1,6 +1,10 @@ #! /bin/sh FILE=$1 for X in $( seq 0 39 ); do - ( ./partition-pgn.sh "$FILE" $X 40 | ~/nmu/pgn-extract/pgn-extract -e -Wsessebin >> part-$X.bin 2>/dev/null ) & + ( + START=$( ./find-pgn-split-point.sh "$FILE" $X 40 ) + END=$( ./find-pgn-split-point.sh "$FILE" $(( X + 1 )) 40 ) + ~/nmu/pgn-extract/pgn-extract --startpos $START --endpos $END -e -Wsessebin "$FILE" >> part-$X.bin 2>/dev/null + ) & done wait -- 2.39.2