Restrict gmxapi pytest tests to `-nt 2`
authorM. Eric Irrgang <ericirrgang@gmail.com>
Wed, 30 Sep 2020 12:39:37 +0000 (15:39 +0300)
committerM. Eric Irrgang <mei2n@virginia.edu>
Wed, 30 Sep 2020 16:31:37 +0000 (16:31 +0000)
Fixes #3704

The current change is a quick fix to alleviate pressure on the project's
automation resources. Hard-coded resource constraints should be removed
in a follow-up change.

Also, the new facility to the mdrun ResourceManager needs to be
considered in future work.

python_packaging/sample_restraint/tests/test_binding.py
python_packaging/src/gmxapi/simulation/mdrun.py
python_packaging/src/test/test_mdrun.py
python_packaging/test/pytesthelpers.py

index f0d3bb98c78a26e23ae93529698d5972f7df02dc..7dff38ca63e8a48a20065752086d12f456c37cd6 100644 (file)
@@ -42,7 +42,9 @@ def test_ensemble_potential_nompi(spc_water_box):
     print("Testing plugin potential with input file {}".format(os.path.abspath(tpr_filename)))
 
     assert gmx.version.api_is_at_least(0, 0, 5)
-    md = from_tpr([tpr_filename], append_output=False)
+    # Note that *threads* argument causes errors for MPI-enabled GROMACS.
+    # Ref #3563 and #3573
+    md = from_tpr([tpr_filename], append_output=False, threads=2)
 
     # Create a WorkElement for the potential
     params = {'sites': [1, 4],
@@ -79,7 +81,9 @@ def test_ensemble_potential_withmpi(spc_water_box):
     logger.info("Testing plugin potential with input file {}".format(os.path.abspath(tpr_filename)))
 
     assert gmx_version.api_is_at_least(0, 0, 5)
-    md = from_tpr([tpr_filename, tpr_filename], append_output=False)
+    # Note that *threads* argument causes errors for MPI-enabled GROMACS.
+    # Ref #3563 and #3573
+    md = from_tpr([tpr_filename, tpr_filename], append_output=False, threads=2)
 
     # Create a WorkElement for the potential
     params = {'sites': [1, 4],
index 066d40c4c09744f90b244b2226576446d700335c..92f904a0b818b81bf47e04ce4ed774c030fa2250 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2019, by the GROMACS development team, led by
+# Copyright (c) 2019,2020, by the GROMACS development team, led by
 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 # and including many others, as listed in the AUTHORS file in the
 # top-level source directory and at http://www.gromacs.org.
@@ -261,8 +261,12 @@ class LegacyImplementationSubscription(object):
                                                                       ensemble_rank,
                                                                       self.workdir
                                                                       ))
-                    # TODO: We have not exposed the ability to pass any run time parameters to mdrun.
-                    work = workflow.from_tpr(tpr_filenames)
+                    # TODO: Normalize the way we pass run time parameters to mdrun.
+                    # See also #3573
+                    kwargs = getattr(resource_manager, 'mdrun_kwargs', {})
+                    for key, value in kwargs.items():
+                        logger.debug('Adding mdrun run time argument: {}'.format(key + '=' + str(value)))
+                    work = workflow.from_tpr(tpr_filenames, **kwargs)
                     self.workspec = work.workspec
                     context = LegacyContext(work=self.workspec, workdir_list=workdir_list, communicator=ensemble_comm)
                     self.simulation_module_context = context
index e18d2bbe8b00c1d7545ce4c8ca8b56bc67937ee5..132267291ccadcf4894ce6742d1904340fffbf65 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2019, by the GROMACS development team, led by
+# Copyright (c) 2019,2020, by the GROMACS development team, led by
 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 # and including many others, as listed in the AUTHORS file in the
 # top-level source directory and at http://www.gromacs.org.
@@ -48,6 +48,12 @@ import pytest
 
 import gmxapi as gmx
 
+# TODO: (#3573) Normalize the handling of run-time arguments.
+from gmxapi.simulation.mdrun import ResourceManager as _ResourceManager
+# Note that *threads* argument causes errors for MPI-enabled GROMACS.
+# Ref #3563 and #3573
+_ResourceManager.mdrun_kwargs = {'threads': 2}
+
 # Configure the `logging` module before proceeding any further.
 gmx.logger.setLevel(logging.WARNING)
 
index 60ae6e034e25a664743b267fb030e36dd870dcd5..480dd45f86611065e26ba6d5816efd9b34f493c2 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2019, by the GROMACS development team, led by
+# Copyright (c) 2019,2020, by the GROMACS development team, led by
 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 # and including many others, as listed in the AUTHORS file in the
 # top-level source directory and at http://www.gromacs.org.
@@ -39,6 +39,12 @@ Define the ``withmpi_only`` test decorator.
 
 import pytest
 
+# TODO: (#3573) Normalize the handling of run-time arguments.
+from gmxapi.simulation.mdrun import ResourceManager as _ResourceManager
+# Note that *threads* argument causes errors for MPI-enabled GROMACS.
+# Ref #3563 and #3573
+_ResourceManager.mdrun_kwargs = {'threads': 2}
+
 withmpi_only = None
 
 try: