-
I am interested in running a large number of time-domain simulations for reliability analysis and want to speed this up with parallization. Have you tried to run dynamic simulations in parallel? Do you have any examples or ongoing development on this topic? I tried doing this with a multi-thread for-loop, but I don't get it to work. Great work with these power system Julia packages, they seem really nice and useful! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hi @espenfb This is something that we have not tried yet. It is something that is eventually on the pipeline to provide some level of support for this, but with the missing features that we are working on for version 0.9 and 1.0, there is still plenty of work on us to cover before tackling this. If you manage to get some level of success, please keep updating this thread since it will probably be useful once we attempt on tackling parallelization. |
Beta Was this translation helpful? Give feedback.
-
@espenfb a prototype of what you want to achieve would look like this (I haven't tested the code, this is just a barebones for explanation. addprocs()
@everywhere using PowerSimulationsDynamics
@everywhere using Sundials
function run_simulation(fault_line::String, output_folder)
perturbation_trip = BranchTrip(1.0, Line, fault_line)
sim_folder = joinpath(output_folder, fault_line)
sim = Simulation(ResidualModel, SYSTEM, sim_folder, tspan, perturbation_trip)
status = execute!(sim, IDA(), dtmax = 0.02, enable_progress_bar = false)
if status == SIMULATION_FINALIZED
results = read_results(sim)
CUSTOM_FUNCTION_TO_GRAB_RESULTS_AND_SAVE()
end
return status
end
faults = Vector{String}[....HERE ALL THE LINE NAMES....]
pmap(run_simulation, faults; on_error=ex->SIMULATION_FAILED) Take a look at the documentation of pmap before trying and be careful with memory usage https://docs.julialang.org/en/v1/stdlib/Distributed/#Distributed.pmap |
Beta Was this translation helpful? Give feedback.
@espenfb a prototype of what you want to achieve would look like this (I haven't tested the code, this is just a barebones for explanation.