From 4c181ff137cfae326e69502ea23de9ac44bc89f7 Mon Sep 17 00:00:00 2001 From: TomD Date: Sat, 1 Jun 2024 00:20:37 +0100 Subject: [PATCH 1/5] add PARSL_MPI_PREFIX as prefix --- src/quacc/calculators/espresso/espresso.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/quacc/calculators/espresso/espresso.py b/src/quacc/calculators/espresso/espresso.py index fa6f370ff9..361a10858f 100644 --- a/src/quacc/calculators/espresso/espresso.py +++ b/src/quacc/calculators/espresso/espresso.py @@ -424,8 +424,11 @@ def __init__( .get("pseudo_dir", str(SETTINGS.ESPRESSO_PSEUDO)) ) + prefix = os.environ.get("PARSL_MPI_PREFIX") or SETTINGS.ESPRESSO_PARALLEL_CMD[0] + suffix = SETTINGS.ESPRESSO_PARALLEL_CMD[1] + profile = EspressoProfile( - f"{SETTINGS.ESPRESSO_PARALLEL_CMD[0]} {self._bin_path} {SETTINGS.ESPRESSO_PARALLEL_CMD[1]}", + f"{prefix} {self._bin_path} {suffix}", self._pseudo_path, ) From e33dc94de92c164f7f504f713a7dc91b69dc25c7 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 31 May 2024 23:26:14 +0000 Subject: [PATCH 2/5] pre-commit auto-fixes --- src/quacc/calculators/espresso/espresso.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/quacc/calculators/espresso/espresso.py b/src/quacc/calculators/espresso/espresso.py index 361a10858f..369e9ac3bb 100644 --- a/src/quacc/calculators/espresso/espresso.py +++ b/src/quacc/calculators/espresso/espresso.py @@ -428,8 +428,7 @@ def __init__( suffix = SETTINGS.ESPRESSO_PARALLEL_CMD[1] profile = EspressoProfile( - f"{prefix} {self._bin_path} {suffix}", - self._pseudo_path, + f"{prefix} {self._bin_path} {suffix}", self._pseudo_path ) super().__init__( From 74fa6725407ded13ddb600ecb6658e10954a7485 Mon Sep 17 00:00:00 2001 From: TomD Date: Sat, 1 Jun 2024 00:27:59 +0100 Subject: [PATCH 3/5] what was I thinking here? --- src/quacc/calculators/espresso/espresso.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/quacc/calculators/espresso/espresso.py b/src/quacc/calculators/espresso/espresso.py index 361a10858f..656d3b6ca8 100644 --- a/src/quacc/calculators/espresso/espresso.py +++ b/src/quacc/calculators/espresso/espresso.py @@ -424,7 +424,7 @@ def __init__( .get("pseudo_dir", str(SETTINGS.ESPRESSO_PSEUDO)) ) - prefix = os.environ.get("PARSL_MPI_PREFIX") or SETTINGS.ESPRESSO_PARALLEL_CMD[0] + prefix = os.environ.get("PARSL_MPI_PREFIX", "") or SETTINGS.ESPRESSO_PARALLEL_CMD[0] suffix = SETTINGS.ESPRESSO_PARALLEL_CMD[1] profile = EspressoProfile( From 4a7f7119a227f1e5ba20698ba0ff80980ce05cb3 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 31 May 2024 23:28:40 +0000 Subject: [PATCH 4/5] pre-commit auto-fixes --- src/quacc/calculators/espresso/espresso.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/quacc/calculators/espresso/espresso.py b/src/quacc/calculators/espresso/espresso.py index 7fc17850f1..669dacf85d 100644 --- a/src/quacc/calculators/espresso/espresso.py +++ b/src/quacc/calculators/espresso/espresso.py @@ -424,7 +424,9 @@ def __init__( .get("pseudo_dir", str(SETTINGS.ESPRESSO_PSEUDO)) ) - prefix = os.environ.get("PARSL_MPI_PREFIX", "") or SETTINGS.ESPRESSO_PARALLEL_CMD[0] + prefix = ( + os.environ.get("PARSL_MPI_PREFIX", "") or SETTINGS.ESPRESSO_PARALLEL_CMD[0] + ) suffix = SETTINGS.ESPRESSO_PARALLEL_CMD[1] profile = EspressoProfile( From cb5f8a89c664c6b76b37982c0197d2e83c7229f9 Mon Sep 17 00:00:00 2001 From: TomD Date: Mon, 3 Jun 2024 17:07:49 +0100 Subject: [PATCH 5/5] change is made in settings.py --- src/quacc/calculators/espresso/espresso.py | 8 ++------ src/quacc/settings.py | 5 +++++ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/quacc/calculators/espresso/espresso.py b/src/quacc/calculators/espresso/espresso.py index 669dacf85d..fa6f370ff9 100644 --- a/src/quacc/calculators/espresso/espresso.py +++ b/src/quacc/calculators/espresso/espresso.py @@ -424,13 +424,9 @@ def __init__( .get("pseudo_dir", str(SETTINGS.ESPRESSO_PSEUDO)) ) - prefix = ( - os.environ.get("PARSL_MPI_PREFIX", "") or SETTINGS.ESPRESSO_PARALLEL_CMD[0] - ) - suffix = SETTINGS.ESPRESSO_PARALLEL_CMD[1] - profile = EspressoProfile( - f"{prefix} {self._bin_path} {suffix}", self._pseudo_path + f"{SETTINGS.ESPRESSO_PARALLEL_CMD[0]} {self._bin_path} {SETTINGS.ESPRESSO_PARALLEL_CMD[1]}", + self._pseudo_path, ) super().__init__( diff --git a/src/quacc/settings.py b/src/quacc/settings.py index 8a5d6e03b4..c78a45b06f 100644 --- a/src/quacc/settings.py +++ b/src/quacc/settings.py @@ -465,8 +465,13 @@ def validate_espresso_parallel_cmd( cls, v: Union[str, tuple[str, str]] ) -> tuple[str, str]: """Clean up Espresso parallel command.""" + parsl_mpi_prefix = os.environ.get("PARSL_MPI_PREFIX") + if isinstance(v, str): v = (v, "") + if parsl_mpi_prefix: + v = (parsl_mpi_prefix, v[1]) + return v @model_validator(mode="before")