hpc
init_hpc_backend(backend)
Initialise cluster backend to use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
backend
|
str
|
Cluster backed to use. |
required |
Raises:
| Type | Description |
|---|---|
ImportError / ModuleNotFoundError
|
If cluster backend cannot be imported. |
Source code in model_ensembler/tasks/hpc.py
jobs(ctx, limit, match)
async
Check: Assert whether number of jobs in SLURM is under limit.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
object
|
Contextual configuration. |
required |
limit
|
int
|
Number of jobs to check for. |
required |
match
|
str
|
Prefix to match jobs by. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if number of jobs is less than limit, otherwise false. |
Source code in model_ensembler/tasks/hpc.py
quota(ctx, atleast, mnt=None)
async
Check: Make sure quota is sufficient.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
object
|
Contextual configuration. |
required |
atleast
|
int
|
Amount in kB. |
required |
mnt
|
str
|
Path for mount to check quota on if explicitly required. |
None
|
Returns:
| Type | Description |
|---|---|
bool
|
True if available space is less than atleast, false otherwise. |
Raises:
| Type | Description |
|---|---|
IndexError / TypeError
|
If quota cannot be determined. |
Source code in model_ensembler/tasks/hpc.py
submit(ctx, script=None)
async
Process: Submit a new job to SLURM.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
object
|
Contextual configuration. |
required |
script
|
str
|
Slurm submission script for sbatch. |
None
|
Returns:
| Type | Description |
|---|---|
int
|
Job identifier. |