Skip to content

Instantly share code, notes, and snippets.

@ArchRobison
Created October 17, 2014 21:35
Show Gist options
  • Select an option

  • Save ArchRobison/34a021a5d668026e35b3 to your computer and use it in GitHub Desktop.

Select an option

Save ArchRobison/34a021a5d668026e35b3 to your computer and use it in GitHub Desktop.
Running MPI.jl examples
$ for f in *.jl; do echo $f; mpiexec -np 4 julia $f; done
01-hello.jl
Hello world, I am 1 of 4Hello world, I am 3 of 4Hello world, I am 2 of 4Hello world, I am 0 of 4
02-broadcast.jl
------------------------------------------------------------------------------
Running on 4 processes
------------------------------------------------------------------------------
[[[[00] A:000123] A:] A:] A:Complex{Float64}[1.0 + 2.0im,2.0 + 4.0im,3.0 + 6.0im,4.0 + 8.0im,5.0 + 10.0im]
Complex{Float64}[1.0 + 2.0im,2.0 + 4.0im,3.0 + 6.0im,4.0 + 8.0im,5.0 + 10.0im]
Complex{Float64}[1.0 + 2.0im,2.0 + 4.0im,3.0 + 6.0im,4.0 + 8.0im,5.0 + 10.0im]
Complex{Float64}[1.0 + 2.0im,2.0 + 4.0im,3.0 + 6.0im,4.0 + 8.0im,5.0 + 10.0im]
[00] B:{"foo"=>"bar"}
[02] B:[01] B:[03] B:{{{"foo"=>"bar"}
"foo"=>"b"foo"=>"barar"}
"}
[00] f(3):14
[01] f(3):14
[02] f(3):[03] f(3):14
14
03-reduce.jl
sum of ranks: 6
04-sendrecv.jl
2: Sending 2 -> 3 = [2.0,2.0,2.0,2.0]3: Sending 3 -> 0 = [3.0,3.0,3.0,3.0]0: Sending 0 -> 1 = [0.0,0.0,0.0,0.0]1: Sending 1 -> 2 = [1.0,1.0,1.0,1.0]
3: Receiving 2 -> 3 = [2.0,2.0,2.0,2.0]
0: Receiving 3 -> 0 = [3.0,3.0,3.0,3.0]
1: Receiving 0 -> 1 = [0.0,0.0,0.0,0.0]
2: Receiving 1 -> 2 = [1.0,1.0,1.0,1.0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment