You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sample_flow_at_points() not parallelized in ParFlorisModel
The sample_flow_at_points() function runs on a single core even when evaluated on the ParFlorisModel class.
How to reproduce
Here's a simple example that should run in parallel, but doesnt:
import numpy as np
from floris import ParFlorisModel
if __name__ == "__main__":
# Load the parallel floris model and create a 200-turbine farm
fmodel = ParFlorisModel("inputs/gch.yaml", max_workers=8)
fmodel.set(
layout_x=5 * 126.0 * np.arange(200),
layout_y=np.zeros(200),
)
# Cover a large grid of findices
wd_grid, ws_grid = np.meshgrid(
np.arange(0.0, 360.0, 3.0),
np.arange(1.0, 30.01, 1.0)
)
fmodel.set(
wind_directions=wd_grid.flatten(),
wind_speeds=ws_grid.flatten(),
turbulence_intensities=0.06 * np.ones_like(ws_grid.flatten()),
)
# Sample wind speeds at a couple of points in the flow
wind_speeds_at_points = fmodel.sample_flow_at_points(
x=[500.0, 750.0, 1000.0, 1250.0, 1500.0],
y=[ 0.0, 0.0, 0.0, 0.0, 0.0],
z=[ 90.0, 90.0, 90.0, 90.0, 90.0]
)
print(wind_speeds_at_points)
And when using top in the terminal, I would expect multiple python instances to appear for the parallel run. They do not. This is because sample_flow_at_points() does not cycle through the normal run() command, as far as I understand.
Relevant output
The outputs of the script should remain identical, but during execution multiple python instances should appear. Also, the script should run substantially faster in parallel than in serial.
Floris version
Current develop branch, FLORIS v4.2, commit 8a2bdd0318dd60b14fb3053cf92e93c35aa56007
System Information
OS: Ubuntu 22.04 LTS
Python version: Python 3.12.6
Library versions
numpy==1.26.4
numexpr==2.10.1
scipy==1.14.1
pandas==2.2.3
The text was updated successfully, but these errors were encountered:
sample_flow_at_points() not parallelized in ParFlorisModel
The
sample_flow_at_points()
function runs on a single core even when evaluated on theParFlorisModel
class.How to reproduce
Here's a simple example that should run in parallel, but doesnt:
And when using
top
in the terminal, I would expect multiplepython
instances to appear for the parallel run. They do not. This is becausesample_flow_at_points()
does not cycle through the normalrun()
command, as far as I understand.Relevant output
The outputs of the script should remain identical, but during execution multiple
python
instances should appear. Also, the script should run substantially faster in parallel than in serial.Floris version
Current develop branch, FLORIS v4.2, commit
8a2bdd0318dd60b14fb3053cf92e93c35aa56007
System Information
The text was updated successfully, but these errors were encountered: