Skip to content

Commit

Permalink
show progress bar in ribasim_cli (#417)
Browse files Browse the repository at this point in the history
Fixes part of #370

Built ribasim_cli locally to confirm that it works, here with a quick
run that took 3s, and a run that is estimated to take 17 hours (which we
need to investigate, from
https://github.com/d2hydro/lhm-ribasim/tree/main/models/ribasim_model_nederland)


![image](https://github.com/Deltares/Ribasim/assets/4471859/d06b3ea0-a499-4fb7-a0b6-f5f2b468638f)


![image](https://github.com/Deltares/Ribasim/assets/4471859/06e74963-8fbd-4e2a-80a0-9deb13e613d0)
  • Loading branch information
visr authored Jul 11, 2023
1 parent fbe786e commit 802adb1
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 29 deletions.
4 changes: 2 additions & 2 deletions build/create_binaries/Manifest.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is machine-generated - editing it directly is not advised

julia_version = "1.9.1"
julia_version = "1.9.2"
manifest_format = "2.0"
project_hash = "c56985ee841fb30b2cb92ecec4da345315a95306"

Expand Down Expand Up @@ -85,7 +85,7 @@ version = "2.1.7"
[[deps.Pkg]]
deps = ["Artifacts", "Dates", "Downloads", "FileWatching", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"]
uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
version = "1.9.0"
version = "1.9.2"

[[deps.Printf]]
deps = ["Unicode"]
Expand Down
26 changes: 13 additions & 13 deletions build/libribasim/Manifest.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is machine-generated - editing it directly is not advised

julia_version = "1.9.1"
julia_version = "1.9.2"
manifest_format = "2.0"
project_hash = "acdb5a19082f8635b39f23593d4b72c8c85cad8e"

Expand Down Expand Up @@ -157,7 +157,7 @@ weakdeps = ["Dates", "LinearAlgebra"]
[[deps.CompilerSupportLibraries_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae"
version = "1.0.2+0"
version = "1.0.5+0"

[[deps.ComponentArrays]]
deps = ["ArrayInterface", "ChainRulesCore", "ForwardDiff", "Functors", "LinearAlgebra", "Requires", "StaticArrayInterface"]
Expand Down Expand Up @@ -369,9 +369,9 @@ uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee"

[[deps.FillArrays]]
deps = ["LinearAlgebra", "Random", "SparseArrays", "Statistics"]
git-tree-sha1 = "2250347838b28a108d1967663cba57bfb3c02a58"
git-tree-sha1 = "e5556303fd8c9ad4a8fceccd406ef3433ddb4c45"
uuid = "1a297f60-69ca-5386-bcde-b61e274b549b"
version = "1.3.0"
version = "1.4.0"

[[deps.FiniteDiff]]
deps = ["ArrayInterface", "LinearAlgebra", "Requires", "Setfield", "SparseArrays"]
Expand Down Expand Up @@ -412,9 +412,9 @@ version = "0.1.3"

[[deps.Functors]]
deps = ["LinearAlgebra"]
git-tree-sha1 = "478f8c3145bb91d82c2cf20433e8c1b30df454cc"
git-tree-sha1 = "9a68d75d466ccc1218d0552a8e1631151c569545"
uuid = "d9f16b24-f501-4c13-a1f2-28368ffc5196"
version = "0.4.4"
version = "0.4.5"

[[deps.Future]]
deps = ["Random"]
Expand Down Expand Up @@ -609,9 +609,9 @@ version = "1.0.0"

[[deps.LoopVectorization]]
deps = ["ArrayInterface", "ArrayInterfaceCore", "CPUSummary", "CloseOpenIntervals", "DocStringExtensions", "HostCPUFeatures", "IfElse", "LayoutPointers", "LinearAlgebra", "OffsetArrays", "PolyesterWeave", "PrecompileTools", "SIMDTypes", "SLEEFPirates", "Static", "StaticArrayInterface", "ThreadingUtilities", "UnPack", "VectorizationBase"]
git-tree-sha1 = "e4eed22d70ac91d7a4bf9e0f6902383061d17105"
git-tree-sha1 = "24e6c5697a6c93b5e10af2acf95f0b2e15303332"
uuid = "bdcacae8-1622-11e9-2a5c-532679323890"
version = "0.12.162"
version = "0.12.163"
weakdeps = ["ChainRulesCore", "ForwardDiff", "SpecialFunctions"]

[deps.LoopVectorization.extensions]
Expand Down Expand Up @@ -761,7 +761,7 @@ version = "2.7.1"
[[deps.Pkg]]
deps = ["Artifacts", "Dates", "Downloads", "FileWatching", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"]
uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
version = "1.9.0"
version = "1.9.2"

[[deps.Polyester]]
deps = ["ArrayInterface", "BitTwiddlingConvenienceFunctions", "CPUSummary", "IfElse", "ManualMemory", "PolyesterWeave", "Requires", "Static", "StaticArrayInterface", "StrideArraysCore", "ThreadingUtilities"]
Expand Down Expand Up @@ -1071,9 +1071,9 @@ version = "0.34.0"

[[deps.StrideArraysCore]]
deps = ["ArrayInterface", "CloseOpenIntervals", "IfElse", "LayoutPointers", "ManualMemory", "SIMDTypes", "Static", "StaticArrayInterface", "ThreadingUtilities"]
git-tree-sha1 = "26316a9a43d32ecd0c5b342cb36dc86305c73e53"
git-tree-sha1 = "f02eb61eb5c97b48c153861c72fbbfdddc607e06"
uuid = "7792a7ef-975c-4747-a70f-980b88e8d1da"
version = "0.4.16"
version = "0.4.17"

[[deps.StructArrays]]
deps = ["Adapt", "DataAPI", "GPUArraysCore", "StaticArraysCore", "Tables"]
Expand Down Expand Up @@ -1159,9 +1159,9 @@ version = "0.1.7"

[[deps.TruncatedStacktraces]]
deps = ["InteractiveUtils", "MacroTools", "Preferences"]
git-tree-sha1 = "7bc1632a4eafbe9bd94cf1a784a9a4eb5e040a91"
git-tree-sha1 = "ea3e54c2bdde39062abf5a9758a23735558705e1"
uuid = "781d530d-4396-4725-bb49-402e4bee1e77"
version = "1.3.0"
version = "1.4.0"

[[deps.UUIDs]]
deps = ["Random", "SHA"]
Expand Down
51 changes: 37 additions & 14 deletions build/ribasim_cli/Manifest.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
# This file is machine-generated - editing it directly is not advised

julia_version = "1.9.1"
julia_version = "1.9.2"
manifest_format = "2.0"
project_hash = "874d2e102920149bc9576c20902e4d166b8b6cf5"
project_hash = "a0a780448d50f74ed2cc20955b7528a64b030065"

[[deps.ADTypes]]
git-tree-sha1 = "e58c18d2312749847a74f5be80bb0fa53da102bd"
uuid = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
version = "0.1.5"

[[deps.AbstractTrees]]
git-tree-sha1 = "faa260e4cb5aba097a73fab382dd4b5819d8ec8c"
uuid = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
version = "0.4.4"

[[deps.Adapt]]
deps = ["LinearAlgebra", "Requires"]
git-tree-sha1 = "76289dc51920fdc6e0013c872ba9551d54961c24"
Expand Down Expand Up @@ -157,7 +162,7 @@ weakdeps = ["Dates", "LinearAlgebra"]
[[deps.CompilerSupportLibraries_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae"
version = "1.0.2+0"
version = "1.0.5+0"

[[deps.ComponentArrays]]
deps = ["ArrayInterface", "ChainRulesCore", "ForwardDiff", "Functors", "LinearAlgebra", "Requires", "StaticArrayInterface"]
Expand Down Expand Up @@ -369,9 +374,9 @@ uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee"

[[deps.FillArrays]]
deps = ["LinearAlgebra", "Random", "SparseArrays", "Statistics"]
git-tree-sha1 = "2250347838b28a108d1967663cba57bfb3c02a58"
git-tree-sha1 = "e5556303fd8c9ad4a8fceccd406ef3433ddb4c45"
uuid = "1a297f60-69ca-5386-bcde-b61e274b549b"
version = "1.3.0"
version = "1.4.0"

[[deps.FiniteDiff]]
deps = ["ArrayInterface", "LinearAlgebra", "Requires", "Setfield", "SparseArrays"]
Expand Down Expand Up @@ -412,9 +417,9 @@ version = "0.1.3"

[[deps.Functors]]
deps = ["LinearAlgebra"]
git-tree-sha1 = "478f8c3145bb91d82c2cf20433e8c1b30df454cc"
git-tree-sha1 = "9a68d75d466ccc1218d0552a8e1631151c569545"
uuid = "d9f16b24-f501-4c13-a1f2-28368ffc5196"
version = "0.4.4"
version = "0.4.5"

[[deps.Future]]
deps = ["Random"]
Expand Down Expand Up @@ -524,6 +529,12 @@ git-tree-sha1 = "cef2dd16402718cf5f412e610813e2ec20d94a64"
uuid = "0fc2ff8b-aaa3-5acd-a817-1944a5e08891"
version = "0.8.4"

[[deps.LeftChildRightSiblingTrees]]
deps = ["AbstractTrees"]
git-tree-sha1 = "fb6803dafae4a5d62ea5cab204b1e657d9737e7f"
uuid = "1d6d02ad-be62-4b6b-8a6d-2f90e265016e"
version = "0.2.0"

[[deps.Legolas]]
deps = ["Arrow", "Tables", "UUIDs"]
git-tree-sha1 = "c73733acf06976806a5511e58bfcb86798bd3fb1"
Expand Down Expand Up @@ -609,9 +620,9 @@ version = "1.0.0"

[[deps.LoopVectorization]]
deps = ["ArrayInterface", "ArrayInterfaceCore", "CPUSummary", "CloseOpenIntervals", "DocStringExtensions", "HostCPUFeatures", "IfElse", "LayoutPointers", "LinearAlgebra", "OffsetArrays", "PolyesterWeave", "PrecompileTools", "SIMDTypes", "SLEEFPirates", "Static", "StaticArrayInterface", "ThreadingUtilities", "UnPack", "VectorizationBase"]
git-tree-sha1 = "e4eed22d70ac91d7a4bf9e0f6902383061d17105"
git-tree-sha1 = "24e6c5697a6c93b5e10af2acf95f0b2e15303332"
uuid = "bdcacae8-1622-11e9-2a5c-532679323890"
version = "0.12.162"
version = "0.12.163"
weakdeps = ["ChainRulesCore", "ForwardDiff", "SpecialFunctions"]

[deps.LoopVectorization.extensions]
Expand Down Expand Up @@ -761,7 +772,7 @@ version = "2.7.1"
[[deps.Pkg]]
deps = ["Artifacts", "Dates", "Downloads", "FileWatching", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"]
uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
version = "1.9.0"
version = "1.9.2"

[[deps.Polyester]]
deps = ["ArrayInterface", "BitTwiddlingConvenienceFunctions", "CPUSummary", "IfElse", "ManualMemory", "PolyesterWeave", "Requires", "Static", "StaticArrayInterface", "StrideArraysCore", "ThreadingUtilities"]
Expand Down Expand Up @@ -815,6 +826,12 @@ version = "1.4.0"
deps = ["Unicode"]
uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7"

[[deps.ProgressLogging]]
deps = ["Logging", "SHA", "UUIDs"]
git-tree-sha1 = "80d919dee55b9c50e8d9e2da5eeafff3fe58b539"
uuid = "33c8b6b6-d38a-422a-b730-caa89a2f386c"
version = "0.1.4"

[[deps.REPL]]
deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"]
uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
Expand Down Expand Up @@ -1071,9 +1088,9 @@ version = "0.34.0"

[[deps.StrideArraysCore]]
deps = ["ArrayInterface", "CloseOpenIntervals", "IfElse", "LayoutPointers", "ManualMemory", "SIMDTypes", "Static", "StaticArrayInterface", "ThreadingUtilities"]
git-tree-sha1 = "26316a9a43d32ecd0c5b342cb36dc86305c73e53"
git-tree-sha1 = "f02eb61eb5c97b48c153861c72fbbfdddc607e06"
uuid = "7792a7ef-975c-4747-a70f-980b88e8d1da"
version = "0.4.16"
version = "0.4.17"

[[deps.StructArrays]]
deps = ["Adapt", "DataAPI", "GPUArraysCore", "StaticArraysCore", "Tables"]
Expand Down Expand Up @@ -1118,6 +1135,12 @@ deps = ["ArgTools", "SHA"]
uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e"
version = "1.10.0"

[[deps.TerminalLoggers]]
deps = ["LeftChildRightSiblingTrees", "Logging", "Markdown", "Printf", "ProgressLogging", "UUIDs"]
git-tree-sha1 = "f133fab380933d042f6796eda4e130272ba520ca"
uuid = "5d786b92-1e48-4d6f-9151-6b4477ca9bed"
version = "0.1.7"

[[deps.Test]]
deps = ["InteractiveUtils", "Logging", "Random", "Serialization"]
uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Expand Down Expand Up @@ -1159,9 +1182,9 @@ version = "0.1.7"

[[deps.TruncatedStacktraces]]
deps = ["InteractiveUtils", "MacroTools", "Preferences"]
git-tree-sha1 = "7bc1632a4eafbe9bd94cf1a784a9a4eb5e040a91"
git-tree-sha1 = "ea3e54c2bdde39062abf5a9758a23735558705e1"
uuid = "781d530d-4396-4725-bb49-402e4bee1e77"
version = "1.3.0"
version = "1.4.0"

[[deps.UUIDs]]
deps = ["Random", "SHA"]
Expand Down
2 changes: 2 additions & 0 deletions build/ribasim_cli/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ version = "0.1.0"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
Ribasim = "aac5e3d9-0b8f-4d4f-8241-b1a7a9632635"
TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
TerminalLoggers = "5d786b92-1e48-4d6f-9151-6b4477ca9bed"

[compat]
julia = "1.9"
4 changes: 4 additions & 0 deletions build/ribasim_cli/src/ribasim_cli.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
module ribasim_cli

using Logging: global_logger
using TerminalLoggers: TerminalLogger
using Ribasim

function help(x)::Cint
Expand All @@ -26,6 +28,8 @@ function julia_main()::Cint
end

try
# show progress bar in terminal
global_logger(TerminalLogger())
Ribasim.run(arg)
catch
Base.invokelatest(Base.display_error, current_exceptions())
Expand Down

0 comments on commit 802adb1

Please sign in to comment.