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

Fixing issue with linear algebra threads #65

Merged
merged 1 commit into from
Jul 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/aero/aero.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,22 @@ are exported other functions are kept within the `aerodynamics` namespace.
module aerodynamics

using StaticArrays
using LinearAlgebra
using ..atmosphere
import ..TASOPT: __TASOPTindices__, __TASOPTroot__

export airfoil, cdsum!, surfcm, wingsc, wingpo, wingcl, fusebl!

# Define the __init__ function
#This function gets executed automatically when the module is loaded
function __init__()
BLAS.set_num_threads(1) #This sets the number of threads in BLAS to be equal to 1.
#It prevents multithreading but ensures consistent speed across CPU families. Without it,
#the LU calculation in blax() can take up to 1000x longer.
#TODO this may cause issues if parallelization is attempted in the future. Other approaches are to
#match the number of BLAS threads to the CPUs available on the machine or server
end

#include index to access arrays
include(__TASOPTindices__)
include(joinpath(__TASOPTroot__,"utils/spline.jl"))
Expand Down