Elemental.jl icon indicating copy to clipboard operation
Elemental.jl copied to clipboard

README examples do not work one after the other.

Open alanedelman opened this issue 5 years ago • 12 comments

on the readme the first example and the second example do not compose a new user would naturally try both and get frustrated

perhaps the example that nominally states without MPI has a uniprocessor MPI under the hood causing interference?

but still this is frustrating as a user experience

julia> using LinearAlgebra, Elemental

julia> A = Elemental.Matrix(Float64)
0×0 Elemental.Matrix{Float64}

julia> using MPI, MPIClusterManagers, Distributed

julia> man = MPIManager(np = 4);
ERROR: AssertionError: MPI.Initialized() == mgr.launched
Stacktrace:
 [1] MPIManager(; np::Int64, launch_timeout::Float64, mode::TransportMode, master_tcp_interface::String) at /Users/edelman/.julia/packages/MPIClusterManagers/0ZYYQ/src/mpimanager.jl:64
 [2] top-level scope at REPL[4]:1

alanedelman avatar May 26 '20 20:05 alanedelman

I can't reproduce this. Is it possible that you've called MPI.Init() in your session?

andreasnoack avatar May 26 '20 20:05 andreasnoack

nope, the entire session is as typed in 1.4.2

alanedelman avatar May 26 '20 20:05 alanedelman

Which versions of Elemental, MPI and MPIClusterManagers are you using?

andreasnoack avatar May 26 '20 20:05 andreasnoack

Tagged versions (currently). BTW, I had the same issue.

  [902c3f28] Elemental v0.6.0
  [da04e1cc] MPI v0.14.2
  [e7922434] MPIClusterManagers v0.2.0
➜  ~ exec '/Users/viral/Desktop/Julia_Releases/Julia-1.4.app/Contents/Resources/julia/bin/julia'
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.4.2 (2020-05-23)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using LinearAlgebra, Elemental

julia> A = Elemental.Matrix(Float64)
0×0 Elemental.Matrix{Float64}

julia> Elemental.gaussian!(A, 100, 80);

julia> U, s, V = svd(A);

julia> convert(Matrix{Float64}, s)[1:10]
10-element Array{Float64,1}:
 18.20429433719855
 17.728335105360213
 17.17920145437086
 16.733135377026617
 16.502371100450368
 16.316310946797437
 16.051488300107216
 15.76097431919749
 15.121926373180647
 14.704011842059382

julia> using MPI, MPIClusterManagers, Distributed

julia> man = MPIManager(np = 4);
ERROR: AssertionError: MPI.Initialized() == mgr.launched
Stacktrace:
 [1] MPIManager(; np::Int64, launch_timeout::Float64, mode::TransportMode, master_tcp_interface::String) at /Users/viral/.julia/packages/MPIClusterManagers/0ZYYQ/src/mpimanager.jl:64
 [2] top-level scope at REPL[7]:1

ViralBShah avatar May 26 '20 22:05 ViralBShah

I do believe this used to work before the recent round of tagging new versions of packages. Could it be a Julia 1.4.2 issue?

ViralBShah avatar May 26 '20 22:05 ViralBShah

Yeah. I was on a dev branch that didn't have the _jll stuff. After freeing, I'm getting

julia> using MPI

julia> MPI.Initialized()
false

julia> using Elemental

julia> MPI.Initialized()
true

which used to be false so for some reason we are now automatically initializing MPI when loading Elemental. I'm wondering if this might be because Elemental and MPI are now using the same MPI "instance" where they didn't use to.

Oh, the joy of MPI. Maybe we can add a comment that each of the examples assumes a separate session.

andreasnoack avatar May 27 '20 06:05 andreasnoack

Maybe just do one intialization? I thought they would have big used the same system MPI in the past.

ViralBShah avatar May 27 '20 12:05 ViralBShah

Part of the idea with the first example is that you don't have to setup an MPIClusterManager if you don't run distributed. However, this is needed for the second example.

andreasnoack avatar May 27 '20 12:05 andreasnoack

Is the first example single core?

ViralBShah avatar May 27 '20 12:05 ViralBShah

Yes. Elemental.Matrix(Float64) is a non-distributed array type.

andreasnoack avatar May 27 '20 14:05 andreasnoack

It would be nice to lead with a parallel example. I might even suggest just dropping that one. I already have LAPACK and multi-threaded blas...

ViralBShah avatar May 27 '20 16:05 ViralBShah

i would drop the single processor example

On Wed, May 27, 2020 at 12:58 PM Viral B. Shah [email protected] wrote:

It would be nice to lead with a parallel example. I might even suggest just dropping that one. I already have LAPACK and multi-threaded blas...

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/JuliaParallel/Elemental.jl/issues/65#issuecomment-634802104, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGSSQS7STZKRPMGCEJYRSDRTVBEZANCNFSM4NLB5A6A .

alanedelman avatar May 27 '20 17:05 alanedelman