devel: parallelize
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -16,3 +16,4 @@ obj/
|
||||
*.bin
|
||||
*.data
|
||||
src/CLI/publish
|
||||
*.svg
|
||||
|
||||
@@ -129,7 +129,7 @@ let compressElevationToDisk (timeFrames: int) (zetas: single[,]) =
|
||||
/// <param name="bathymetry">Seabed depth vector</param>
|
||||
let compressBathymetryToDisk (bathymetry: single array) =
|
||||
let tolerance = 1e-1
|
||||
zfpCompressToFile bathymetry tolerance $"bathymetry.zfp"
|
||||
zfpCompressToFile bathymetry tolerance "bathymetry.zfp"
|
||||
|> function
|
||||
| Ok() -> Log.Verbose "Wrote bathymetry to zfp format"
|
||||
| Error e -> Log.Warning e
|
||||
|
||||
@@ -46,9 +46,9 @@ let separateCoastline (grid: Grid.Grid) : Grid.Edge array * Grid.NodeIdx array =
|
||||
let innerNodes =
|
||||
Log.Debug "Finding all nodes that are not part of a coastal edge"
|
||||
[| 0 .. grid.Nodes.Length - 1 |]
|
||||
|> Array.filter (fun node ->
|
||||
|> Array.Parallel.filter (fun node ->
|
||||
coastalEdges
|
||||
|> Array.exists (fun (a, b) -> a = node || b = node)
|
||||
|> Array.Parallel.exists (fun (a, b) -> a = node || b = node)
|
||||
|> not
|
||||
)
|
||||
|
||||
@@ -89,7 +89,7 @@ let buildPolygons (edges: Grid.Edge array) =
|
||||
let polygon = findPolygon remaining[0] [||]
|
||||
let newRemaining =
|
||||
remaining
|
||||
|> Array.filter (fun (a, b) ->
|
||||
|> Array.Parallel.filter (fun (a, b) ->
|
||||
(polygon |> Array.contains a |> not)
|
||||
&& (polygon |> Array.contains b |> not)
|
||||
)
|
||||
|
||||
@@ -502,8 +502,6 @@ let angleBoundEdgeCollapseKernelMean
|
||||
(nIdx: Grid.NeighborIndex)
|
||||
(settings: ReduceSettings)
|
||||
=
|
||||
// TODO: Accept ReduceSettings record containing minAngle, delta, various
|
||||
// bools, etc
|
||||
let mutGrid = MutableGraph.MutableGrid(grid, nIdx)
|
||||
|
||||
if settings.writeSteps then
|
||||
|
||||
Reference in New Issue
Block a user