Merge branch release-2016
[alexxy/gromacs.git] / admin / builds / gromacs.py
index 659d0b61283d02ba42e670f29de1c0710eccd481..c517f5fdd347c1becfb131e4508cbe713c30e696 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2015,2016, by the GROMACS development team, led by
+# Copyright (c) 2015,2016,2017, 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.
@@ -34,6 +34,8 @@
 
 import os.path
 
+# These are accessible later in the script, just like other
+# declared options, via e.g. context.opts.release.
 extra_options = {
     'mdrun-only': Option.simple,
     'static': Option.simple,
@@ -47,8 +49,12 @@ extra_options = {
     'thread-mpi': Option.bool,
     'gpu': Option.bool,
     'opencl': Option.bool,
-    'openmp': Option.bool
+    'openmp': Option.bool,
+    'nranks': Option.string,
+    'npme': Option.string,
+    'gpu_id': Option.string
 }
+
 extra_projects = [Project.REGRESSIONTESTS]
 
 def do_build(context):
@@ -182,19 +188,21 @@ def do_build(context):
                 # not explicitly set
                 cmd += ' -ntomp 2'
 
-            if context.opts.gpu:
-                if context.opts.mpi or use_tmpi:
-                    gpu_id = '01' # for (T)MPI use the two GT 640-s
-                else:
-                    gpu_id = '0' # use GPU #0 by default
-                cmd += ' -gpu_id ' + gpu_id
+            if context.opts.gpu_id:
+                cmd += ' -gpu_id ' + context.opts.gpu_id
+
+            if context.opts.nranks:
+                nranks = context.opts.nranks
+            else:
+                nranks = '2'
+
+            if context.opts.npme:
+                cmd += ' -npme ' + context.opts.npme
 
-            # TODO: Add options to influence this (should be now local to the build
-            # script).
             if context.opts.mpi:
-                cmd += ' -np 2'
+                cmd += ' -np ' + nranks
             elif use_tmpi:
-                cmd += ' -nt 2'
+                cmd += ' -nt ' + nranks
             if context.opts.double:
                 cmd += ' -double'
             if context.opts.asan: