Skip to content
This repository was archived by the owner on Dec 22, 2021. It is now read-only.

Tesseroid forward modeling takes an optional open multiprocessing.Pool#183

Merged
leouieda merged 4 commits intomasterfrom
reuse-pool
Mar 17, 2015
Merged

Tesseroid forward modeling takes an optional open multiprocessing.Pool#183
leouieda merged 4 commits intomasterfrom
reuse-pool

Conversation

@leouieda
Copy link
Copy Markdown
Member

The forward modeling functions in gravmag.tesseroid take an option
multiprocessing.Pool object to run things in parallel. This way, a pool
object can be reused for multiple calls, avoiding the repeated spawning
of processes.

Refactored the function code in the process to have less repetition. The
_dispatcher function now: checks arguments, spawns the pool if
necessary, dispatches the work, and returns the result.

Fixes #182

Checklist:

  • Make tests for new code
  • Create/update docstrings
  • Include relevant equations and citations in docstrings
  • Code follows PEP8 style conventions
  • Code and docs have been spellchecked
  • Include new dependencies in docs, requirements.txt, README, and .travis.yml
  • Documentation builds properly
  • All tests pass
  • Can be merged
  • Changelog entry

The forward modeling functions in gravmag.tesseroid take an option
multiprocessing.Pool object to run things in parallel. This way, a pool
object can be reused for multiple calls, avoiding the repeated spawning
of processes.

Refactored the function code in the process to have less repetition. The
_dispatcher function now: checks arguments, spawns the pool if
necessary, dispatches the work, and returns the result.
The links were to the gravmag.prism functions, no gravmag.tesseroid
leouieda added a commit that referenced this pull request Mar 17, 2015
Tesseroid forward modeling takes an optional open multiprocessing.Pool
@leouieda leouieda merged commit 327ec74 into master Mar 17, 2015
@leouieda leouieda deleted the reuse-pool branch March 17, 2015 21:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pass a multiprocessing.Pool object to forward modeling functions

1 participant