meta-workflow Package

This peckage contains implementation of meta workflows - i.e. workflows involving executation of multiple simulations runs. Currently parameter search is implemented.

meta_workflow.parameter_search Module

class mozaik.meta_workflow.parameter_search.ParameterSearchBackend

Bases: object

This is the parameter search backend interface. The :func:.`execute_job` implements the execution of the job, using the information given to the constructor, and the dictionary of modified parameters given in its arguments.

execute_job(run_script, simulator_name, parameters_url, parameters, simulation_run_name)

This function recevies the list of parameters to modify and their values, and has to execute the corresponding mozaik simulation.

Parameters :

parameters : dict

The dictionary holding the names of parameters to be modified as keys, and the values to set them to as the corresponding values.

class mozaik.meta_workflow.parameter_search.LocalSequentialBackend

Bases: object

This is the simplest backend that simply executes the simulation on the present machine sequentially (i.e. it waits for the simulation to end before starting new one).

execute_job(run_script, simulator_name, parameters_url, parameters, simulation_run_name)

This function recevies the list of parameters to modify and their values, and has to execute the corresponding mozaik simulation.

Parameters :

parameters : dict

The dictionary holding the names of parameters to be modified as keys, and the values to set them to as the corresponding values.

class mozaik.meta_workflow.parameter_search.SlurmSequentialBackend(num_threads, num_mpi, slurm_options=None)

Bases: object

This is a back end that runs each simulation run as a slurm job.

Parameters :

num_threads : int

Number of threads per mpi process.

num_mpi : int

Number of mpi processes to spawn per job.

slurm_options : list(string), optional

List of strings that will be passed to slurm sbatch command as options.

Note: :

—– :

The most common usage of slurm_options is the let slurm know how many mpi processed to spawn per job, and how to allocates resources to them. :

execute_job(run_script, simulator_name, parameters_url, parameters, simulation_run_name)

This function recevies the list of parameters to modify and their values, and has to execute the corresponding mozaik simulation.

Parameters :

parameters : dict

The dictionary holding the names of parameters to be modified as keys, and the values to set them to as the corresponding values.

class mozaik.meta_workflow.parameter_search.ParameterSearch(backend)

Bases: object

This class defines the interface of parameter search. Each ParameterSearch has to implement the function generate_parameter_combinations and master_directory_name.

The parameter search is executed with the function run_parameter_search.

Furthermore each ParameterSearch receives a backend object, that determines how the simulation with a given parameter combination is executed. This allows for user to define executaion mechanisms using various cluster scheaduling architectures. See :class:.`ParameterSearchBackend` for more details.

Parameters :

params : ParameterSearchBackend

The job execution backend to use.

Examples

The commandline usage should be:

>>> parameter_search_script simulation_run_script simulator_name path_to_root_parameter_file
generate_parameter_combinations()

Returns a list of dictionaries, each holding the modified parameters as keys, and a combination of their values as the values.

master_directory_name()

Returns the name of the master directory which will contain results from the invididual simulation runs.

This method will run the parameter search replacing each combination of values defined by dictionary params in the default parametrization and runing the simulation with each such modified parameters, storing the results of each simulation run in a subdirectory named based on the given modified parameter names and their values.

It will read the command line for the name of the script that runs individual simulations, the simulator name and the root parameter file path Command line syntax:

python parameter_search_script simulation_run_script simulator_name root_parameter_file_name

class mozaik.meta_workflow.parameter_search.CombinationParameterSearch(backend, parameter_values)

Bases: mozaik.meta_workflow.parameter_search.ParameterSearch

A ParameterSearch that recevies a list of parameters and list of values for each parameter to test. It will then test each of the combination of values.

Parameters :

parameter_values : dict

Dictionary containing parameter names as keys, and lists as values, each corresponding to the list of values to test for the given parameter.

generate_parameter_combinations()
master_directory_name()
mozaik.meta_workflow.parameter_search.parameter_combinations(arrays)

meta_workflow.visualization Module

Previous topic

visualization Package

Next topic

sheets Package

This Page