pencil.pipelines.clonesimulations
Functions
|
clone_sims(simset, simsdir=None) |
|
clone_sims_from_obj(simset, simsdir="..", template_sim=None, specify_nml=True): |
Module Contents
- pencil.pipelines.clonesimulations.clone_sims(simset, simsdir=None)
clone_sims(simset, simsdir=None)
Create a set of simulation directories from a dictionary object, simset, which contains the list of parameters to combine across set of clones.
- Parameters:
simset (dictionary) – Parameters to combine across set of clones.
simsdir (string) – Root directory for collection of clone simulations.
- Returns:
Set of uncompiled and unexecuted simulation run directories with
parameters updated.
Notes
It is assumed that the user is working in the compiled source directory.
Examples
>>> simsdir = '/path/to/set_of_clones' >>> params = pencil.pipelines.parameter_table('example_filename.txt') >>> params = user_own_trim_table(params)#See pc.pipelines.trim_table >>> simset = pencil.pipelines.make_sims_dict(params) >>> clone_sims(simset,simsdir=simsdir)
- pencil.pipelines.clonesimulations.clone_sims_from_obj(simset, simsdir='..', template_sim=None, specify_nml=True)
clone_sims_from_obj(simset, simsdir=”..”, template_sim=None, specify_nml=True):
Create a set of simulation directories from a dictionary object, simset, which contains the list of parameters to combine across set of clones. This differs from the clone_sims function in that it is more configurable, and uses the native Python way of copying the sim.
- Parameters:
simset (dictionary) – Parameters to combine across set of clones.
simsdir (string) – Root directory for collection of clone simulations.
template_sim (obj) – A pencil simulation object (returned by pc.get_sim). If not specified, the simulation in the current directory will be used.
specify_nml (bool) – Whether, for files like run.in, you also specify the namelist in simset. If so, f90nml will be directly used to write the value. If not, the change_value_in_file function will be used even for these files.
- Returns:
Set of unexecuted simulation run directories with
parameters updated.
Example
>>> template_sim = pc.get_sim("simulation_to_clone") >>> template_sim.optionals.append("job.pbs") #A job submission script which ... #one wants to copy along with the other simulation files. >>> params = pc.pipelines.parameter_table("example_filename.txt") >>> simset = pc.pipelines.make_sims_dict(params) >>> pc.pipelines.clone_sims_from_obj(simset, template_sim=template_sim, simsdir=".")