pyiron_base.jobs.job.runfunction.run_job_with_runmode_executor_flux#
- pyiron_base.jobs.job.runfunction.run_job_with_runmode_executor_flux(job: pyiron_base.jobs.job.generic.GenericJob, executor: concurrent.futures.Executor, gpus_per_slot: int | None = None) None[source]#
Interface for the flux.job.FluxExecutor executor. Flux is a hierarchical resource management. It can either be used to replace queuing systems like SLURM or be used as a user specific queuing system within an existing allocation. pyiron provides two interfaces to flux, this executor interface as well as a traditional queuing system interface via pysqa. This executor interface is designed for the development of asynchronous simulation protocols, while the traditional queuing system interface simplifies the transition from other queuing systems like SLURM. The usuage is analog to the concurrent.futures.Executor interface:
>>> from flux.job import FluxExecutor >>> job.server.executor = FluxExecutor() >>> job.run() >>> job.server.future.done() False >>> job.server.future.result() >>> job.server.future.done() True
A word of caution - flux is currently only available on Linux, for all other operation systems the ProcessPoolExecutor from the python standard library concurrent.futures is recommended. The advantage of flux over the ProcessPoolExecutor is that flux takes over the resource management, like monitoring how many cores are available while with the ProcessPoolExecutor this is left to the user.
- Parameters:
job (GenericJob) – pyiron job object
executor (flux.job.FluxExecutor) – flux executor class which implements the executor interface defined in the python concurrent.futures.Executor class.
gpus_per_slot – number of GPUs per MPI rank, typically 1