guanyilun / galilei

A generic function emulator that supports multiple backends
MIT License
1 stars 0 forks source link

experimental: add data collection only decorator supporting mpi #13

Closed guanyilun closed 1 year ago

guanyilun commented 1 year ago

For example,

import numpy as np
from galilei.sampling import build_samples
from galilei.experimental import collect

@collect(samples=build_samples(
    {'a': [0, 2], 'b': [0, 2]}, 100000
), save="test.pkl", mpi=True)
def test_em(a, b):
    x = np.linspace(0, 10, 100)
    return np.sin(a*x) + np.sin(b*x)

and suppose this script is called test.py. One could run it with

mpirun -n 10 python test.py

to perform parallel collection. Note that this requires mpi4py which will not be installed by default.

codecov-commenter commented 1 year ago

Codecov Report

Patch coverage has no change and project coverage change: -1.02 :warning:

Comparison is base (0308bfb) 12.26% compared to head (2e7baa6) 11.24%.

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #13 +/- ## ========================================== - Coverage 12.26% 11.24% -1.02% ========================================== Files 8 9 +1 Lines 375 409 +34 ========================================== Hits 46 46 - Misses 329 363 +34 ``` | [Impacted Files](https://codecov.io/gh/guanyilun/galilei/pull/13?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yilun+Guan) | Coverage Δ | | |---|---|---| | [galilei/experimental.py](https://codecov.io/gh/guanyilun/galilei/pull/13?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yilun+Guan#diff-Z2FsaWxlaS9leHBlcmltZW50YWwucHk=) | `0.00% <0.00%> (ø)` | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yilun+Guan). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yilun+Guan)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.