From 2ec0e3af6a584b22012ef364e4741d0b641c140e Mon Sep 17 00:00:00 2001 From: Miki Bonacci Date: Sun, 15 Dec 2024 14:16:39 +0000 Subject: [PATCH 1/2] Adding more details on how we computed the min cpus --- .../app/submission/global_settings/model.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/aiidalab_qe/app/submission/global_settings/model.py b/src/aiidalab_qe/app/submission/global_settings/model.py index 8b2710aa8..7654462c4 100644 --- a/src/aiidalab_qe/app/submission/global_settings/model.py +++ b/src/aiidalab_qe/app/submission/global_settings/model.py @@ -257,12 +257,22 @@ def _estimate_min_cpus( `num_cpus0` : `int`, optional Reference number of CPUs. Default is 4. `t0` : `float`, optional - Reference time. Default is 129.6. + Reference time of a single scf_cycle. Default is 129.6. `tmax` : `float`, optional Maximum time limit. Default is 12 hours. `scf_cycles` : `int`, optional Reference number of SCF cycles in a relaxation. Default is 5. - + + The default values n0, v0, num_cpus0, t0 and scf_cycles are taken from the simulation of SiO2 bulk + example structure present in the app, following a moderate protocol. We then used the formula + + num_cpus = num_cpus0 * (n/n0)^3 * (v/v0)^(3/2) * (scf_cycles * t0)/tmax + + assuming that the number of CPUs scales with the number of atoms as power of 3, the volume of the system as power of 3/2, + the number of SCF cycles and the time of a single SCF cycle. The power dependence was then adjusted to match the + other reference calculations done on bulk SiO2, Silicon and Gold, using different number of cpus. + NOTE: this is a very rough estimate and should be used as a guideline only. + Returns ------- `int` @@ -272,6 +282,6 @@ def _estimate_min_cpus( return int( np.ceil( - scf_cycles * num_cpus0 * (n / n0) ** 3 * (v / v0) ** 1.5 * t0 / tmax + num_cpus0 * (n / n0) ** 3 * (v / v0) ** (3/2) * (scf_cycles * t0) / tmax ) ) From 1071d3a744404f4d06515c472e36f80261c4ca97 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 15 Dec 2024 14:17:22 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .../app/submission/global_settings/model.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/aiidalab_qe/app/submission/global_settings/model.py b/src/aiidalab_qe/app/submission/global_settings/model.py index 7654462c4..099f5dfda 100644 --- a/src/aiidalab_qe/app/submission/global_settings/model.py +++ b/src/aiidalab_qe/app/submission/global_settings/model.py @@ -262,17 +262,17 @@ def _estimate_min_cpus( Maximum time limit. Default is 12 hours. `scf_cycles` : `int`, optional Reference number of SCF cycles in a relaxation. Default is 5. - - The default values n0, v0, num_cpus0, t0 and scf_cycles are taken from the simulation of SiO2 bulk + + The default values n0, v0, num_cpus0, t0 and scf_cycles are taken from the simulation of SiO2 bulk example structure present in the app, following a moderate protocol. We then used the formula - + num_cpus = num_cpus0 * (n/n0)^3 * (v/v0)^(3/2) * (scf_cycles * t0)/tmax - - assuming that the number of CPUs scales with the number of atoms as power of 3, the volume of the system as power of 3/2, + + assuming that the number of CPUs scales with the number of atoms as power of 3, the volume of the system as power of 3/2, the number of SCF cycles and the time of a single SCF cycle. The power dependence was then adjusted to match the other reference calculations done on bulk SiO2, Silicon and Gold, using different number of cpus. NOTE: this is a very rough estimate and should be used as a guideline only. - + Returns ------- `int` @@ -282,6 +282,10 @@ def _estimate_min_cpus( return int( np.ceil( - num_cpus0 * (n / n0) ** 3 * (v / v0) ** (3/2) * (scf_cycles * t0) / tmax + num_cpus0 + * (n / n0) ** 3 + * (v / v0) ** (3 / 2) + * (scf_cycles * t0) + / tmax ) )