From b9551de05ecd780240312fda0d8013ac46e156fe Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Fri, 7 Jun 2019 13:19:11 -0700 Subject: [PATCH] fix parallel render inventory --- pollen/private/ts.rktd | 2 +- pollen/render.rkt | 29 ++++++++++++++--------------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/pollen/private/ts.rktd b/pollen/private/ts.rktd index cedfff6..f404950 100644 --- a/pollen/private/ts.rktd +++ b/pollen/private/ts.rktd @@ -1 +1 @@ -1559937170 +1559938751 diff --git a/pollen/render.rkt b/pollen/render.rkt index 288a5b8..a57fc39 100644 --- a/pollen/render.rkt +++ b/pollen/render.rkt @@ -69,25 +69,24 @@ (loop))))) (define flattened-paths - (filter file-exists? - (let loop ([paths paths]) - (if (null? paths) - null - (match (->complete-path (car paths)) - [(? pagetree-source? pt) (append (loop (pagetree->paths pt)) (loop (cdr paths)))] - [path (cons path (loop (cdr paths)))]))))) - - (for ([path-group (in-list (slice-at flattened-paths (length worker-places)))]) - (define source-paths (for*/list ([path (in-list path-group)] - [source-path (in-value (->source-path path))] - #:when source-path) - source-path)) - (for ([source-path (in-list source-paths)] + (let loop ([paths paths]) + (if (null? paths) + null + (match (->complete-path (car paths)) + [(? pagetree-source? pt) (append (loop (pagetree->paths pt)) (loop (cdr paths)))] + [path (cons path (loop (cdr paths)))])))) + + (define source-paths (for*/list ([p (in-list flattened-paths)] + [maybe-source-path (in-value (->source-path p))] + #:when (and maybe-source-path (file-exists? maybe-source-path))) + maybe-source-path)) + (for ([source-path-group (in-list (slice-at source-paths (length worker-places)))]) + (for ([source-path (in-list source-path-group)] [(wp wpidx) (in-indexed worker-places)]) (message (format "rendering parallel on core ~a /~a" (add1 wpidx) (find-relative-path (current-project-root) source-path))) (place-channel-put wp (cons source-path (current-poly-target)))) - (for ([source-path (in-list source-paths)] + (for ([source-path (in-list source-path-group)] [(wp wpidx) (in-indexed worker-places)]) (message (format "rendered parallel on core ~a /~a" (add1 wpidx) (find-relative-path (current-project-root) (->output-path source-path))))