Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Distributed: "From worker" message missing or showing wrong worker id #38482

Closed
yha opened this issue Nov 18, 2020 · 4 comments · Fixed by #40423
Closed

Distributed: "From worker" message missing or showing wrong worker id #38482

yha opened this issue Nov 18, 2020 · 4 comments · Fixed by #40423
Labels
logging The logging framework parallelism Parallel or distributed computation

Comments

@yha
Copy link
Contributor

yha commented Nov 18, 2020

Log message (@info, @warn, @error) on workers do not show the "from worker" message (for local workers and first remote worker), or show the wrong worker id (for other remote workers):

julia> using Distributed

julia> local_procs = addprocs(4)
4-element Array{Int64,1}:
 2
 3
 4
 5

julia> remote_procs = addprocs([(remote_machine_spec, 4)]; remote_args...)
4-element Array{Int64,1}:
 6
 7
 8
 9

julia> @everywhere @info myid()
[ Info: [ 1
Info: 5
[ [ Info: Info: 2
4
[ Info: 3
      From worker 6:    [ Info: 8
      From worker 6:    [ Info: 7
[ Info: 6
      From worker 6:    [ Info: 9

Local and remote versioninfo():

julia> versioninfo()
Julia Version 1.5.2
Commit 539f3ce943 (2020-09-23 23:17 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i7-9800X CPU @ 3.80GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-9.0.1 (ORCJIT, skylake-avx512)

julia> @sync remotecall(()->InteractiveUtils.versioninfo(), 6);

julia>       From worker 6:     Julia Version 1.5.3
      From worker 6:    Commit 788b2c77c1 (2020-11-09 13:37 UTC)
      From worker 6:    Platform Info:
      From worker 6:      OS: Linux (x86_64-pc-linux-gnu)
      From worker 6:      CPU: Intel(R) Xeon(R) Gold 6248R CPU @ 3.00GHz
      From worker 6:      WORD_SIZE: 64
      From worker 6:      LIBM: libopenlibm
      From worker 6:      LLVM: libLLVM-9.0.1 (ORCJIT, cascadelake)
@JeffBezanson JeffBezanson added the parallelism Parallel or distributed computation label Nov 18, 2020
@JeffBezanson
Copy link
Member

This seems to be because Logging captures stderr before the worker startup process gets a chance to redirect it.

@JeffBezanson
Copy link
Member

Thinking about how to address this. One thing I tried that works is to launch the worker julia processes with the same pipe for stdout and stderr, instead of sharing the parent process stderr. However, because of #31036 it seems we need to preserve the option for the worker to share the parent process stderr. It also doesn't seem ideal that calling redirect_stderr doesn't redirect default logging. I suspect we need an IO object that means "whatever std* is currently".

@JeffBezanson
Copy link
Member

Aha! #26798

@simonbyrne simonbyrne added the logging The logging framework label Nov 24, 2020
@simonbyrne
Copy link
Contributor

See also JuliaLang/Distributed.jl#51 for similar issues.

vtjnash added a commit that referenced this issue Apr 9, 2021
This has the additional benefit of making the initial logger respect
changes to redirect_stderr/stdout, until the user explicitly sets
another stream as the logging destination.

Fix #26798
Fix #38482
Replaces #26920, which provided the idea and most of the implementation

Co-author-by: Joe Petviashvili <joe@gnom.us>
vtjnash added a commit that referenced this issue Apr 9, 2021
This has the additional benefit of making the initial logger respect
changes to redirect_stderr/stdout, until the user explicitly sets
another stream as the logging destination.

Fix #26798
Fix #38482
Replaces #26920, which provided the idea and most of the implementation

Co-author-by: Joe Petviashvili <joe@gnom.us>
vtjnash added a commit that referenced this issue Apr 9, 2021
This has the additional benefit of making the initial logger respect
changes to redirect_stderr/stdout, until the user explicitly sets
another stream as the logging destination.

Fix #26798
Fix #38482
Replaces #26920, which provided the idea and most of the implementation

Co-authored-by: Joe Petviashvili <joe@gnom.us>
vtjnash added a commit that referenced this issue Apr 21, 2021
This has the additional benefit of making the initial logger respect
changes to redirect_stderr/stdout, until the user explicitly sets
another stream as the logging destination.

Fix #26798
Fix #38482
Replaces #26920, which provided the idea and most of the implementation

Co-authored-by: Joe Petviashvili <joe@gnom.us>
ElOceanografo pushed a commit to ElOceanografo/julia that referenced this issue May 4, 2021
This has the additional benefit of making the initial logger respect
changes to redirect_stderr/stdout, until the user explicitly sets
another stream as the logging destination.

Fix JuliaLang#26798
Fix JuliaLang#38482
Replaces JuliaLang#26920, which provided the idea and most of the implementation

Co-authored-by: Joe Petviashvili <joe@gnom.us>
antoine-levitt pushed a commit to antoine-levitt/julia that referenced this issue May 9, 2021
This has the additional benefit of making the initial logger respect
changes to redirect_stderr/stdout, until the user explicitly sets
another stream as the logging destination.

Fix JuliaLang#26798
Fix JuliaLang#38482
Replaces JuliaLang#26920, which provided the idea and most of the implementation

Co-authored-by: Joe Petviashvili <joe@gnom.us>
johanmon pushed a commit to johanmon/julia that referenced this issue Jul 5, 2021
This has the additional benefit of making the initial logger respect
changes to redirect_stderr/stdout, until the user explicitly sets
another stream as the logging destination.

Fix JuliaLang#26798
Fix JuliaLang#38482
Replaces JuliaLang#26920, which provided the idea and most of the implementation

Co-authored-by: Joe Petviashvili <joe@gnom.us>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
logging The logging framework parallelism Parallel or distributed computation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants