File: config.py

package info (click to toggle)
python-parsl 2025.01.13%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 12,072 kB
  • sloc: python: 23,817; makefile: 349; sh: 276; ansic: 45
file content (23 lines) | stat: -rw-r--r-- 690 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from parsl.config import Config
from parsl.executors import HighThroughputExecutor
from parsl.providers import LocalProvider


def make_local_config(cores_per_worker: int = 1) -> Config:
    """Generate a configuration which runs all tasks on the local system

    Args:
        cores_per_worker: Number of cores to dedicate for each task
    Returns:
        Configuration object with the requested settings
    """
    return Config(
        executors=[
            HighThroughputExecutor(
                label="htex_local",
                cores_per_worker=cores_per_worker,
                cpu_affinity='block',
                provider=LocalProvider(),
            )
        ],
    )