Liking cljdoc? Tell your friends :D

tech.parallel.for


as-iterableclj

(as-iterable item)
source

doitercljmacro

(doiter varname iterable & body)

Execute body for every item in the iterable. Expecting side effects, returns nil.

Execute body for every item in the iterable.  Expecting side effects, returns nil.
sourceraw docstring

dotimes-batchedcljmacro

(dotimes-batched [idx-var n-elems batch-size] & body)

Uses dotimes under the covers but provides support for a maximum batch size. Use this in production code to limit dotimes so you have safepoint access for really large iterations

Uses dotimes under the covers but provides support for a maximum batch size.
Use this in production code to limit dotimes so you have safepoint access for
really large iterations
sourceraw docstring

dotimes-safepointcljmacro

(dotimes-safepoint [idx-var n-elems] & body)

dotimes that allows safepoint access for parallelized loops that could get quite large.

dotimes that allows safepoint access for parallelized loops that could
get quite large.
sourceraw docstring

indexed-map-reduceclj

(indexed-map-reduce num-iters indexed-map-fn)
(indexed-map-reduce num-iters indexed-map-fn reduce-fn)

Given a function that takes exactly 2 arguments, a start-index and a length, call this function exactly N times where N is ForkJoinPool/getCommonPoolParallelism. Indexes will be split as evenly as possible among the invocations. Uses ForkJoinPool/commonPool for parallelism. The entire list of results (outputs of indexed-map-fn) are passed to reduce-fn; reduce-fn is called once. When called with 2 arguments the reduction function is dorun

Given a function that takes exactly 2 arguments, a start-index and a length,
call this function exactly N times where N is ForkJoinPool/getCommonPoolParallelism.
  Indexes will be split as evenly as possible among the invocations.  Uses
  ForkJoinPool/commonPool for parallelism.  The entire list of results (outputs of
  indexed-map-fn) are passed to reduce-fn; reduce-fn is called once.
  When called with 2 arguments the reduction function is dorun
sourceraw docstring

indexed-pmapclj

(indexed-pmap indexed-pmap-fn num-iters)
(indexed-pmap indexed-pmap-fn num-iters concat-fn)

Legacy function; really just indexed-map-reduce where the default reducer is #(apply concat %).

Legacy function; really just indexed-map-reduce where the default reducer
is #(apply concat %).
sourceraw docstring

launch-parallel-forclj

(launch-parallel-for num-iters indexed-map-fn)
(launch-parallel-for num-iters indexed-map-fn reduce-fn)

Legacy name. See indexed-map-reduce

Legacy name.  See indexed-map-reduce
sourceraw docstring

parallel-forcljmacro

(parallel-for idx-var num-iters & body)

Like clojure.core.matrix.macros c-for except this expects index that run from 0 -> num-iters. Idx is named idx-var and body will be called for each idx in parallel. Uses forkjoinpool's common pool for parallelism. Assumed to be side effecting; returns nil.

Like clojure.core.matrix.macros c-for except this expects index that run from 0 ->
num-iters.  Idx is named idx-var and body will be called for each idx in parallel.
Uses forkjoinpool's common pool for parallelism.  Assumed to be side effecting; returns
nil.
sourceraw docstring

serial-forcljmacro

(serial-for idx-var num-iters & body)

Utility to quickly switch between parallel/serial loop execution

Utility to quickly switch between parallel/serial loop execution
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close