[gmx-developers] Regression test GmxapiMpiTests fails for GROMACS 2020.1

Christoph Pospiech cpospiech at lenovo.com
Thu Apr 16 10:40:53 CEST 2020


On Mittwoch, 15. April 2020 22:46:55 CEST Eric Irrgang <ericirrgang at gmail.com> 
wrote:
> > On Apr 15, 2020, at 5:52 PM, Christoph Pospiech <cpospiech at lenovo.com>
> > wrote:
> > 
> > Can someone point me to the magic line, where to insert '-ntomp 2' into
> > the
> > regression test for GmxapiMpiTests? I would try on my local git clone,
> > report back and share a 'git diff' (which you then can take, alter or
> > reject).
>
> Actually, that's the problem.
> 
> The CMake infrastructure is already set up to tell GmxapiMpiTests how many
> threads to use by giving it "-ntomp 2".
> 
> But the executable used by GmxapiMpiTests is not based on `gmx mdrun` and so
> does not know to do something with the "-ntomp 2" command line option.
> 
> The issue should be resolved in
> https://gitlab.com/gromacs/gromacs/-/merge_requests/83 by
> https://gitlab.com/gromacs/gromacs/-/tree/3485-gmxapimpitests-should-not-au
> tomatically-choose-its-number-of-threads
> 
> Please confirm and review.

Eric,

while I was able to see the branch 
3485-gmxapimpitests-should-not-automatically-choose-its-number-of-threads
in https://gitlab.com/, I couldn't see it in my local git clone, presumably 
because I cloned as anonymous.

I therefore downloaded 17c2cebc and a735d3c2 as plain diff and scratched the 
changes for release notes 2020.2 (which didn't exist on my 2020.1-derived 
local branch either). Next, I patched the remaining changes in.
$ patch -p1 < ../2020_fix3485_part1.patch
$ patch -p1 < ../2020_fix3485_part2.patch
$ git commit
[v2020.1_CTT f1642fa] Manually adding patches 17c2cebc and a735d3c2 to fix 
#3485.
 2 files changed, 10 insertions(+), 4 deletions(-)
$ git diff HEAD~
diff --git a/src/api/cpp/tests/CMakeLists.txt b/src/api/cpp/tests/
CMakeLists.txt
index f0ea2ce..d87d830 100644
--- a/src/api/cpp/tests/CMakeLists.txt
+++ b/src/api/cpp/tests/CMakeLists.txt
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2018,2019, by the GROMACS development team, led by
+# Copyright (c) 2018,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.
@@ -71,7 +71,7 @@ target_include_directories(gmxapi-test PRIVATE
 # Link against the gmxapi libraries and get access to its public (installed) 
headers.
 target_link_libraries(gmxapi-test PRIVATE Gromacs::gmxapi 
mdrun_test_infrastructure)
 
-gmx_register_gtest_test(GmxapiExternalInterfaceTests gmxapi-test 
OPENMP_THREADS 2 INTEGRATION_TEST)
+gmx_register_gtest_test(GmxapiExternalInterfaceTests gmxapi-test 
INTEGRATION_TEST)
 
 set_tests_properties(GmxapiExternalInterfaceTests PROPERTIES
                      WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
@@ -101,4 +101,8 @@ target_include_directories(gmxapi-mpi-test PRIVATE
                            ${CMAKE_CURRENT_SOURCE_DIR})
 target_link_libraries(gmxapi-mpi-test PRIVATE Gromacs::gmxapi 
mdrun_test_infrastructure)
 
-gmx_register_gtest_test(GmxapiMpiTests gmxapi-mpi-test MPI_RANKS 2 
OPENMP_THREADS 2 INTEGRATION_TEST)
+# Note that gmxapi-mpi-test does not have a command line argument processor,
+# so some of the information that is supposed to be conveyed through this 
macro
+# is not transmitted in the usual way. For instance, OPENMP_THREADS may have 
no
+# effect. See testingconfiguration.h
+gmx_register_gtest_test(GmxapiMpiTests gmxapi-mpi-test MPI_RANKS 2 
INTEGRATION_TEST)
diff --git a/src/api/cpp/tests/testingconfiguration.h b/src/api/cpp/tests/
testingconfiguration.h
index f3bef5f..611ab87 100644
--- a/src/api/cpp/tests/testingconfiguration.h
+++ b/src/api/cpp/tests/testingconfiguration.h
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2018,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.
@@ -115,6 +115,8 @@ public:
     {
         std::vector<std::string> mdArgs;
 
+        mdArgs.emplace_back("-ntomp");
+        mdArgs.emplace_back("1");
         mdArgs.emplace_back("-o");
         mdArgs.emplace_back(runner_.fullPrecisionTrajectoryFileName_);
         mdArgs.emplace_back("-x");


I can confirm that after adding the patches detailed above, all regression 
tests are passed and issue #3845 is now resolved.

I didn't patch in "42fce43f Explain a parameter choice.", because it moved two 
code lines and added a comment. While necessary for the GROMACS release, I 
regarded it optional for my "quick and dirty" test above. My understanding is 
that 2020.2 will have that patch included - and properly documented in the 
release notes for 2020.2 . 
-- 
Dr. Christoph Pospiech
Senior HPC & AI Performance Engineer

T +49 (351) 86269826
M +49 (171) 7655871
E cpospiech at lenovo.com

Lenovo Global Technology (Deutschland) GmbH
Meitnerstr. 9
70563 Stuttgart

Geschäftsführung: Christophe Philippe Marie Laurent und Colm Brendan Gleeson
(jeweils einzelvertretungsberechtigt)
Prokura: Dieter Stehle & Henrik Bächle (Einzelprokura)                                        
Sitz der Gesellschaft: Stuttgart                                                             
HRB-Nr.: 758298, AG Stuttgart
WEEE-Reg.-Nr.: DE79679404 



More information about the gromacs.org_gmx-developers mailing list