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

Parallelize YawOptimizationScipy and YawOptimizationSR optimize methods across wind speeds/directions #944

Open
achenry opened this issue Jul 12, 2024 · 4 comments

Comments

@achenry
Copy link

achenry commented Jul 12, 2024

The optimization procedure, in particular the YawOptimizationScipy, would be much faster if parallelized across all available cores, given passed argument parallel to optimize method. Would require instantiating copies of fmodel' for each run.

See https://github.com/achenry/floris/blob/feature/mpc/floris/optimization/yaw_optimization/yaw_optimizer_scipy.py for working example. Warning, may not work if each optimize method is run in outer run in multiprocessing context.

@Bartdoekemeijer
Copy link
Collaborator

Hi @achenry, take a look at the parallel_floris_model interface,

def optimize_yaw_angles(

That does serve your needs?

@misi9170
Copy link
Collaborator

misi9170 commented Jul 16, 2024

We could look into adding a method for scipy optimization to the ParallelFlorisModel too---either by creating a new function similar to _optimize_yaw_angles_serial() for scipy optimization or by allowing the user to select between optimization routines in _optimize_yaw_angles_serial().

@achenry
Copy link
Author

achenry commented Jul 16, 2024

A few thoughts...

  1. It might be more helpful to use the same FlorisModel, but pass a parallel flag to the optimize methods, to facilitate switching easily between sequential and parallel operation for debugging
  2. For use with kestrel/HPC, need a working example including bash_script (I have these).

@misi9170
Copy link
Collaborator

For Floris v4, the hope was to have both the UncertainFlorisModel and the ParallelFlorisModel be drop-in replacements for the FlorisModel; that is, the FlorisModel would not take optional parallel or uncertain arguments, but rather the line
fmodel = FlorisModel(...)
could be simply replaced with
fmodel = ParallelFlorisModel(...) / fmodel = UncertainFlorisModel(...)
to run in parallel or uncertainty, respectively.

Although we achieved this for the UncertainFlorisModel, we didn't end up getting to this for the ParallelFlorisModel---the user interface is still different for the ParallelFlorisModel than the FlorisModel. We do hope to address this (make a parallelized drop-in for the FlorisModel, which hopefully parallelizes the run() method) in a future release. I think this would be similar to what you're after?

To your second point: since bash scripts are quite platform-specific, and many FLORIS users are not using Kestrel/NREL HPC systems, we haven't included bash scripts in the past. However, I think that could be reconsidered if it's possible to make a bash script that is general. Otherwise, we could include sample code bash code somewhere in the documentation.

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

No branches or pull requests

3 participants