From 539af08cece2eaca471569276575e8822315b422 Mon Sep 17 00:00:00 2001 From: Ake Sandgren Date: Thu, 7 Nov 2024 12:41:17 +0100 Subject: [PATCH 1/2] gromacs: make it possible to disable single precision as build target. --- easybuild/easyblocks/g/gromacs.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/easybuild/easyblocks/g/gromacs.py b/easybuild/easyblocks/g/gromacs.py index b73f36ce18..b48f60cc0f 100644 --- a/easybuild/easyblocks/g/gromacs.py +++ b/easybuild/easyblocks/g/gromacs.py @@ -63,6 +63,8 @@ def extra_options(): extra_vars.update({ 'double_precision': [None, "Build with double precision enabled (-DGMX_DOUBLE=ON), " + "default is to build double precision unless CUDA is enabled", CUSTOM], + 'single_precision': [None, "Build with single precision enabled (-DGMX_DOUBLE=OFF), " + + "default is to build single precision", CUSTOM], 'mpisuffix': ['_mpi', "Suffix to append to MPI-enabled executables (only for GROMACS < 4.6)", CUSTOM], 'mpiexec': ['mpirun', "MPI executable to use when running tests", CUSTOM], 'mpiexec_numproc_flag': ['-np', "Flag to introduce the number of MPI tasks when running tests", CUSTOM], @@ -744,10 +746,15 @@ def run_all_steps(self, *args, **kwargs): 'mpi': 'install' } - precisions = ['single'] + precisions = [] + if self.cfg.get('single_precision') is None or self.cfg.get('single_precision'): + precisions.append('single') if self.cfg.get('double_precision') is None or self.cfg.get('double_precision'): precisions.append('double') + if precisions == []: + raise EasyBuildError("No precision selected. At least one of single/double_precision must be unset or True") + mpitypes = ['nompi'] if self.toolchain.options.get('usempi', None): mpitypes.append('mpi') From 2739cf0a4f720797140a748fbbc51c126c29d9df Mon Sep 17 00:00:00 2001 From: Ake Sandgren Date: Mon, 11 Nov 2024 07:46:10 +0100 Subject: [PATCH 2/2] gromacs: make single precision default value True. --- easybuild/easyblocks/g/gromacs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/easybuild/easyblocks/g/gromacs.py b/easybuild/easyblocks/g/gromacs.py index b48f60cc0f..4450448b86 100644 --- a/easybuild/easyblocks/g/gromacs.py +++ b/easybuild/easyblocks/g/gromacs.py @@ -63,7 +63,7 @@ def extra_options(): extra_vars.update({ 'double_precision': [None, "Build with double precision enabled (-DGMX_DOUBLE=ON), " + "default is to build double precision unless CUDA is enabled", CUSTOM], - 'single_precision': [None, "Build with single precision enabled (-DGMX_DOUBLE=OFF), " + + 'single_precision': [True, "Build with single precision enabled (-DGMX_DOUBLE=OFF), " + "default is to build single precision", CUSTOM], 'mpisuffix': ['_mpi', "Suffix to append to MPI-enabled executables (only for GROMACS < 4.6)", CUSTOM], 'mpiexec': ['mpirun', "MPI executable to use when running tests", CUSTOM], @@ -747,7 +747,7 @@ def run_all_steps(self, *args, **kwargs): } precisions = [] - if self.cfg.get('single_precision') is None or self.cfg.get('single_precision'): + if self.cfg.get('single_precision'): precisions.append('single') if self.cfg.get('double_precision') is None or self.cfg.get('double_precision'): precisions.append('double')