diff --git a/src/aiida_quantumespresso/workflows/pw/bands.py b/src/aiida_quantumespresso/workflows/pw/bands.py index e6c5f77c..ea24b5bd 100644 --- a/src/aiida_quantumespresso/workflows/pw/bands.py +++ b/src/aiida_quantumespresso/workflows/pw/bands.py @@ -123,6 +123,9 @@ def get_protocol_filepath(cls): def get_builder_from_protocol(cls, code, structure, protocol=None, overrides=None, options=None, **kwargs): """Return a builder prepopulated with inputs selected according to the chosen protocol. + The current protocols rely on the `Slurm` scheduler. To use them nonetheless with a different scheduler, the + protocols might need to be adjusted and explicit resources need to be provided in `options`. + :param code: the ``Code`` instance configured for the ``quantumespresso.pw`` plugin. :param structure: the ``StructureData`` instance to use. :param protocol: protocol to use, if not specified, the default will be used. diff --git a/src/aiida_quantumespresso/workflows/pw/base.py b/src/aiida_quantumespresso/workflows/pw/base.py index 4a3ab038..edd1d557 100644 --- a/src/aiida_quantumespresso/workflows/pw/base.py +++ b/src/aiida_quantumespresso/workflows/pw/base.py @@ -1,5 +1,7 @@ # -*- coding: utf-8 -*- """Workchain to run a Quantum ESPRESSO pw.x calculation with automated error handling and restarts.""" +import warnings + from aiida import orm from aiida.common import AttributeDict, exceptions from aiida.common.lang import type_check @@ -117,6 +119,9 @@ def get_builder_from_protocol( ): """Return a builder prepopulated with inputs selected according to the chosen protocol. + The current protocols rely on the `Slurm` scheduler. To use them nonetheless with a different scheduler, the + protocols might need to be adjusted and explicit resources need to be provided in `options`. + :param code: the ``Code`` instance configured for the ``quantumespresso.pw`` plugin. :param structure: the ``StructureData`` instance to use. :param protocol: protocol to use, if not specified, the default will be used. @@ -208,6 +213,12 @@ def get_builder_from_protocol( metadata = inputs['pw']['metadata'] + if not options or options.get('resources', None) is None: + warnings.warn( + 'No explicit resources were provided for `metadata.options.resources`. This approach is ' + 'deprecated and will cause an error in future versions.', UserWarning + ) + if options: metadata['options'] = recursive_merge(inputs['pw']['metadata']['options'], options) diff --git a/src/aiida_quantumespresso/workflows/pw/relax.py b/src/aiida_quantumespresso/workflows/pw/relax.py index 2888a3e3..c9329aa8 100644 --- a/src/aiida_quantumespresso/workflows/pw/relax.py +++ b/src/aiida_quantumespresso/workflows/pw/relax.py @@ -90,6 +90,9 @@ def get_builder_from_protocol( ): """Return a builder prepopulated with inputs selected according to the chosen protocol. + The current protocols rely on the `Slurm` scheduler. To use them nonetheless with a different scheduler, the + protocols might need to be adjusted and explicit resources need to be provided in `options`. + :param code: the ``Code`` instance configured for the ``quantumespresso.pw`` plugin. :param structure: the ``StructureData`` instance to use. :param protocol: protocol to use, if not specified, the default will be used.