pyiron.base.master.serial module

class pyiron.base.master.serial.GenericOutput[source]

Bases: collections.OrderedDict

Generic Output just a place holder to store the output of the last child directly in the SerialMaster.

class pyiron.base.master.serial.SerialMasterBase(project, job_name)[source]

Bases: pyiron.base.master.generic.GenericMaster

The serial master class is a metajob consisting of a dynamic list of jobs which are executed in serial mode. The job is derived from the GenericMaster.

Parameters
  • project (ProjectHDFio) – ProjectHDFio instance which points to the HDF5 file the job is stored in

  • job_name (str) – name of the job, which has to be unique within the project

.. attribute:: job_name

name of the job, which has to be unique within the project

.. attribute:: status
execution status of the job, can be one of the following [initialized, appended, created, submitted,

running, aborted, collect, suspended, refresh, busy, finished]

.. attribute:: job_id

unique id to identify the job in the pyiron database

.. attribute:: parent_id

job id of the predecessor job - the job which was executed before the current one in the current job series

.. attribute:: master_id

job id of the master job - a meta job which groups a series of jobs, which are executed either in parallel or in serial.

.. attribute:: child_ids

list of child job ids - only meta jobs have child jobs - jobs which list the meta job as their master

.. attribute:: project

Project instance the jobs is located in

.. attribute:: project_hdf5

ProjectHDFio instance which points to the HDF5 file the job is stored in

.. attribute:: job_info_str

short string to describe the job by it is job_name and job ID - mainly used for logging

.. attribute:: working_directory

working directory of the job is executed in - outside the HDF5 file

.. attribute:: path

path to the job as a combination of absolute file system path and path within the HDF5 file.

.. attribute:: version

Version of the hamiltonian, which is also the version of the executable unless a custom executable is used.

.. attribute:: executable

Executable used to run the job - usually the path to an external executable.

.. attribute:: library_activated

For job types which offer a Python library pyiron can use the python library instead of an external executable.

.. attribute:: server

Server object to handle the execution environment for the job.

.. attribute:: queue_id

the ID returned from the queuing system - it is most likely not the same as the job ID.

.. attribute:: logger

logger object to monitor the external execution and internal pyiron warnings.

.. attribute:: restart_file_list

list of files which are used to restart the calculation from these files.

.. attribute:: job_type
Job type object with all the available job types: [‘ExampleJob’, ‘SerialMaster’, ‘ParallelMaster’,

‘ScriptJob’, ‘ListMaster’]

.. attribute:: child_names

Dictionary matching the child ID to the child job name.

.. attribute:: start_job

The first job of the series.

.. attribute:: input

The input of the start job - the first job of the series.

collect_logfiles()[source]

The collect logfiles function is required by the GenericJob class, therefore we use an empty template here.

collect_output()[source]

Collect the output files of the individual jobs and set the output of the last job to be the output of the SerialMaster - so the SerialMaster contains the same output as its last child.

copy()[source]

Copy the GenericJob object which links to the job and its HDF5 file

Returns

New GenericJob object pointing to the same job

Return type

GenericJob

create_next(job_name=None)[source]

Create the next job in the series by duplicating the previous job.

Parameters

job_name (str) – name of the new job - optional - default=’job_<index>’

Returns

next job

Return type

GenericJob

from_hdf(hdf=None, group_name=None)[source]

Restore the SerialMaster from an HDF5 file

Parameters
  • hdf (ProjectHDFio) – HDF5 group object - optional

  • group_name (str) – HDF5 subgroup name - optional

get_from_childs(path)[source]

Extract the output from all child jobs and appending it to a list

Parameters

path (str) – path inside the HDF5 files of the individual jobs like ‘output/generic/volume’

Returns

list of output from the child jobs

Return type

list

get_initial_child_name()[source]

Get name of the initial child.

Returns

name of the initial child

Return type

str

property input

Get the input of the start job - the first job of the series.

Returns

input of the start job

Return type

GenericParameters

iter_jobs(convert_to_object=True)[source]

Iterate over the jobs within the SerialMaster

Parameters

convert_to_object (bool) – load the full GenericJob object (default) or just the HDF5 / JobCore object

Returns

Yield of GenericJob or JobCore

Return type

yield

property ref_job
run_if_interactive()[source]

For jobs which executables are available as Python library, those can also be executed with a library call instead of calling an external executable. This is usually faster than a single core python job.

run_if_refresh()[source]

Internal helper function the run if refresh function is called when the job status is ‘refresh’. If the job was suspended previously, the job is going to be started again, to be continued.

run_static(**qwargs)[source]

The run static function is called by run to execute the simulation.

set_goal(convergence_goal, **qwargs)[source]

Set a convergence goal for the SerialMaster - this is necessary to stop the series.

Parameters
  • convergence_goal (Function) – the convergence goal can be any Python function, but if external packages are used like numpy they have to be imported within the function.

  • **qwargs – arguments of the convergence goal function.

set_input_to_read_only()[source]

This function enforces read-only mode for the input classes, but it has to be implement in the individual classes.

show()[source]

list all jobs in the SerialMaster

Returns

list of jobs [‘job’, <index>, <GenericJob>]

Return type

list

property start_job

Get the first job of the series.

Returns

start job

Return type

GenericJob

to_hdf(hdf=None, group_name=None)[source]

Store the SerialMaster in an HDF5 file

Parameters
  • hdf (ProjectHDFio) – HDF5 group object - optional

  • group_name (str) – HDF5 subgroup name - optional

write_input()[source]

Write the input files - for the SerialMaster this only contains convergence goal.