pyiron_contrib.protocol.list module
- class pyiron_contrib.protocol.list.AutoList(child_type)[source]
Bases:
ParallelList
,SerialList
Choose between SerialList and ParallelList depending on the nature of the children.
- class pyiron_contrib.protocol.list.ListVertex(child_type)[source]
Bases:
PrimitiveVertex
A base class for making wrappers to run multiple instances of the same protocol. Protocols which inherit from this class require the sub-protocol being copied to be passed in at initialization as an argument.
Attributes to be assigned to the
- child_type
A class inheriting from
Command
with which to create child instances. (Passed as an argument at instantiation.)- Type
Command
- children
The instances of the child command to execute. These are created automatically (at run-time if they don’t exist already).
- Type
list
- broadcast
Input data to be split element-wise across all the child commands. (Entries here should always have the same number of entries as there are children, i.e. each child can have its own value.)
- Type
- direct
Input data which is to be copied to each child (i.e. all children have the same value.)
- Type
- Input attributes:
n_children (int): How many children to create.
- from_hdf(hdf=None, group_name=None)[source]
Load the Vertex from an HDF5 file.
- Parameters
hdf (ProjectHDFio) – HDF5 group object.
group_name (str) – HDF5 subgroup name. (Default is None.)
- property n_history
- class pyiron_contrib.protocol.list.ParallelList(child_type, sleep_time=0)[source]
Bases:
ListVertex
A list of commands which are executed in in parallel. The current implementation uses multiprocessing.Pool.
- pool
Define the number of workers that will be utilized to run the child jobs. Instantiation and closing are handled by default in __init__ and finish.
- Type
multiprocessing.Pool
- Note
It is best to set the number of workers to the number of cores so as to prevent larger computation times due to subprocess communication between the large number of workers in a single core.
- class pyiron_contrib.protocol.list.SerialList(child_type)[source]
Bases:
ListVertex
A list of commands which are run in serial.