pencil.sim ========== .. py:module:: pencil.sim .. autoapi-nested-parse:: Handle simulations (run directories with data) as Python objects. Submodules ---------- .. toctree:: :maxdepth: 1 /code/sourcePython/pencil/sim/get/index /code/sourcePython/pencil/sim/group/index /code/sourcePython/pencil/sim/remesh/index /code/sourcePython/pencil/sim/simulation/index /code/sourcePython/pencil/sim/simulations/index /code/sourcePython/pencil/sim/sort/index Attributes ---------- .. autoapisummary:: pencil.sim.pc_print pencil.sim.lnml Exceptions ---------- .. autoapisummary:: pencil.sim.CommandFailedError Classes ------- .. autoapisummary:: pencil.sim.PathWrapper pencil.sim.Simulation pencil.sim.Simulations Functions --------- .. autoapisummary:: pencil.sim.copy_docstring pencil.sim.simulation pencil.sim.copy_docstring pencil.sim.simulations pencil.sim.is_sim_dir pencil.sim.get pencil.sim.get_sims pencil.sim.get_cparam pencil.sim.group pencil.sim.sort pencil.sim.grad pencil.sim.open_h5 pencil.sim.group_h5 pencil.sim.dataset_h5 pencil.sim.local_remesh pencil.sim.get_dstgrid pencil.sim.src2dst_remesh Package Contents ---------------- .. py:class:: PathWrapper Bases: :py:obj:`pathlib.WindowsPath if os.name == 'nt' else pathlib.PosixPath` See documentation of pathlib.Path. This wrapper tries to avoid immediately breaking user code which assumes paths are always strings KG (2024-Oct-10): added KG (2024-Nov-09): fixed usage with Python<3.12 (see https://stackoverflow.com/a/78471242 ) Construct a PurePath from one or several strings and or existing PurePath objects. The strings and path objects are combined so as to yield a canonicalized path, which is incorporated into the new PurePath object. .. py:data:: pc_print .. py:function:: copy_docstring(original) Decorator, to be used for wrapper functions, that makes the docstring of a particular function the same as another function. Rationale: if you consider pc.read.aver and pc.read.averages.Averages.read, both the docstrings are currently independently defined, but the former is simply a wrapper for the other. When new functionality is added to the latter, the docstring for the former is almost never updated, leading to the users being shown outdated help text. Copied from https://softwareengineering.stackexchange.com/a/386758 NOTE: since sphinx-autoapi (used to generated the readthedocs pages) does not know about this decorator, it is best to manually add a minimal docstring of the form """ Wrapper for :py:meth:`Averages.read` """ to the wrapper function; this will allow Sphinx to create a link to the original function. .. py:exception:: CommandFailedError Bases: :py:obj:`RuntimeError` Unspecified run-time error. Initialize self. See help(type(self)) for accurate signature. .. py:class:: Simulation(path='.', hidden=False, hard=False, quiet=False) Simulation objects are containers for simulations. Pencil can work with several of them at once if stored in a simulations object. :param path: Path to simulation, default = '.'. :type path: string :param hidden: Set True to set hidden flag, default is False. :type hidden: bool :param quiet: Suppress irrelevant output, default is False. :type quiet: bool :param hard: Force update, default is False :type hard: bool :param Properties: :param ----------: :param self.name: :type self.name: name of :param self.path: :type self.path: path to simulation :param self.datadir: :type self.datadir: path to simulation data-dir (./data/) :param self.pc_dir: :type self.pc_dir: path to simulation pc-dir (./pc/) :param self.pc_datadir: :type self.pc_datadir: path to simulation pendir in datadir (data/pc/) :param self.components: the simulation :type self.components: list of files which are necessary components of :param self.optionals: the simulation :type self.optionals: list of files which are optional components of :param self.start_components: :type self.start_components: list of files provided at the simulation start :param self.start_optionals: :type self.start_optionals: list of optional files after the simulation start :param self.hidden: be ignored by pencil :type self.hidden: Default is False, if True this simulation will :param self.param: :type self.param: list of param file :param self.grid: :type self.grid: grid object :param self.index index object: :param self.dim: :type self.dim: dim object :param self.tmp_dict: :type self.tmp_dict: temporal dictionary of stuff, will not be saved .. py:attribute:: path .. py:attribute:: name :value: '' .. py:attribute:: datadir .. py:attribute:: pc_dir .. py:attribute:: pc_datadir .. py:attribute:: components :value: ['src/cparam.local', 'src/Makefile.local', 'start.in', 'run.in', 'print.in'] .. py:attribute:: quantity_searchables :value: ['src/cparam.local', 'start.in', 'run.in'] .. py:attribute:: optionals :value: ['*.in', '*.py', 'submit*'] .. py:attribute:: start_components :value: ['index.pro', 'param.nml', 'pencils.list'] .. py:attribute:: start_optionals :value: ['time_series.dat', '*.pro', '*.h5'] .. py:attribute:: hidden :value: False .. py:attribute:: param :value: False .. py:attribute:: grid :value: False .. py:attribute:: index :value: False .. py:attribute:: dim :value: False .. py:attribute:: ghost_grid :value: False .. py:attribute:: tmp_dict .. py:method:: copy(path_root='.', name=False, start_optionals=True, optionals=True, quiet=True, rename_submit_script=False, OVERWRITE=False, lfs=False, MB=1, count=1) This method does a copy of the simulation object by creating a new directory 'name' in 'path_root' and copy all simulation components and optiona) ls to its directory. This method neither links/compiles the simulation. If start_optionals it creates data dir. It does not overwrite anything, unless OVERWRITE is True. Submit Script Rename: Name in submit scripts will be renamed if possible! Submit scripts will be identified by submit* plus appearenace of old simulation name inside, latter will be renamed! :param path_root: Path to new sim.-folder(sim.-name). This folder will be created if not existing! Relative paths are thought to be relative to the python current workdir :type path_root: string :param name: Name of new simulation, will be used as folder name. Rename will also happen in submit script if found. Simulation folders is not allowed to preexist! :type name: string :param optionals: Add list of further files to be copied. Wildcasts allowed according to glob module! Set True to use self.optionals. :type optionals: bool :param start optionals: Add list of further files to be copied. Wildcasts allowed according to glob module! Set True to use self.optionals. :param quiet: Set True to suppress output. :type quiet: bool :param rename_submit_script: Set False if no renames shall be performed in submit* files :type rename_submit_script: bool :param OVERWRITE: Set True to overwrite no matter what happens! :type OVERWRITE: bool .. py:method:: resume_from_var(sim_source, varno, DEBUG=False) Copies everything to resume a run from an older state. It uses VAR-file number >varno< as new VAR0 and var.dat. Does copy PVAR as well if available. :param sim_source: Simulation from where to copy all the files. :type sim_source: string :param varno: var-file number # from which to copy (VAR#). :type varno: int .. py:method:: update(hard=False, quiet=True) Update simulation object: if not read in: - read param.nml - read grid and ghost grid Set hard=True to force update. .. py:method:: hide() Set hide flag True for this simulation. .. py:method:: unhide() Set hide flag False for this simulation. .. py:method:: export() Export simulation object to its root/.pc-dir .. py:method:: started() Returns whether simulation has already started. This is indicated by existing time_series.dat in data directory. .. py:method:: compile(cleanall=False, fast=False, verbose=False, hostfile=None, autoclean=True, previous_flags=False, additional_options='', **kwargs) Compiles the simulation. Per default the linking is done before the compiling process is called. This method will use your settings as defined in your .bashrc-file. :param cleanall: Before calling pc_build, pc_build --cleanall is called. :type cleanall: bool :param verbose: Activate for verbosity. :type verbose: bool :param fast: Set True for fast compilation. :type fast: bool :param autoclean: If compilation fails, automatically set cleanall=True and retry. :type autoclean: bool :param previous_flags: If True, use the same flags as the last time pc_build was called. :type previous_flags: bool :param additional_options: Addition options to be passed to pc_build. :type additional_options: str :param Accepts all other keywords accepted by self.bash: .. py:method:: build(**kwargs) Same as compile() .. py:method:: bash(command, verbose='last100', logfile=False, bashrc=True, raise_errors=False) Executes command in simulation directory. This method will use your settings as defined in your .bashrc-file. A log file will be produced within 'self.path/pc'-folder :param command: Command to be executed, can be a list of commands. :type command: string :param verbose: lastN = show last N lines of output afterwards False = no output True = all output :type verbose: bool :param bashrc: True: source bashrc in the subprocess False: don't source bashrc in the subprocess. Instead, only pass along the environment variables from the current session. :type bashrc: bool :param raise_errors: If True, a nonzero return code for command will be raised as a Python error. :type raise_errors: bool .. py:method:: cleanall(verbose=False, hostfile=None, **kwargs) Runs `pc_build --cleanall` in the simulation directory :param verbose: Activate for verbosity. :type verbose: bool :param Accepts all other keywords accepted by self.bash: .. py:method:: clear_src(do_it=False, do_it_really=False) This method clears the src directory of the simulation! All files in src get deleted, except of whats in components and optionals! By default, everything except Makefile.local and cparam.local gets erased! :param to activate pass True: :param True: .. py:method:: clear_data(do_it=False, do_it_really=False) This method clears the data directory of the simulation! All files in data get deleted! :param to activate pass True: :param True: .. py:method:: remove(do_it=False, do_it_really=False, remove_data=False) This method removes the WHOLE simulation, but NOT the DATA directory per default. Do remove_data=True to delete data dir as well. :param to activate pass True: :param True: :param remove_data: also clear data directory .. py:method:: get_T_last() Returns ts.t[-1] WITHOUTH reading the whole time series! .. py:method:: get_extent(dimensions='xy') Returns extent as [xmin, xmax, ymin, ymax], as needed by e.g. imshow. :param dimensions: specify here if you want x, y or z dimensions. .. py:method:: get_varlist(pos=False, particle=False, down=False) Get a list of all existing VAR# file names. pos = False: give full list pos = 'last'/'first': give latest/first var file pos = 'lastXXX' / 'firstXXX' give last/first XXX varfiles pos = list of numbers: give varfiles at this positions particle = True: return PVAR- instead of VAR-list down = True: return list of downsampled snapshots .. py:method:: get_var_time(var_file) Read varN.list to find the time corresponding to a varfile :param var_file: string or list of strings :returns: float or list of floats depending on the type of var_file .. py:method:: get_pvarlist(pos=False) Same as get_varfiles(pos, particles=True). .. py:method:: get_lastvarfilename(particle=False, id=False) Returns las varfile name as string. .. py:method:: get_value(quantity, DEBUG=False) Optimized version of get_value_from_file. Just state quantity for simulation and param-list together with searchable components will be searched. .. py:method:: get_ts(**kwargs) Returns time series object. All kwargs are passed to `pencil.read.ts`. .. py:method:: change_value_in_file(*args, **kwargs) Same as pencil.io.change_value_in_file. .. py:method:: run(verbose=False, hostfile=None, cleardata=False, **kwargs) Runs the simulation. :param verbose: Whether to print progress and detailed output :type verbose: bool :param hostfile: Pencil config file to use :type hostfile: string :param cleardata: Whether to clear existing data :type cleardata: bool :param Accepts all other keywords accepted by self.bash: .. py:function:: simulation(*args, **kwargs) Wrapper for :py:class:`Simulation` .. py:function:: copy_docstring(original) Decorator, to be used for wrapper functions, that makes the docstring of a particular function the same as another function. Rationale: if you consider pc.read.aver and pc.read.averages.Averages.read, both the docstrings are currently independently defined, but the former is simply a wrapper for the other. When new functionality is added to the latter, the docstring for the former is almost never updated, leading to the users being shown outdated help text. Copied from https://softwareengineering.stackexchange.com/a/386758 NOTE: since sphinx-autoapi (used to generated the readthedocs pages) does not know about this decorator, it is best to manually add a minimal docstring of the form """ Wrapper for :py:meth:`Averages.read` """ to the wrapper function; this will allow Sphinx to create a link to the original function. .. py:class:: Simulations(*args, **kwargs) A container for multiple `Simulation` objects. Ways to use the constructor: - no args: create empty object, simulation objects can be added with add() - list, tuple: provide a list of simulation objects or paths or names if one of the latter is provide, pc.get_sim() is used to generate simulation object from path or name Any keyword arguments are used to populate attributes the resulting object. E.g. `sims = Simulations(path1, path2, my_property="something")` will result in `sims.my_property == "something"`. Properties: self.sims: direct access on simulations list .. method:: self.add add a simulation object, provide simulation object or name or path (pc.get_sim() is then used) .. method:: self.sort sort self.sims list by, default by name, but also different sorting algorithm are provided .. py:attribute:: sims :value: [] .. py:method:: add(*args) Add simulation(s) to simulations object. Valid arguments can be any of the following: - path to a simulation (pathlib.Path or str) - simulation object - list of simulation objects - iterable of simulation objects - simulations object .. py:method:: filter(function) Return a copy of self that contains only those simulations for which function(sim) is True. E.g. >>> sims_magnetic = sims.filter(lambda sim: sim.param['lmagnetic']) >>> sims_hydro = sims.filter(lambda sim: not sim.param['lmagnetic']) .. py:method:: sort(key=None) Default: sort by name .. py:method:: sim_from_simdir(simdir) .. py:function:: simulations(*args, **kwargs) Wrapper for :py:class:`Simulations` .. py:function:: is_sim_dir(path='.') Decide if a path is pointing at a pencil code simulation directory. The heuristics used is to check for the existence of start.in, run.in, src/ cparam.local and src/Makefile.local . .. py:function:: get(path='.', quiet=False) get(path=".", quiet=False) Return simulation object from 'path, if already existing, or creates new simulation object from path, if its as simulation. :param path: Base directory where to look for simulation from. :type path: string :param quiet: Switches out the output of the function. Default: False. :type quiet: bool .. py:function:: get_sims(path_root='.', depth=0, unhide_all=True, quiet=False) get_sims(path_root=".", depth=0, unhide_all=True, quiet=False) Returns all found simulations as object list from all subdirs, not following symbolic links. :param path_root: Base directory where to look for simulation from. :type path_root: string :param depth: depth of searching for simulations, default is 1, i.e. only one level deeper directories will be scanned. :type depth: int :param unhide_all: Unhides all simulation found if True, if False (default) hidden sim will stay hidden. :type unhide_all: bool :param quiet: Switches out the output of the function. Default: False. :type quiet: bool .. py:function:: get_cparam(filepath) Read contents of src/cparam.local into a dictionary filepath : string path to cparam.local file relative or absolute .. py:function:: group(simulations, groupby, sort=True, only_started=False, reverse=False) group(simulations, groupby, sort=True, only_started=False, reverse=False) Group simulation by a quantity. Each Simulation object can only be part of one group. :param simulations: Put here a Simulations object or a list of simulations [sim1, sim2, ...]. :type simulations: list of sim objects :param groupby: Put here the heyword after which the grouping shall happen. :type groupby: string :param sort: Set True to sort returned dictionary naturally. :type sort: bool :param only_started: Only group simulations that already has started. :type only_started: bool :param reverse: Flag for reverse grouping. :type reverse: bool :rtype: Dictionary with keywords are the group entries and values are lists of simulations in that group. .. py:function:: sort(simulations, sortby, only_started=False, reverse=False) Sort simulations by a quantity. Based on group.py :param simulations: Put here a Simulations object or a list of simulations [sim1, sim2, ...]. :type simulations: list :param sortby: Put here the heyword after which the sorting shall happen. :type sortby: string :param only_started: Only sort simulations that already has started. :type only_started: bool :param reverse: Reverse order. :type reverse: bool :rtype: List with simulation objects in their sorted order. .. py:function:: grad(f, dx=None, dy=None, dz=None, x=None, y=None, coordinate_system='cartesian', grid=None) grad(f, dx=None, dy=None, dz=None, x=None, y=None, coordinate_system="cartesian", grid=None) Take the gradient of a pencil code scalar array f in various coordinate systems. :param f: Pencil code scalar array f. :type f: ndarray :param grid: Pencil grid object. See pc.read.grid(). :type grid: pencil.read.grids.Grid :param coordinate_system: Coordinate system under which to take the divergence. Takes 'cartesian', 'cylindrical' and 'spherical'. :type coordinate_system: string :param Deprecated parameters (only for backwards compatibility): :param --------------------------------------------------------: :param dx: Grid spacing in the three dimensions. These will not have any effect if grid!=None :type dx: floats :param dy: Grid spacing in the three dimensions. These will not have any effect if grid!=None :type dy: floats :param dz: Grid spacing in the three dimensions. These will not have any effect if grid!=None :type dz: floats :param x: Radial (x) and polar (y) coordinates, 1d arrays. These will not have any effect if grid!=None :type x: ndarrays :param y: Radial (x) and polar (y) coordinates, 1d arrays. These will not have any effect if grid!=None :type y: ndarrays .. py:function:: open_h5(filename, status, driver=None, comm=None, overwrite=False, size=1, rank=0, lfs=False, MB=1, count=1) This function opens hdf5 file in serial or parallel. :keyword filename: relative or absolute path string for name of hdf5 file. :keyword status: open state of file 'w': write, 'r': read or 'a'/'r+': append. :keyword driver: 'mpio' required for parallel: version but absent for serial. :keyword comm: only present for parallel version of h5py. :keyword overwrite: flag to replace existing file. :keyword rank: processor rank with root = 0. .. py:function:: group_h5(h5obj, groupname, status='r', delete=False, overwrite=False, rank=0, size=1, comm=None) This function adds/removes hdf5 group objects. :keyword h5obj: h5 object, may be the file or a sub group within the file :keyword groupname: string for name of the group. :keyword status: open state of file 'w': write, 'r': read or 'a'/'r+': append. :keyword delete: flag to remove existing group from h5 object. :keyword overwrite: flag to replace existing group from h5 object. :keyword rank: processor rank with root = 0. :keyword comm: only present for parallel version of h5py. .. py:function:: dataset_h5(h5obj, dataname, status='r', data=None, shape=None, dtype=None, overwrite=False, delete=False, rank=0, size=1, comm=None) This function adds/removes hdf5 dataset objects. :keyword h5obj: h5 object, may be the file or a sub group within the file :keyword dataname: string for name of the dataset. :keyword status: open state of file 'w': write, 'r': read or 'a'/'r+': append. :keyword data: h5 compatible data object; float, integer, string, array :keyword shape: data shape tuple of length > 0 :keyword dtype: h5 compatible data type, eg. np.float64 :keyword delete: flag to remove existing group from h5 object. :keyword overwrite: flag to replace existing group from h5 object. :keyword rank: processor rank with root = 0. :keyword comm: only present for parallel version of h5py. .. py:data:: lnml :value: True .. py:function:: local_remesh(var, xsrc, ysrc, zsrc, xdst, ydst, zdst, quiet=True, kind='linear') local_remesh(var, xsrc, ysrc, zsrc, xdst, ydst, zdst, quiet=True, kind="linear") :param var: Snapshot scalar numpy array of shape [mz, my, mx]. :type var: np.array :param xsrc: Grid x, y, z arrays from source simulation. :type xsrc: ndarrays :param ysrc: Grid x, y, z arrays from source simulation. :type ysrc: ndarrays :param zsrc: Grid x, y, z arrays from source simulation. :type zsrc: ndarrays :param xdst: Grid x, y, z arrays for destination simulation. :type xdst: ndarrays :param ydst: Grid x, y, z arrays for destination simulation. :type ydst: ndarrays :param zdst: Grid x, y, z arrays for destination simulation. :type zdst: ndarrays :param kind: interpolation method :type kind: string :param quiet: Flag for switching of output. :type quiet: bool :param Useage: grid of alternate shape :type Useage: interpolate a 3D data array of arbitrary shape onto an equivalent .. py:function:: get_dstgrid(srch5, srcsim, dsth5, dstsim, ncpus=[1, 1, 1], nxyz=None, multxyz=[2, 2, 2], fracxyz=[1, 1, 1], srcghost=3, dstghost=3, dtype=np.float64, lsymmetric=True, quiet=True, dstprecision=[b'D'], srcchunks=None) get_dstgrid(srch5, srcsim, dsth5, dstsim, ncpus=[1,1,1], multxyz=[2,2,2], nxyz=None, fracxyz=[1,1,1], srcghost=3, dstghost=3, dtype=np.float64, lsymmetric=True, quiet=True, dstprecision=[b"D"], srchunks=srchunks) :param srch5: hdf5 object from source simulation. :type srch5: obj :param srcsim: src simulation object :type srcsim: simulation object :param dsth5: hdf5 object for destination simulation data. :type dsth5: obj :param dstsim: dst simulation object :type dstsim: simulation object :param ncpus: Array of nprocx, nprocy, and nprocz to apply for new simulation. :type ncpus: int :param nxyz: integer list of lenght 3 with new size of grid excluding ghosts. :type nxyz: bool :param multxyz: Factors by which to multiply old sim dimensions yxz order. :type multxyz: list :param fracxyz: Factors by which to divide old sim dimensions yxz order. :type fracxyz: list :param srcghost: Number of ghost zones from the source order of accuracy (mx-nx)/2 :type srcghost: int :param dstghost: Number of ghost zones for the destination order of accuracy (mx-nx)/2 :type dstghost: int :param dtype: Precision used in destination simulation. Default double. :type dtype: 'string' :param lsymmetric: Option to make non-periodic grid symmetric about old sim centre. Otherwise the lower boundary is retained from old sim grid. :type lsymmetric: bool :param quiet: Flag for switching of output. :type quiet: bool :param dstprecision: floating point precision of new simulation grid. :param srcchunks: list of index limits [l[0]:l[1],m[0]:m[1],n[0]:n[1]] for subdomain remesh :type srcchunks: bool .. py:function:: src2dst_remesh(src=None, dst=None, h5in='var.h5', h5out='var.h5', nxyz=None, multxyz=[2, 2, 2], fracxyz=[1, 1, 1], srcchunks=None, srcghost=3, dstghost=3, srcdatadir='data/allprocs', dstdatadir='data/allprocs', dstprecision=[b'D'], lsymmetric=True, quiet=True, kind='linear', check_grid=True, optionals=True, nmin=32, rename_submit_script=False, MBmin=64.0, ncpus=[1, 1, 1], start_optionals=False, hostfile=None, submit_new=False, chunksize=5000.0, lfs=False, MB=32, count=1, size=1, rank=0, comm=None, farray=None, index_farray=None, datasets='all', remesh=True, newtime=None) src2dst_remesh(src=None, dst=None, h5in='var.h5', h5out='var.h5', nxyz=None, multxyz=[2, 2, 2], fracxyz=[1, 1, 1], srcchunks=None, srcghost=3, dstghost=3, srcdatadir='data/allprocs', dstdatadir='data/allprocs', dstprecision=[b'D'], lsymmetric=True, quiet=True, kind="linear", check_grid=True, OVERWRITE=False, optionals=True, nmin=32, rename_submit_script=False, MBmin=5.0, ncpus=[1, 1, 1], start_optionals=False, hostfile=None, submit_new=False, chunksize=1000.0, lfs=False, MB=1, count=1, size=1, rank=0, comm=None, farray=None, index_farray=None, datasets='all', remesh=True) :param src: Source relative or absolute path to source simulation. :type src: string :param dst: Destination relative or absolute path to destination simulation. :type dst: string :param h5in: Source simulation data file to be copied and remeshed. :type h5in: string :param h5out: Destination simulation file to be written. :type h5out: string :param nxyz: If not None a list of 3 integers [nx, ny, nz] defining the size of the destination domain :type nxyz: list :param multxyz: Factors by which to multiply old sim dimensions xyz order. :type multxyz: list :param fracxyz: Factors by which to divide old sim dimensions xyz order. :type fracxyz: list :param srcghost: Number of ghost zones from the source order of accuracy (mx-nx)/2. :type srcghost: int :param dstghost: Number of ghost zones for the destination order of accuracy (mx-nx)/2. :type dstghost: int :param srcdatadir: Path from source simulation directory to data. :type srcdatadir: string :param dstdatadir: Path from destination simulation directory to data. :param dstprecision: Floating point precision settings [b'S'] or [b'D']. :type dstprecision: string :param lsymmetric: Option to make non-periodic grid symmetric about old sim centre. Otherwise the lower boundary is retained from old sim grid. :type lsymmetric: bool :param quiet: Flag for switching of output. :type quiet: bool :param check_grid: Flag to run check on grid and cpu layout before executing remesh. :type check_grid: bool :param OVERWRITE: Flag to overwrite existing simulation directory and filesin dst. :type OVERWRITE: bool :param optionals: Copy simulation files with True or specify list of names (string) for additional files from src sim directory. :type optionals: bool :param nmin: Minimum length along coordinate after splitting by proc. :type nmin: int :param rename_submit_script: Edit lines in submission files vcopied from src to dst. Not yet operational. :type rename_submit_script: bool :param MBmin: Minimum size in MB of data on a sinlge proc pf ncpus total processes. :type MBmin: float :param ncpus: Array of nprocx, nprocy, and nprocz to apply for new simulation. :type ncpus: ndarray :param start_optionals: Copy simulation files output by start.x with True or specify list of names (string) for additional files from src sim data directory. :type start_optionals: bool :param hostfile: Specify name of host config file argument in pc_build. Not yet operational. :type hostfile: string :param submit_new: Execute changes to submission files, compile and run simulation. Not yet operational. :type submit_new: bool :param chunksize: Size in megabytes of snapshot variable before chunked remesh is used. :type chunksize: float :param lfs: Flag to set the striping for large file sizes to improve IO efficiency. :type lfs: bool :param MB: Size of data to write contiguously before moving to new OST on lustre. :type MB: float :param count: Number of OSTs across which the data will be shared for IO operations. :type count: int :param size: Number of MPI processes :type size: int :param rank: ID of processor :type rank: int :param comm: MPI library calls :param farray: Select subset of the farray from src. :type farray: string list :param index_farray: set of index at which interpolation shall start :type index_farray: integer list :param datasets: "all" default to interpolate full farray, or specify selection :type datasets: string :param remesh: remesh or just copy :type remesh: bool