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

Error running on Win10

Open henry2004y opened this issue 4 years ago • 5 comments

Hi,

I have an issue running MPI.jl on windows. In the Julia REPL, first I typed

julia> using Pkg

julia> Pkg.add("MPI")
   Updating registry at `C:\Users\henry\.julia\registries\General`
   Updating git-repo `https://github.com/JuliaRegistries/General.git`
  Resolving package versions...
   Updating `C:\Users\henry\.julia\environments\v1.4\Project.toml`
 [no changes]
   Updating `C:\Users\henry\.julia\environments\v1.4\Manifest.toml`
 [no changes]

julia> Pkg.status()
Status `C:\Users\henry\.julia\environments\v1.4\Project.toml`
  [da04e1cc] MPI v0.15.0

Then I created the same demo script from here:

# examples/01-hello.jl
using MPI
MPI.Init()

comm = MPI.COMM_WORLD
println("Hello world, I am $(MPI.Comm_rank(comm)) of $(MPI.Comm_size(comm))")
MPI.Barrier(comm)

During my first attempt in cmd,

mpiexec -3 julia test.jl

it returned similar as being reported in this issue

User credentials needed to launch processes: account (domain\user) [DESKTOP-3CFSBJ8\Hazem]:

I followed the instructions there

mpiexec -register

and added a user and passwd. Then, for the second attempt,

Microsoft Windows [Version 10.0.19041.388]
(c) 2020 Microsoft Corporation. All rights reserved.

D:\Test>mpiexec -n 3 julia test.jl
ERROR: ERROR: ERROR: LoadError: LoadError: LoadError: ArgumentError: Package MPI not found in current path:
- Run `import Pkg; Pkg.add("MPI")` to install the MPI package.

Stacktrace:ArgumentError: Package MPI not found in current path:
- Run `import Pkg; Pkg.add("MPI")` to install the MPI package.  

Stacktrace:ArgumentError: Package MPI not found in current path:
- Run `import Pkg; Pkg.add("MPI")` to install the MPI package.  

Stacktrace:
 [1] 
 [1] require
 [1] requirerequire(::(::(::Module, ::Symbol) at .\loading.jl:892
 [2] include(::Module, ::String) at .\Base.jl:377
 [3] exec_options(::Base.JLOptions) at .\client.jl:288
 [4] _start() at .\client.jl:484
in expression starting at D:\Test\test.jl:1
Module, ::Symbol) at .\loading.jl:892
 [2] include(::Module, ::String) at .\Base.jl:377
 [3] exec_options(::Base.JLOptions) at .\client.jl:288
 [4] _start() at .\client.jl:484
in expression starting at D:\Test\test.jl:1
Module, ::Symbol) at .\loading.jl:892
 [2] include(::Module, ::String) at .\Base.jl:377
 [3] exec_options(::Base.JLOptions) at .\client.jl:288
 [4] _start() at .\client.jl:484
in expression starting at D:\Test\test.jl:1

What is the exact error here?

henry2004y avatar Jul 29 '20 21:07 henry2004y

Can you try the following:

julia -e 'using Pkg; Pkg.status()'
mpiexec julia -e 'using Pkg; Pkg.status()'

simonbyrne avatar Jul 30 '20 03:07 simonbyrne

D:\Test>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 Pkg

julia> Pkg.status()
Status `C:\Users\henry\.julia\environments\v1.4\Project.toml`
  [da04e1cc] MPI v0.15.0

julia> 
D:\Test>mpiexec -n 1 julia -e 'using Pkg;Pkg.status()' 
ERROR: syntax: incomplete: invalid character literal
Stacktrace:
 [1] top-level scope at none:0

henry2004y avatar Jul 30 '20 05:07 henry2004y

I don't know what the second error is about. Can you put

using Pkg
Pkg.status()

in a file called status.jl and run it with mpiexec -n 1 julia status.jl?

simonbyrne avatar Jul 30 '20 05:07 simonbyrne

Here it is:

D:\Test>mpiexec -n 1 julia status.jl
ERROR: LoadError: IOError: stat: permission denied (EACCES) for file "C:\\WINDOWS\\system32\\config\\systemprofile"
Stacktrace:
 [1] stat(::String) at .\stat.jl:69
 [2] ispath at .\stat.jl:311 [inlined]
 [3] safe_realpath(::String) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\utils.jl:17
 [4] safe_realpath(::String) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\utils.jl:25 (repeats 4 times)       
 [5] find_project_file(::Nothing) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\Types.jl:197
 [6] Pkg.Types.EnvCache(::Nothing) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\Types.jl:281 (repeats 2 times)
 [7] Pkg.Types.Context() at .\util.jl:742
 [8] #status#123 at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\API.jl:832 [inlined]
 [9] status at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\API.jl:832 [inlined]
 [10] #status#120 at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\API.jl:828 [inlined]
 [11] status() at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\API.jl:828
 [12] top-level scope at D:\Test\status.jl:2
 [13] include(::Module, ::String) at .\Base.jl:377
 [14] exec_options(::Base.JLOptions) at .\client.jl:288
 [15] _start() at .\client.jl:484
in expression starting at D:\Test\status.jl:2

henry2004y avatar Jul 30 '20 15:07 henry2004y

Hmm, looks like the permissions are still not set correctly. Unfortunately i'm not familiar with Windows permissions.

Can you use the BinaryBuilder-provided binary? Try setting JULIA_MPI_BINARY="" and rerun Pkg.build("MPI").

simonbyrne avatar Jul 30 '20 15:07 simonbyrne