Sha256: 06fdc40b4f090cf7064c5fbd2232761bd51a64baab68a94fc5467c8f0a5d8a75

Contents?: true

Size: 350 Bytes

Versions: 4

Compression:

Stored size: 350 Bytes

Contents

require "mpi"

MPI.Init


world = MPI::Comm::WORLD

if world.size == 1
  print "Size is one, so do nothing\n"
  exit
end

rank = world.rank

if rank == 0
  (world.size-1).times do |i|
    str ="\x00"*100
    world.Recv(str, i+1, 0) 
    p str.gsub(/\000/,"")
  end
else
  message = "Hello from #{rank}"
  world.Send(message, 0, 0)
end


MPI.Finalize

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ruby-mpi-0.4.0 samples/hello.rb
ruby-mpi-0.3.2 samples/hello.rb
ruby-mpi-0.3.1 samples/hello.rb
ruby-mpi-0.3.0 samples/hello.rb