Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

fail at the example for distributed for loop reduce in readme #243

Closed
FuZhiyu opened this issue Jul 12, 2022 · 1 comment · Fixed by #295
Closed

fail at the example for distributed for loop reduce in readme #243

FuZhiyu opened this issue Jul 12, 2022 · 1 comment · Fixed by #295

Comments

@FuZhiyu
Copy link

FuZhiyu commented Jul 12, 2022

Sorry if it's already in the issues.

@everywhere using ProgressMeter
result = @showprogress 1 "Computing..." @distributed (+) for i in 1:10
           sleep(0.1)
           i^2
end

This example doesn't work in my case. Error:

nested task error: On worker 2:
UndefVarError: #3#ch not defined

My julia version:

Julia Version 1.7.3
Commit 742b9abb4d (2022-05-06 12:58 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin21.4.0)
  CPU: Apple M1 Max
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, westmere)
Environment:
  JULIA_NUM_THREADS = 4
@MarcMush
Copy link
Collaborator

MarcMush commented Sep 3, 2023

I could reproduce this in the REPL and in the global scope. It doesn't happen in a function or a local scope:

using Distributed
addprocs(2)

@everywhere using ProgressMeter
let a = 0
    result = @showprogress "Computing..." @distributed (+) for i in 1:10
        sleep(0.1)
        i^2
    end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants