From 44df3e7f957682d10a2b928181321babc018776f Mon Sep 17 00:00:00 2001 From: pertft Date: Wed, 17 Sep 2025 14:35:59 +0200 Subject: [PATCH 1/2] adding runtime load for ifm --- src/JulES.jl | 15 ++++++++------- src/run_jules_wrapper.jl | 16 ++++++++++++++-- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/src/JulES.jl b/src/JulES.jl index a761ce2..7b41518 100644 --- a/src/JulES.jl +++ b/src/JulES.jl @@ -13,13 +13,14 @@ using YAML using HDF5 # Used by ifm -using CSV -using Random -using OrdinaryDiffEq -using Lux -using ComponentArrays -using Interpolations -using JLD2 +#using CSV +#using Random +#using OrdinaryDiffEq +#using Lux +#using ComponentArrays +#using Interpolations +#using JLD2 + # Used by Nerual inflow model but not HBV # using DiffEqFlux # using SciMLSensitivity diff --git a/src/run_jules_wrapper.jl b/src/run_jules_wrapper.jl index 448102d..9ea1b3a 100644 --- a/src/run_jules_wrapper.jl +++ b/src/run_jules_wrapper.jl @@ -39,6 +39,16 @@ function getdataset(config, names, filename_clearing, filename_aggregated) ) end +function load_ifm_dep() + @eval using CSV + @eval using Random + @eval using OrdinaryDiffEq + @eval using Lux + @eval using ComponentArrays + @eval using Interpolations + @eval using JLD2 +end + function run_jules( config_path, datayear, @@ -59,8 +69,10 @@ function run_jules( ) input = JulES.DefaultJulESInput(config, dataset, datayear, weatheryear) - - @time data = JulES.run_serial(input) + + has_ifm_results(input) && load_ifm_dep() + + @time data = JulES.run_serial(input) println("Total serial time above") println("Save output") From d617276903edd6aaf4412266e1c4698b6bd9981d Mon Sep 17 00:00:00 2001 From: pertft Date: Fri, 19 Sep 2025 10:41:43 +0200 Subject: [PATCH 2/2] using everywhere for ifm packages to be on all procs --- src/run_jules_wrapper.jl | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/run_jules_wrapper.jl b/src/run_jules_wrapper.jl index 9ea1b3a..256b8d1 100644 --- a/src/run_jules_wrapper.jl +++ b/src/run_jules_wrapper.jl @@ -40,13 +40,16 @@ function getdataset(config, names, filename_clearing, filename_aggregated) end function load_ifm_dep() - @eval using CSV - @eval using Random - @eval using OrdinaryDiffEq - @eval using Lux - @eval using ComponentArrays - @eval using Interpolations - @eval using JLD2 + mod = @__MODULE__ + @everywhere begin + @eval $mod using CSV + @eval $mod using Random + @eval $mod using OrdinaryDiffEq + @eval $mod using Lux + @eval $mod using ComponentArrays + @eval $mod using Interpolations + @eval $mod using JLD2 + end end function run_jules( @@ -70,7 +73,7 @@ function run_jules( input = JulES.DefaultJulESInput(config, dataset, datayear, weatheryear) - has_ifm_results(input) && load_ifm_dep() + has_ifm_results(input) && load_ifm_dep() @time data = JulES.run_serial(input) println("Total serial time above")