exec_func¶
- exec_func(fn: callable, *args, include_client: bool = True, **kwargs) None[source]¶
Execute the same function on both client and worker (dask-worker or mpiserver) processes.
This function enables synchronized execution across MPI infrastructure. It's particularly useful for setup tasks that need consistent state across all processes, such as changing the working directory.
- Parameters:
fn -- The function to execute.
*args -- Positional arguments to pass to the function.
include_client -- If True, the function is also executed on the client process.
**kwargs -- Keyword arguments to pass to the function.