qcg.pilotjob.executor_api.qcgpj_executor module¶
-
class
qcg.pilotjob.executor_api.qcgpj_executor.
QCGPJExecutor
(*other_args, wd='.', resources=None, reserve_core=False, enable_rt_stats=False, wrapper_rt_stats=None, log_level='info')¶ Bases:
concurrent.futures._base.Executor
QCG-PilotJob Executor. It provides simplified interface for common uses of QCG-PilotJob
Parameters: - wd (str, optional) – Working directory where QCG-PilotJob manager should be started, by default it is a current directory
- resources (str, optional) – The resources to use. If specified forces usage of Local mode of QCG-PilotJob Manager. The format is compliant with the NODES format of QCG-PilotJob, i.e.: [node_name:]cores_on_node[,node_name2:cores_on_node][,…]. Eg. to define 4 cores on an unnamed node use resources=”4”, to define 2 nodes: node_1 with 2 cores and node_2 with 3 cores, use resources=”node_1:2,node_2:3”
- reserve_core (bool, optional) – If True reserves a core for QCG-PilotJob Manager instance, by default QCG-PilotJob Manager shares a core with computing tasks Parameters.
- enable_rt_stats (bool, optional) – If True, QCG-PilotJob Manager will collect its runtime statistics
- wrapper_rt_stats (str, optional) – The path to the QCG-PilotJob Manager tasks wrapper program used for collection of statistics
- log_level (str, optional) – Logging level for QCG-PilotJob Manager (for both service and client part).
- other_args (optional) – Optional list of additional arguments for initialisation of QCG-PilotJob Manager
Returns: Return type: None
-
shutdown
(wait=True)¶ Shutdowns the QCG-PJ manager service. If it is already closed, the method has no effect.
-
submit
(fn: Callable[[...], Union[str, Tuple[str, Dict[str, Any]]]], *args, **kwargs)¶ Submits a specific task to the QCG-PJ manager using template-based, executor-like interface.
Parameters: - fn (Callable) – A callable that returns a tuple representing a task’s template. The first element of the tuple should be a string containing a QCG-PilotJob task’s description with placeholders (identifiers preceded by $ symbol) and the second a dictionary that assigns default values for selected placeholders.
- *args (variable length list with dicts, optional) – A set of dicts which contain parameters that will be used to substitute placeholders defined in the template. Note: *args overwrite defaults, but they are overwritten by **kwargs
- **kwargs (arbitrary keyword arguments) – A set of keyword arguments that will be used to substitute placeholders defined in the template. Note: **kwargs overwrite *args and defaults.
Returns: The QCGPJFuture object assigned with the submitted task
Return type:
-
qcgpj_manager
¶ Returns current QCG-PilotJob manager instance