Hopla is a lightweight tool for submitting script for computation within a PBS cluster. It basically wraps submission and provide access to logs.
Note
This page is a reference documentation. It only explains the class signature, and not how to use it. Please refer to the gallery for the big picture.
- class hopla.executor.Executor(folder, queue, name='hopla', memory=2, walltime=72, n_cpus=1, n_gpus=0, modules=None, image_path=None, project_id=None)[source]¶
Base job executor.
- Parameters:
folder : Path/str
folder for storing job submission/output and logs.
queue : str
the name of the queue where the jobs will be submited.
name : str, default ‘hopla’
the name of the submitted jobs.
memory : float , default 2
the memory allocated to each job (in GB).
walltime : int default 72
the walltime used for each job (in hours).
n_cpus : int, default 1
the number of cores allocated for each job.
n_gpus : int, default 0
the number of GPUs allocated for each job.
modules : list of str, default None
the environment modules to be loaded.
image_path : str, default None
path to an exported docker image.
project_id : str, default None
the project ID where you have computing hours.
Examples
>>> import hopla >>> executor = hopla.Executor(folder="/tmp/hopla", queue="Nspin_long") >>> jobs = [executor.submit("sleep", k) for k in range(1, 11)] >>> executor(max_jobs=2) >>> print(executor.report)
- property n_done_jobs¶
Get the number of finished jobs.
- property n_jobs¶
Get the number of stacked jobs.
- property n_running_jobs¶
Get the number of running jobs.
- property n_waiting_jobs¶
Get the number of waiting jobs.
- property report¶
Generate a general report for all jobs.
- property status¶
Display current status.
Follow us