Skip to content

Commit

Permalink
create separate threadpool config for GHA runner
Browse files Browse the repository at this point in the history
  • Loading branch information
svandenhaute committed Oct 24, 2023
1 parent 4a724af commit 61fc663
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/run_pytest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ jobs:
pip install git+https://github.com/mir-group/allegro --no-deps
pip install git+https://github.com/svandenhaute/openmm-ml.git@triclinic
pip install 'psiflow[test] @ git+https://github.com/molmod/psiflow.git'
pytest --skip-gpu
pytest --skip-gpu --psiflow-config=.github/workflows/threadpool.py
shell: micromamba-shell {0}
67 changes: 67 additions & 0 deletions .github/workflows/threadpool.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
from parsl.config import Config
from parsl.executors import ThreadPoolExecutor
from parsl.providers import LocalProvider

from psiflow.execution import (
Default,
ModelEvaluation,
ModelTraining,
ReferenceEvaluation,
)

default = Default(
parsl_provider=LocalProvider(), # unused
)
model_evaluation = ModelEvaluation(
parsl_provider=LocalProvider(),
cores_per_worker=1,
max_walltime=1, # timeout after 10 seconds
simulation_engine="openmm",
gpu=False,
)
model_training = ModelTraining(
parsl_provider=LocalProvider(),
gpu=False,
max_walltime=1,
)
reference_evaluation = ReferenceEvaluation(
parsl_provider=LocalProvider(),
cores_per_worker=1,
max_walltime=1,
mpi_command=lambda x: f"mpirun -np {x}",
)
definitions = [
default,
model_evaluation,
model_training,
reference_evaluation,
]


def get_config(path_internal):
executors = [
ThreadPoolExecutor(
label="Default",
max_threads=default.cores_per_worker,
working_dir=str(path_internal),
),
ThreadPoolExecutor(
label="ModelTraining",
max_threads=model_training.cores_per_worker,
working_dir=str(path_internal),
),
ThreadPoolExecutor(
label="ModelEvaluation",
max_threads=model_evaluation.cores_per_worker,
working_dir=str(path_internal),
),
ThreadPoolExecutor(
label="ReferenceEvaluation",
max_threads=reference_evaluation.cores_per_worker,
working_dir=str(path_internal),
),
]
config = Config(
executors, run_dir=str(path_internal), usage_tracking=False, app_cache=False
)
return config, definitions

0 comments on commit 61fc663

Please sign in to comment.