J
James M. Lawrence
= Tiamat
== Summary
Automatic parallelism across multiple cores and machines: a plugin for
Pure.
== Synopsis
require 'tiamat/autoconfig'
require 'benchmark'
mod = Pure.define do
def total(left, right)
left + right
end
def left
(1..500_000).inject(0) { |acc, n| acc + n }
end
def right
(1..500_000).inject(0) { |acc, n| acc + n }
end
end
# compute using two threads
puts Benchmark.realtime { mod.compute(2).total } # =>
0.4432079792022705
# compute using two local Ruby interpreters
Tiamat.open_local(2) {
puts Benchmark.realtime { mod.compute.total } # =>
0.2420041561126709
}
== Description
Tiamat is a worker plugin for the pure functional package. It links
Ruby interpreters together with DRb, forming a back-end for Pure's
parallelizing engine.
== Install
% gem install tiamat
Or for the (non-gem) .tgz package,
% ruby install.rb [--uninstall]
== Links
* Pure: http://purefunctional.rubyforge.org
* Documentation: http://tiamat.rubyforge.org
* Download: http://rubyforge.org/frs/?group_id=9145
* Rubyforge home: http://rubyforge.org/projects/tiamat
* Repository: http://github.com/quix/tiamat
== Author
* James M. Lawrence <[email protected]>
== Summary
Automatic parallelism across multiple cores and machines: a plugin for
Pure.
== Synopsis
require 'tiamat/autoconfig'
require 'benchmark'
mod = Pure.define do
def total(left, right)
left + right
end
def left
(1..500_000).inject(0) { |acc, n| acc + n }
end
def right
(1..500_000).inject(0) { |acc, n| acc + n }
end
end
# compute using two threads
puts Benchmark.realtime { mod.compute(2).total } # =>
0.4432079792022705
# compute using two local Ruby interpreters
Tiamat.open_local(2) {
puts Benchmark.realtime { mod.compute.total } # =>
0.2420041561126709
}
== Description
Tiamat is a worker plugin for the pure functional package. It links
Ruby interpreters together with DRb, forming a back-end for Pure's
parallelizing engine.
== Install
% gem install tiamat
Or for the (non-gem) .tgz package,
% ruby install.rb [--uninstall]
== Links
* Pure: http://purefunctional.rubyforge.org
* Documentation: http://tiamat.rubyforge.org
* Download: http://rubyforge.org/frs/?group_id=9145
* Rubyforge home: http://rubyforge.org/projects/tiamat
* Repository: http://github.com/quix/tiamat
== Author
* James M. Lawrence <[email protected]>