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

New parallel option that is fully consistent with FlorisModel #982

Draft
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

misi9170
Copy link
Collaborator

@misi9170 misi9170 commented Sep 16, 2024

New interface for parallel computing with FLORIS. The existing ParallelFlorisModel was not fully consistent with the new FlorisModel and UncertainFlorisModel developed for FLORIS v4. This addresses the inconsistency in a new class, ParFlorisModel. ParallelFlorisModel will remain in FLORIS v4 to avoid making breaking changes, but now has a deprecation warning and will be removed in the next major version release of FLORIS.

Development still to take place:

  • Create script for timing both the existing ParallelFlorisModel and the new class with increasing n_findex and increasing n_turbines, and can be run on both HPC and locally. Report results.
  • Test whether there is a significant speed increase in returning powers only, rather than full velocity fields. Even if not, we may leave that option. [Minimal effect when using multiprocessing]
  • Test other parallel computing paradigms and see whether they'd be easy to include (concurrent, mpi4py)
  • See whether it is possible to spin up the worker pool on instantiation of the class and then send it jobs, to reduce overhead if multiple run() calls are needed [Yes, with pathos package]

Checklist before converting this draft to full PR status and preparing for merger:

  • Remove temporary examples designed to be run on HPC
  • Add documentation
  • Select name for new class and rename
  • Add deprecation warning to existing ParallelFlorisModel
  • Add any new examples
  • Replace usage of existing ParallelFlorisModel in examples (if it’s there)

* Copy for easier comparison and development.

* temp commit to save progress.

* Starting to build out new ParallelFlorisModel (name not yet fixed).

* Begin building tests.

* Cleanup and formatting.

* Now able to use run() in parallel.

* Switch to hidden _get_turbine_powers.

* Add backcompatibility with existing parallel model; print timings; add powers_only option.

* Example comparing timing.

* Formatting fixes.

* Test for return_turbine_powers_only flag.

* Backcompatibility in configuration.

* Appears there is no saving in calling run() twice---all overhead occurs again.

* Fix type hints; default for n_wind_condition_splits; remove mistakenly committed yaw optimization function.

* Tests for WindData objects; remove related comment.

* Tests control setpoints (and add bugfix). Also limit number of workers for testing.
@misi9170 misi9170 changed the title Initial work on a consistent parallel FLORIS model (#977) New parallel option that is fully consistent with FlorisModel Sep 16, 2024
misi9170 and others added 3 commits September 24, 2024 13:50
* Update uncertain floris model to accept par floris

* Raise an error in old parallel floris model blocking passing in uncertain floris model

* Add an example of parallelized uncertain floris
* Update example to profile more fully.

* Handling for pathos parallel processing package; comparison example to multiprocessing.

* Add test for pathos interface.

* Add concurrent handling.

* minor doc updates.

* add pathos requirement
@misi9170
Copy link
Collaborator Author

misi9170 commented Sep 27, 2024

Something to decide on is the default parallel interface. My thinking is that the default should be "multiprocessing", even though "pathos" is faster, because the multiprocessing package is pretty ubiquitous and pathos is still on version 0.x

* Update example to profile more fully.

* Handling for pathos parallel processing package; comparison example to multiprocessing.

* Add test for pathos interface.

* Add concurrent handling.

* minor doc updates.

* add pathos requirement

* Change name to ParFlorisModel throughout.

* Add deprecation warning for ParallelFlorisModel.

* Add import; isort.

* Update example to use ParFlorisModel.

* Update tests; formatting.

* Fix uncertain-parallel example; add uncertain-parallel test.

* Update example docstring.

* Remove temporary examples from repository.
@paulf81
Copy link
Collaborator

paulf81 commented Sep 30, 2024

Something to decide on is the default parallel interface. My thinking is that the default should be "multiprocessing", even though "pathos" is faster, because the multiprocessing package is pretty ubiquitous and pathos is still on version 0.x

I agree, using multiprocessing seems the better choice for default

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.

2 participants