Deletion
Deleting simulations and resetting the project database.
deleteCalibration removes a calibration run and is documented on the Calibration page, alongside the rest of that subsystem.
ModelManager.deleteAllSimulations — Method
deleteAllSimulations(; kwargs...)Delete all simulations. See deleteSimulations for keyword arguments.
ModelManager.deleteMonad — Method
deleteMonad(monad_ids; delete_subs, delete_supers)Delete monads by ID, optionally cascading to their simulations and to empty samplings/trials above them.
ModelManager.deleteSampling — Method
deleteSampling(sampling_ids; delete_subs, delete_supers)Delete samplings by ID, optionally cascading.
ModelManager.deleteSimulation — Function
deleteSimulation(args...; kwargs...)Alias for deleteSimulations.
ModelManager.deleteSimulations — Method
deleteSimulations(simulation_ids; delete_supers, filters)
deleteSimulation(args...; kwargs...)Delete simulations from the database and from disk.
Also removes each deleted simulation's row (if any) from the post-processing sink (data/outputs/postprocessing.db), keeping it consistent with the central database.
If delete_supers is true (default), also removes any monads/samplings/trials that become empty after the deletion. filters adds extra SQL WHERE conditions.
Examples
deleteSimulations(1:3)
deleteSimulations(4)
deleteSimulations(1:100; filters=Dict("config_id" => 1))ModelManager.deleteSimulationsByStatus — Function
deleteSimulationsByStatus(status_codes_to_delete::Vector{String}=["Failed"]; user_check::Bool=true)
deleteSimulationsByStatus(status_code_to_delete::String; user_check::Bool=true)Delete simulations filtered by status code.
ModelManager.deleteTrial — Method
deleteTrial(trial_ids; delete_subs)Delete trials by ID, optionally cascading to their samplings.
ModelManager.resetDatabase — Method
resetDatabase(; force_reset, force_continue)Reset the database after user confirmation: delete all output folders, remove the post-processing sink (data/outputs/postprocessing.db), clear all variation files, call clearSimulatorArtifacts on the active simulator, then reinitialize the database.
On a shared filesystem some of what this removes may be staged in data/.trash/ rather than deleted — see rm_hpc_safe. That space is not reclaimed until the files are released and a later session retries them.
ModelManager.resetFolder — Method
resetFolder(location::Symbol, folder::String)Remove the variations DB and variations folder from folder in location.
ModelManager.rm_hpc_safe — Method
rm_hpc_safe(path::String; force, recursive)Remove path, tolerating shared cluster filesystems that refuse to release files.
Off HPC — anywhere sbatch is absent, unless useHPC says otherwise — this is exactly rm(path; force, recursive), exceptions included.
On HPC that same rm is attempted first, since removing is the only thing that actually frees disk space. A network filesystem routinely refuses to remove a directory that a process on another node still holds open, and rm throws. Whatever survives is then moved into data/.trash/data-YYMMDD/, mirroring its position under data/, which succeeds where removal does not because a rename never releases the file. A path outside data/ is staged under _external/.
Returns:
:removed—rmsucceeded.:staged— the residue was moved intodata/.trash/. Nothing staged there has had its space reclaimed, and the first time it happens in a project a warning says so and names the directory.initializeModelManagerwill retry the removal in the background at the start of every later session, so staged paths clear themselves once the jobs holding them exit.:unremoved— neither worked.pathis left where it is and a warning names it.
In HPC mode a filesystem failure does not throw: every caller deletes the corresponding database rows before calling this, and most call it inside a loop over many simulations, so an exception here would abandon a bulk deletion with the rows already gone. Check the return value where a removal must be guaranteed — resetDatabase does, for the central database file. A missing path with force=false still throws, exactly as rm does.
Examples
rm_hpc_safe(joinpath(dataDir(), "outputs", "simulations", "7"); force=true, recursive=true)
if rm_hpc_safe(path_to_file; force=true) === :staged
@info "still on disk under $(joinpath(dataDir(), ".trash"))"
end