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

Add macro always_everywhere #44

Merged
merged 2 commits into from
Apr 15, 2024
Merged

Add macro always_everywhere #44

merged 2 commits into from
Apr 15, 2024

Conversation

oschulz
Copy link
Contributor

@oschulz oschulz commented Apr 15, 2024

This enables

using Distributed, LegendDataManagement

@always_everywhere begin
    using Distributions

    get_global_value() = 42
end

dist = Normal()

legend_addprocs()

worker = last(workers())
remotecall_fetch(get_global_value, worker)
@fetchfrom worker Normal()

even though the last worker was added after @always_everywhere. This way, using and import statements and other init code, in scripts that use distributed computing, can just be somewhere at the top and don't have to be repeated after adding workers.

CC @theHenks

Copy link

codecov bot commented Apr 15, 2024

Codecov Report

Attention: Patch coverage is 0% with 14 lines in your changes are missing coverage. Please review.

Project coverage is 35.10%. Comparing base (fb3c66b) to head (ed7f6f2).

Files Patch % Lines
src/workers.jl 0.00% 14 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #44      +/-   ##
==========================================
- Coverage   35.22%   35.10%   -0.12%     
==========================================
  Files          25       25              
  Lines        1482     1487       +5     
==========================================
  Hits          522      522              
- Misses        960      965       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@oschulz oschulz force-pushed the always_everywhere branch from b86802b to ed7f6f2 Compare April 15, 2024 11:38
@oschulz oschulz merged commit ed7f6f2 into main Apr 15, 2024
8 of 10 checks passed
@oschulz oschulz deleted the always_everywhere branch April 15, 2024 14:10
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 this pull request may close these issues.

1 participant