diff --git a/src/MadsBlindSourceSeparation.jl b/src/MadsBlindSourceSeparation.jl index 31aca341..013bbeba 100644 --- a/src/MadsBlindSourceSeparation.jl +++ b/src/MadsBlindSourceSeparation.jl @@ -57,7 +57,7 @@ Returns: - NMF results """ -function NMFipopt(X::AbstractMatrix, nk::Integer, retries::Integer=1; random::Bool=false, maxiter::Integer=100000, maxguess::Number=1, initW::AbstractMatrix=Array{Float64}(undef, 0, 0), initH::AbstractMatrix=Array{Float64}(undef, 0, 0), verbosity::Integer=0, quiet::Bool=false) +function NMFipopt(X::AbstractMatrix, nk::Integer, retries::Integer=1; random::Bool=false, maxiter::Integer=100000, maxguess::Number=1, initW::AbstractMatrix=Array{Float64}(undef, 0, 0), initH::AbstractMatrix=Array{Float64}(undef, 0, 0), verbosity::Integer=0, quiet::Bool=Mads.quiet) Xc = copy(X) weights = ones(size(Xc)) nans = isnan.(Xc) @@ -133,7 +133,7 @@ Returns: - NMF results """ -function MFlm(X::AbstractMatrix{T}, nk::Integer; method::Symbol=:mads, log_W::Bool=false, log_H::Bool=false, retries::Integer=1, initW::AbstractMatrix=Array{T}(undef, 0, 0), initH::AbstractMatrix=Array{T}(undef, 0, 0), tolX::Number=1e-4, tolG::Number=1e-6, tolOF::Number=1e-3, tolOFcount::Integer=5, minOF::Number=1e-3, maxEval::Integer=1000, maxIter::Integer=100, maxJacobians::Integer=100, lambda::Number=100.0, lambda_mu::Number=10.0, np_lambda::Integer=10, show_trace::Bool=false, quiet::Bool=true) where {T <: Number} +function MFlm(X::AbstractMatrix{T}, nk::Integer; method::Symbol=:mads, log_W::Bool=false, log_H::Bool=false, retries::Integer=1, initW::AbstractMatrix=Array{T}(undef, 0, 0), initH::AbstractMatrix=Array{T}(undef, 0, 0), tolX::Number=1e-4, tolG::Number=1e-6, tolOF::Number=1e-3, tolOFcount::Integer=5, minOF::Number=1e-3, maxEval::Integer=1000, maxIter::Integer=100, maxJacobians::Integer=100, lambda::Number=100.0, lambda_mu::Number=10.0, np_lambda::Integer=10, show_trace::Bool=false, quiet::Bool=Mads.quiet) where {T <: Number} nP = size(X, 1) # number of observation points nC = size(X, 2) # number of observed components/transients Wbest = Array{T}(undef, nP, nk) diff --git a/src/MadsFunc.jl b/src/MadsFunc.jl index 0ee6757f..068f6233 100644 --- a/src/MadsFunc.jl +++ b/src/MadsFunc.jl @@ -105,7 +105,7 @@ function makemadscommandfunction(madsdata_in::AbstractDict; obskeys::AbstractVec madscritical("Julia function $(fn) is not defined!") end end - madsinfo("""Model setup: Julia function -> Internal model evaluation of Julia function '$(madsdata["Julia function"])'""") + madsinfo("""Model setup: Julia function -> Internal model evaluation of Julia function '$(madsdata["Julia function"])'""", 2) "MADS command function based on a Julia function '$(madsdata["Julia function"])'" function madscommandfunctionvector(parameters::AbstractDict) o = jf(collect(values(parameters))) @@ -113,11 +113,11 @@ function makemadscommandfunction(madsdata_in::AbstractDict; obskeys::AbstractVec end madscommandfunction = madscommandfunctionvector elseif haskey(madsdata, "Julia model") - madsinfo("""Model setup: Julia model -> Internal model evaluation of Julia function '$(madsdata["Julia model"])'""") + madsinfo("""Model setup: Julia model -> Internal model evaluation of Julia function '$(madsdata["Julia model"])'""", 2) madscommandfunction = madsdata["Julia model"] elseif haskey(madsdata, "MADS model") filename = joinpath(madsproblemdir, madsdata["MADS model"]) - madsinfo("Model setup: MADS model -> Internal MADS model evaluation a Julia script in file '$(filename)'") + madsinfo("Model setup: MADS model -> Internal MADS model evaluation a Julia script in file '$(filename)'", 2) madsdatacommandfunction = importeverywhere(filename) local madscommandfunction try @@ -129,7 +129,7 @@ function makemadscommandfunction(madsdata_in::AbstractDict; obskeys::AbstractVec madscommandfunction = Base.invokelatest(madsdatacommandfunction, madsdata) elseif haskey(madsdata, "Model") filename = joinpath(madsproblemdir, madsdata["Model"]) - madsinfo("Model setup: Model -> Internal model evaluation a Julia script in file '$(filename)'") + madsinfo("Model setup: Model -> Internal model evaluation a Julia script in file '$(filename)'", 2) madscommandfunction = importeverywhere(filename) elseif haskey(madsdata, "Command") || haskey(madsdata, "Julia command") || ( haskey(madsdata, "Julia function") && haskey(madsdata, "Linked directory") ) linkdir = true @@ -151,15 +151,15 @@ function makemadscommandfunction(madsdata_in::AbstractDict; obskeys::AbstractVec madsdata["Command"] = replace(madsdata["Command"], "julia" => "$(first(Base.julia_cmd().exec)) --startup-file=no") madsinfo("Mads Command has been updated to account for the location of julia: $(madsdata["Command"])") end - madsinfo("""Model setup: Command -> External model evaluation of command '$(madsdata["Command"])'""") + madsinfo("""Model setup: Command -> External model evaluation of command '$(madsdata["Command"])'""", 2) end if haskey(madsdata, "Julia command") filename = joinpath(madsproblemdir, madsdata["Julia command"]) - madsinfo("Model setup: Julia command -> Model evaluation using a Julia script in file '$(filename)'") + madsinfo("Model setup: Julia command -> Model evaluation using a Julia script in file '$(filename)'", 2) madsdatacommandfunction = importeverywhere(filename) elseif haskey(madsdata, "Julia function") && haskey(madsdata, "Linked directory") && madsdata["Linked directory"] == true if typeof(madsdata["Julia function"]) <: Function - madsinfo("""Model setup: Julia function -> Internal model evaluation of Julia function '$(madsdata["Julia function"])' in dedicated linked directory""") + madsinfo("""Model setup: Julia function -> Internal model evaluation of Julia function '$(madsdata["Julia function"])' in dedicated linked directory""", 2) "MADS command function" function madscommandfunctionexternal(parameters::AbstractVector) o = madsdata["Julia function"](parameters) diff --git a/src/MadsIO.jl b/src/MadsIO.jl index cfa528db..9414f48c 100644 --- a/src/MadsIO.jl +++ b/src/MadsIO.jl @@ -262,7 +262,7 @@ Example: md = Mads.loadmadsfile("input_file_name.mads") ``` """ -function loadmadsfile(filename::AbstractString; bigfile::Bool=false, format::AbstractString="yaml", quiet::Bool=false) +function loadmadsfile(filename::AbstractString; bigfile::Bool=false, format::AbstractString="yaml", quiet::Bool=Mads.quiet) if bigfile madsdata = loadbigyamlfile(filename) end diff --git a/src/MadsParallel.jl b/src/MadsParallel.jl index 212c678c..42888626 100644 --- a/src/MadsParallel.jl +++ b/src/MadsParallel.jl @@ -7,13 +7,10 @@ if isdefined(Core, :Mads) && !isdefined(Mads, :sprintf) sprintf(args...) = Base.eval(:@Printf.sprintf($(args...))) end -quietdefault = true -nprocs_per_task_default = 1 madsservers = ["madsmax", "madsmen", "madszem", "madskil", "madsart", "madsend"] # madsdam is out madsservers2 = vec(["madsmin"; map(i->(@Printf.sprintf "mads%02d" i), 1:18)]) madsserversall = vec(["madsmax"; "madsmen"; "madszem"; "madskil"; "madsart"; "madsend"; "madsmin"; map(i->(@Printf.sprintf "mads%02d" i), 1:18)]) # madsdam is out if isdefined(Main, :Mads) - quietdefault = Mads.quiet nprocs_per_task_default = Mads.nprocs_per_task_default madsservers = Mads.madsservers madsservers2 = Mads.madsservers2 @@ -44,7 +41,7 @@ end function setprocs(np::Integer) setprocs(np, np) end -function setprocs(; ntasks_per_node::Integer=0, nprocs_per_task::Integer=nprocs_per_task_default, nodenames::Union{String,Vector{String}}=Array{String}(undef, 0), mads_servers::Bool=false, test::Bool=false, quiet::Bool=quietdefault, veryquiet::Bool=false, dir::AbstractString=pwd(), exename::AbstractString=Base.julia_cmd().exec[1]) +function setprocs(; ntasks_per_node::Integer=0, nprocs_per_task::Integer=nprocs_per_task_default, nodenames::Union{String,Vector{String}}=Array{String}(undef, 0), mads_servers::Bool=false, test::Bool=false, quiet::Bool=Mads.quiet, veryquiet::Bool=false, dir::AbstractString=pwd(), exename::AbstractString=Base.julia_cmd().exec[1]) if isdefined(Core, :Mads) && isdefined(Mads, :set_nprocs_per_task) set_nprocs_per_task(nprocs_per_task) end