Skip to content

Commit

Permalink
Add MPART_INITIALIZE option (#24)
Browse files Browse the repository at this point in the history
* Update MParT.jl

* Update MParT.jl
  • Loading branch information
dannys4 authored Jul 8, 2024
1 parent 45b7735 commit 9a59088
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/MParT.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,19 @@ end
function __init__()
@initcxx
threads = get(ENV, "KOKKOS_NUM_THREADS", nothing)
init_mpart = true
try
init_mpart = parse(Bool, lowercase(get(ENV, "MPART_INITIALIZE", "true")))
catch e
@warn "Expected MPART_INITIALIZE to be a `true`/`false` value. Defaulting to true."
end
opts = StdVector{StdString}()
if !isnothing(threads)
push!(opts, StdString("kokkos_num_threads"))
push!(opts, StdString(string(threads)))
end
length(opts) > 0 && @info "Using MParT options: "*join(string.(opts),", ")
Initialize(opts)
init_mpart && Initialize(opts)
end

"""
Expand Down

0 comments on commit 9a59088

Please sign in to comment.