Closed ajshajib closed 5 years ago
Thanks @ajshajib!
Could you add a test of this?
Add dill to the list of packages installed by travis: https://github.com/adrn/schwimmbad/blob/master/.travis.yml#L44
Add a second test here (and call it in the if __name__ == '__main__'
block) to test using the new option?
https://github.com/adrn/schwimmbad/blob/master/schwimmbad/tests/test_mpi.py
@adrn I have added a separate test function for MPIPool(use_dill=True)
. However, I had to put it in a separate file test_mpi_with_dill.py
for the tests to finish running on Travis. I couldn't figure out why the tests were getting stuck when I put the new test function in test_mpi.py
. Although, the new test is being skipped for the same reason test_mpi()
is being skipped.
Strange! It looks like the test runs fine locally with:
mpiexec -n 2 python schwimmbad/tests/test_mpi_with_dill.py
I pushed a commit that adds this to the travis run, and I moved the dill
import so that it is only required if use_dill=True
.
Looks like things are passing - thanks @ajshajib!
@ajshajib PS: you said this is needed for dynesty. Would it help to release a new version of schwimmbad with this, or are you happy installing it from master?
@adrn Thanks for accepting the PR and making additional changes. While I am fine to install it from master, it would be great if you can release a new version in case some other people would need it. However, it's up to your discretion, for example, if you want to wait for some other developments in progress before bumping up the version.
Add option for dill serialization to MPIPool. This is necessary for some softwares, e.g., dynesty.