Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
8 lines (6 sloc) 268 Bytes
(ns map-reduce)
(defn map-reduce [mapper reducer coll]
(let [n (.availableProcessors (Runtime/getRuntime))
partition-size (Math/ceil (/ (count coll) n))
partitions (partition-all partition-size coll)]
(reduce reducer (pmap mapper partitions))))