legend-exp / LegendDataManagement.jl

LegendMetadata access in Julia
Other
1 stars 5 forks source link

Add macro always_everywhere #44

Closed oschulz closed 4 months ago

oschulz commented 4 months ago

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

codecov[bot] commented 4 months ago

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 :warning:
Additional details and impacted files ```diff @@ 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 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.