I have a simulation model in Julia that has the following workflow
using SimModel
addprocs(SlurmManager(512))
@everywhere using SimModel
run_simulation(params) # function uses pmap to launch work() over 500 processors
Something important to note is that the statement @everywhere using SimModel
takes about 7 minutes to run. The actual run_simulation
is about 20 seconds.
What I would like to do is have a web facing interface for my model. I am mostly experienced with RShiny, so that’s what I am considering but alternatives are welcome.
My idea is to have a user select the parameters using RShiny app, which gets saved as a JSON file, and when user clicks “run”, the julia script executes, reads the JSON file for its parameters, and executes the model. Something like julia myscript.jl
where myscript.jl
would run those commands above.
The problem here is obvious, which is that running julia myscript.jl
will take about 7 minutes to set up the parallel workers as well compile all the functions over and over again.
Ideally what I would like to do have a Julia instance running where I’ve already allocated the nodes (i.e. addprocs
and the script is basically just “waiting” for input. As soon as user submits their parameters using RShiny, all i have to do is run run_simulation(params)
.
Any one have an idea on how this can be accomplished?