executorlib.task_scheduler.file.spawner_subprocess.execute_in_subprocess#
- executorlib.task_scheduler.file.spawner_subprocess.execute_in_subprocess(command: list, file_name: str, data_dict: dict, cache_directory: str | None = None, task_dependent_lst: list | None = None, resource_dict: dict | None = None, config_directory: str | None = None, backend: str | None = None) Popen[source]#
Execute a command in a subprocess.
- Parameters:
command (list) – The command to be executed.
file_name (str) – Name of the HDF5 file which contains the Python function
data_dict (dict) – dictionary containing the python function to be executed {“fn”: …, “args”: (), “kwargs”: {}}
cache_directory (str) – The directory to store the HDF5 files.
task_dependent_lst (list) – A list of subprocesses that the current subprocess depends on. Defaults to [].
resource_dict (dict) –
resource dictionary, which defines the resources used for the execution of the function. Example resource dictionary: {
cwd: None,
}
config_directory (str, optional) – path to the config directory.
backend (str, optional) – name of the backend used to spawn tasks.
- Returns:
The subprocess object.
- Return type:
subprocess.Popen