Question about pmap

2009-08-03 Thread Johann Kraus
Hi all, recently I did some micro-benchmarks of parallel code on my 8-core computer. But I don't get the point about this behaviour of pmap. Can anyone explain this to me? The code is running on a dual quad-core intel machine (Xeon X5482, 3.20 GHz). (defn maptest [cores] (doall (map (fn [x] (dot

Re: Question about pmap

2009-08-03 Thread Johann Kraus
Sorry about the copy&paste error. I partially changed len to cores. The code must look like: (defn maptest [cores] (doall (map (fn [x] (dotimes [_ 10] (inc 0))) (range cores (defn pmaptest [cores] (doall (pmap (fn [x] (dotimes [_ 10] (inc 0))) (range cores and (defn mapt

Re: Question about pmap

2009-08-04 Thread Johann Kraus
> My guess would be you're seeing the overhead for pmap since the > (inc 0.1) computation is so cheap.  From the docs for pmap: >   "Only useful for computationally intensive functions where the time of >   f dominates the coordination overhead." I don't think so, as the cheap computation (inc 0.

Re: Question about pmap

2009-08-05 Thread Johann Kraus
> Could it be that your CPU has a single floating-point unit shared by 4 > cores on a single die, and thus only 2 floating-point units total for > all 8 of your cores? If so, then that fact, plus the fact that each > core has its own separate ALU for integer operations, would seem to > explain th

Re: Question about pmap

2009-08-09 Thread Johann Kraus
> Johann, if you are still following this thread, could you try running > this Clojure program on your 8 core machine? > > http://github.com/jafingerhut/clojure-benchmarks/blob/3e45bd8f6c3eba4... > > These first set of parameters below will do 8 jobs sequentially, each > doing 10^10 (inc c)'s, whe

How to efficiently import large array of doubles from file?

2010-02-22 Thread Johann Kraus
Hi everyone, I need some help for loading in large data from file. For instance, I'm trying to load from a text file one line of 5000 double values (separated by comma). Having 8 byte per double I would assume this to fit into ~400MB of memory, at least when using a java double array internall

Re: How to efficiently import large array of doubles from file?

2010-03-01 Thread Johann Kraus
Hi and Thanks to all, that helped a lot. I should definitely refactor my code using transients. And the new vector-of is what I needed. The StringBuilder trick saves lot of memory compared to a line split on very large lines. Thanks again, Johann -- You received this message because you are subs